From: Henrik Gramner Date: Thu, 23 Mar 2017 16:51:09 +0000 (+0100) Subject: Use a larger integer type for the slice_table array X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2baa28c880d11377115bbd5508e72053f6ba61f5;p=libx264 Use a larger integer type for the slice_table array Makes it possible to use slicing with resolutions larger than 2^24 pixels. --- diff --git a/common/common.h b/common/common.h index a7591fdd..33319838 100644 --- a/common/common.h +++ b/common/common.h @@ -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 */ diff --git a/common/macroblock.c b/common/macroblock.c index 3d4f012f..8dc9f975 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -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++ ) {