From f7c6d308f38b3193dbb7bd9f427252e296dfcbfe Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Tue, 14 Jun 2011 09:35:03 -0700 Subject: [PATCH] Make left_index_table const Should allow for some missed compiler optimizations in macroblock_cache_load. --- common/common.h | 2 +- common/macroblock.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/common.h b/common/common.h index 7768571d..d9e87997 100644 --- a/common/common.h +++ b/common/common.h @@ -632,7 +632,7 @@ struct x264_t int i_mb_top_y; int i_mb_topleft_y; int i_mb_topright_y; - x264_left_table_t *left_index_table; + const x264_left_table_t *left_index_table; int i_mb_top_mbpair_xy; int topleft_partition; int b_allow_skip; diff --git a/common/macroblock.c b/common/macroblock.c index c166614d..891cf999 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -588,7 +588,7 @@ static void ALWAYS_INLINE x264_macroblock_load_pic_pointers( x264_t *h, int mb_x } } -x264_left_table_t left_indices[4] = +static const x264_left_table_t left_indices[4] = { /* Current is progressive */ {{ 4, 4, 5, 5}, { 3, 3, 7, 7}, {16+1, 16+1, 16+4+1, 16+4+1}, {0, 0, 1, 1}, {0, 0, 0, 0}}, @@ -800,7 +800,7 @@ void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int mb_y, in uint8_t (*nnz)[24] = h->mb.non_zero_count; int16_t *cbp = h->mb.cbp; - x264_left_table_t *left_index_table = h->mb.left_index_table; + const x264_left_table_t *left_index_table = h->mb.left_index_table; /* load cache */ if( h->mb.i_neighbour & MB_TOP ) @@ -1343,7 +1343,7 @@ void x264_macroblock_deblock_strength( x264_t *h ) int s4x4 = h->mb.i_b4_stride; uint8_t (*nnz)[24] = h->mb.non_zero_count; - x264_left_table_t *left_index_table = SLICE_MBAFF ? h->mb.left_index_table : &left_indices[3]; + const x264_left_table_t *left_index_table = SLICE_MBAFF ? h->mb.left_index_table : &left_indices[3]; if( h->mb.i_neighbour & MB_TOP ) CP32( &h->mb.cache.non_zero_count[x264_scan8[0] - 8], &nnz[h->mb.i_mb_top_xy][12] ); -- 2.40.0