[vlc-devel] [PATCH] avcodec: use larger block when encoding tiff

Tristan Matthews le.businessman at gmail.com
Fri Jun 13 17:08:13 CEST 2014


Fixes #11605
---
 modules/codec/avcodec/encoder.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 65ce285..581861a 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1026,7 +1026,13 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
                          p_sys->p_context->bits_per_coded_sample ?
                          p_sys->p_context->bits_per_coded_sample :
                          24;
-    const int blocksize = __MAX( FF_MIN_BUFFER_SIZE, ( bitsPerPixel * p_sys->p_context->height * p_sys->p_context->width ) / 8 + 200 );
+    unsigned blocksize = __MAX( FF_MIN_BUFFER_SIZE, ( bitsPerPixel * p_sys->p_context->height * p_sys->p_context->width ) / 8 + 200 );
+    if( p_enc->fmt_out.i_codec == VLC_CODEC_TIFF )
+    {
+        blocksize = 2 * blocksize +
+                    4 * p_sys->p_context->height; /* space for strip sizes */
+    }
+
     block_t *p_block = block_Alloc( blocksize );
     if( unlikely(p_block == NULL) )
         return NULL;
-- 
1.9.1




More information about the vlc-devel mailing list