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

Hugo Beauzée-Luyssen git at videolan.org
Thu Feb 16 09:54:11 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Feb 15 11:13:34 2017 +0100| [3f59276c149c064fea189b3f6a57fb0de89e6a40] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f59276c149c064fea189b3f6a57fb0de89e6a40
---

 modules/video_chroma/yuvp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/video_chroma/yuvp.c b/modules/video_chroma/yuvp.c
index af66d6a..ea702f5 100644
--- a/modules/video_chroma/yuvp.c
+++ b/modules/video_chroma/yuvp.c
@@ -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];



More information about the vlc-commits mailing list