Commit 3f59276c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

yuvp: Work around alpha being ignored when scaling

This is a not-so-great fix for #15983
When swscale will scale the subpicture, it will ignore the alpha
component when interpolation is performed.
In the case of dvbsub, this often causes the filling color to be rendered as
green on the edges of region subparts.
parent a7b5e8c9
......@@ -155,6 +155,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
const uint8_t a = p_filter->fmt_out.video.i_chroma == VLC_CODEC_ARGB ? 0 : 3;
for( int i = 0; i < p_yuvp->i_entries; i++ )
{
if( p_yuvp->palette[i][3] == 0 )
{
memset( rgbp.palette[i], 0, sizeof( rgbp.palette[i] ) );
continue;
}
Yuv2Rgb( &rgbp.palette[i][r], &rgbp.palette[i][g], &rgbp.palette[i][b],
p_yuvp->palette[i][0], p_yuvp->palette[i][1], p_yuvp->palette[i][2] );
rgbp.palette[i][a] = p_yuvp->palette[i][3];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment