Fix SPU alpha channel palette values
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 7 Jan 2010 19:04:11 +0000 (21:04 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 9 Jan 2010 10:14:04 +0000 (12:14 +0200)
To convert from 4-bits to 8-bits channel, one should multiply by 17.

Acked-by: Antoine Cellerier <dionoea@videolan.org>
modules/codec/spudec/parse.c

index 3b23650..5c2bc30 100644 (file)
@@ -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 );