]> granicus.if.org Git - libx264/commitdiff
Use a larger integer type for the slice_table array
authorHenrik Gramner <henrik@gramner.com>
Thu, 23 Mar 2017 16:51:09 +0000 (17:51 +0100)
committerAnton Mitrofanov <BugMaster@narod.ru>
Wed, 14 Jun 2017 20:22:58 +0000 (23:22 +0300)
Makes it possible to use slicing with resolutions larger than 2^24 pixels.

common/common.h
common/macroblock.c

index a7591fddadf8bbaa3e023c074d01483eaaa79c99..333198383f5762d7346a69c9e2f1bde06251cc7d 100644 (file)
@@ -740,8 +740,7 @@ struct x264_t
         int16_t (*mvr[2][X264_REF_MAX*2])[2];/* 16x16 mv for each possible ref */
         int8_t  *skipbp;                    /* block pattern for SKIP or DIRECT (sub)mbs. B-frames + cabac only */
         int8_t  *mb_transform_size;         /* transform_size_8x8_flag of each mb */
-        uint16_t *slice_table;              /* sh->first_mb of the slice that the indexed mb is part of
-                                             * NOTE: this will fail on resolutions above 2^16 MBs... */
+        uint32_t *slice_table;              /* sh->first_mb of the slice that the indexed mb is part of */
         uint8_t *field;
 
          /* buffer for weighted versions of the reference frames */
index 3d4f012fe19c4ccb420ccbd12ff3a1a11a3a9d0e..8dc9f9757b612c36068336bfe0c2d39ee7b9e47e 100644 (file)
@@ -260,7 +260,7 @@ int x264_macroblock_cache_allocate( x264_t *h )
     PREALLOC( h->mb.qp, i_mb_count * sizeof(int8_t) );
     PREALLOC( h->mb.cbp, i_mb_count * sizeof(int16_t) );
     PREALLOC( h->mb.mb_transform_size, i_mb_count * sizeof(int8_t) );
-    PREALLOC( h->mb.slice_table, i_mb_count * sizeof(uint16_t) );
+    PREALLOC( h->mb.slice_table, i_mb_count * sizeof(uint32_t) );
 
     /* 0 -> 3 top(4), 4 -> 6 : left(3) */
     PREALLOC( h->mb.intra4x4_pred_mode, i_mb_count * 8 * sizeof(int8_t) );
@@ -326,7 +326,7 @@ int x264_macroblock_cache_allocate( x264_t *h )
 
     PREALLOC_END( h->mb.base );
 
-    memset( h->mb.slice_table, -1, i_mb_count * sizeof(uint16_t) );
+    memset( h->mb.slice_table, -1, i_mb_count * sizeof(uint32_t) );
 
     for( int i = 0; i < 2; i++ )
     {