[x264-devel] Make left_index_table const

Jason Garrett-Glaser git at videolan.org
Wed Jun 15 04:54:17 CEST 2011


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Tue Jun 14 09:35:03 2011 -0700| [48d2185065571e983885fab858ad996a37b08be3] | committer: Jason Garrett-Glaser

Make left_index_table const
Should allow for some missed compiler optimizations in macroblock_cache_load.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=48d2185065571e983885fab858ad996a37b08be3
---

 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 7768571..d9e8799 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 9eefc0a..686fd50 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] );



More information about the x264-devel mailing list