[x264-devel] Use a larger integer type for the slice_table array
Henrik Gramner
git at videolan.org
Mon Jun 26 21:58:21 CEST 2017
x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Thu Mar 23 17:51:09 2017 +0100| [2baa28c880d11377115bbd5508e72053f6ba61f5] | committer: Anton Mitrofanov
Use a larger integer type for the slice_table array
Makes it possible to use slicing with resolutions larger than 2^24 pixels.
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=2baa28c880d11377115bbd5508e72053f6ba61f5
---
common/common.h | 3 +--
common/macroblock.c | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
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++ )
{
More information about the x264-devel
mailing list