[vlc-devel] [RFC] [PATCHv2] Fix SPU alpha channel palette values
Rémi Denis-Courmont
remi at remlab.net
Thu Jan 7 20:04:11 CET 2010
To convert from 4-bits to 8-bits channel, one should multiply by 17.
---
modules/codec/spudec/parse.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c
index 3b23650..5c2bc30 100644
--- a/modules/codec/spudec/parse.c
+++ b/modules/codec/spudec/parse.c
@@ -701,9 +701,7 @@ static void Render( decoder_t *p_dec, subpicture_t *p_spu,
fmt.p_palette->palette[i_x][0] = p_spu_data->pi_yuv[i_x][0];
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;
+ fmt.p_palette->palette[i_x][3] = 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