[vlc-commits] [Git][videolan/vlc][master] codec/ttml: convert PNG to RGBA

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed Aug 2 22:59:20 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
0a31710d by Steve Lhomme at 2023-08-02T22:39:35+00:00
codec/ttml: convert PNG to RGBA

We have a test for this conversion (test/src/misc/image.c).
RGBA is the preferred chroma for SPU (no conversion needed).

And the conversion from PNG to RGBA is probably more efficient than to
YUVA.

- - - - -


1 changed file:

- modules/codec/ttml/substtml.c


Changes:

=====================================
modules/codec/ttml/substtml.c
=====================================
@@ -1203,15 +1203,15 @@ static picture_t * picture_CreateFromPNG( decoder_t *p_dec,
 {
     if( i_data < 16 )
         return NULL;
-        
+
     video_format_t fmt_out;
-    video_format_Init( &fmt_out, VLC_CODEC_YUVA );
-    
+    video_format_Init( &fmt_out, VLC_CODEC_RGBA );
+
     if ( isValidPixelsExtent( flags, extent_x, extent_y ) )
     {
         setPixelsWidthAndHeight( &fmt_out, extent_x, extent_y );
     }
-    
+
     es_format_t es_in;
     es_format_Init( &es_in, VIDEO_ES, VLC_CODEC_PNG );
     es_in.video.i_chroma = es_in.i_codec;
@@ -1230,7 +1230,7 @@ static picture_t * picture_CreateFromPNG( decoder_t *p_dec,
     if( p_image )
     {
         p_pic = image_Read( p_image, p_block, &es_in, &fmt_out );
-        
+
         if ( p_pic && isValidPercentsExtent( flags, extent_x, extent_y ) )
         {
             picture_t *p_scaled_pic = rescalePicture( p_image, p_pic, extent_x, extent_y );
@@ -1241,7 +1241,7 @@ static picture_t * picture_CreateFromPNG( decoder_t *p_dec,
                 p_pic = p_scaled_pic;
             }
         }
-        
+
         image_HandlerDelete( p_image );
     }
     else block_Release( p_block );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0a31710d81eacec08a0ad7f6ba5890ed803b377c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0a31710d81eacec08a0ad7f6ba5890ed803b377c
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list