[vlc-devel] [PATCH] yuvp: Work around alpha being ignored when scaling

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Feb 15 11:36:25 CET 2017


On Wed, Feb 15, 2017, at 11:31 AM, Hugo Beauzée-Luyssen wrote:
> 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.
> ---
>  modules/video_chroma/yuvp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/modules/video_chroma/yuvp.c b/modules/video_chroma/yuvp.c
> index af66d6a7bd..f7681e7a4f 100644
> --- a/modules/video_chroma/yuvp.c
> +++ b/modules/video_chroma/yuvp.c
> @@ -158,6 +158,8 @@ static picture_t *Filter( filter_t *p_filter,
> picture_t *p_pic )
>              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];
> +            if( rgbp.palette[i][3] == 0 )
> +                memset( rgbp.palette[i], 0, sizeof( rgbp.palette[i] ) );
>          }
>  
>          for( unsigned int y = 0; y < p_filter->fmt_in.video.i_height;
>          y++ )
> -- 
> 2.11.0
> 

Sorry, wrong version.

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list