[vlc-devel] [RFC] [PATCH] Fix SPU alpha channel palette values

Rémi Denis-Courmont remi at remlab.net
Thu Jan 7 19:58:57 CET 2010


To convert from 4-bits to 8-bits channel, one should multiply by 17.

---
 modules/codec/spudec/parse.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c
index 3b23650..1d347ad 100644
--- a/modules/codec/spudec/parse.c
+++ b/modules/codec/spudec/parse.c
@@ -702,8 +702,7 @@ static void Render( decoder_t *p_dec, subpicture_t *p_spu,
         fmt.p_palette->palette[i_x][1] = p_spu_data->pi_yuv[i_x][1];
         fmt.p_palette->palette[i_x][2] = p_spu_data->pi_yuv[i_x][2];
         fmt.p_palette->palette[i_x][3] =
-            p_spu_data->pi_alpha[i_x] == 0xf ? 0xff :
-            p_spu_data->pi_alpha[i_x] << 4;
+            p_spu_data->pi_alpha[i_x] == p_spu_data->pi_alpha[i_x] * 0x11;
     }
 
     p_spu->p_region = subpicture_region_New( &fmt );
-- 
1.6.6




More information about the vlc-devel mailing list