[x264-devel] commit: cosmetics in residual_write (Loren Merritt )

git version control git at videolan.org
Sat Mar 22 09:46:36 CET 2008


x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Sat Mar 22 01:46:43 2008 -0600| [5a66f307ef2e71b2f1945a84f408a719ea4cc6a6]

cosmetics in residual_write

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

 encoder/cabac.c |   16 ++++++++--------
 encoder/cavlc.c |   12 ++++++------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/encoder/cabac.c b/encoder/cabac.c
index c25c65c..08c4f8d 100644
--- a/encoder/cabac.c
+++ b/encoder/cabac.c
@@ -654,9 +654,9 @@ static int x264_cabac_mb_cbf_ctxidxinc( x264_t *h, int i_cat, int i_idx )
 
         /* no need to test skip/pcm */
         if( i_mba_xy >= 0 )
-            i_nza = h->mb.cache.non_zero_count[x264_scan8[16+i_idx] - 1];
+            i_nza = h->mb.cache.non_zero_count[x264_scan8[i_idx] - 1];
         if( i_mbb_xy >= 0 )
-            i_nzb = h->mb.cache.non_zero_count[x264_scan8[16+i_idx] - 8];
+            i_nzb = h->mb.cache.non_zero_count[x264_scan8[i_idx] - 8];
     }
 
     if( IS_INTRA( h->mb.i_type ) )
@@ -1048,8 +1048,8 @@ void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
         }
         if( h->mb.i_cbp_chroma&0x02 ) /* Chroma AC residual present */
         {
-            for( i = 0; i < 8; i++ )
-                block_residual_write_cabac( h, cb, DCT_CHROMA_AC, i, h->dct.block[16+i].residual_ac, 15 );
+            for( i = 16; i < 24; i++ )
+                block_residual_write_cabac( h, cb, DCT_CHROMA_AC, i, h->dct.block[i].residual_ac, 15 );
         }
     }
 
@@ -1123,8 +1123,8 @@ void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel
             }
         }
 
-        block_residual_write_cabac( h, cb, DCT_CHROMA_AC, i8,   h->dct.block[16+i8  ].residual_ac, 15 );
-        block_residual_write_cabac( h, cb, DCT_CHROMA_AC, i8+4, h->dct.block[16+i8+4].residual_ac, 15 );
+        block_residual_write_cabac( h, cb, DCT_CHROMA_AC, 16+i8, h->dct.block[16+i8].residual_ac, 15 );
+        block_residual_write_cabac( h, cb, DCT_CHROMA_AC, 20+i8, h->dct.block[20+i8].residual_ac, 15 );
 
         i8 += x264_pixel_size[i_pixel].h >> 3;
     }
@@ -1157,8 +1157,8 @@ static void x264_i8x8_chroma_size_cabac( x264_t *h, x264_cabac_t *cb )
         if( h->mb.i_cbp_chroma == 2 )
         {
             int i;
-            for( i = 0; i < 8; i++ )
-                block_residual_write_cabac( h, cb, DCT_CHROMA_AC, i, h->dct.block[16+i].residual_ac, 15 );
+            for( i = 16; i < 24; i++ )
+                block_residual_write_cabac( h, cb, DCT_CHROMA_AC, i, h->dct.block[i].residual_ac, 15 );
         }
     }
 }
diff --git a/encoder/cavlc.c b/encoder/cavlc.c
index ff1aed2..22367a2 100644
--- a/encoder/cavlc.c
+++ b/encoder/cavlc.c
@@ -679,8 +679,8 @@ void x264_macroblock_write_cavlc( x264_t *h, bs_t *s )
         block_residual_write_cavlc( h, s, BLOCK_INDEX_CHROMA_DC, h->dct.chroma_dc[0], 4 );
         block_residual_write_cavlc( h, s, BLOCK_INDEX_CHROMA_DC, h->dct.chroma_dc[1], 4 );
         if( h->mb.i_cbp_chroma&0x02 ) /* Chroma AC residual present */
-            for( i = 0; i < 8; i++ )
-                block_residual_write_cavlc( h, s, 16 + i, h->dct.block[16+i].residual_ac, 15 );
+            for( i = 16; i < 24; i++ )
+                block_residual_write_cavlc( h, s, i, h->dct.block[i].residual_ac, 15 );
     }
 
 #ifndef RDO_SKIP_BS
@@ -746,8 +746,8 @@ int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
     {
         x264_macroblock_luma_write_cavlc( h, &s, i8, i8 );
 
-        block_residual_write_cavlc( h, &s, i8,   h->dct.block[16+i8  ].residual_ac, 15 );
-        block_residual_write_cavlc( h, &s, i8+4, h->dct.block[16+i8+4].residual_ac, 15 );
+        block_residual_write_cavlc( h, &s, 16+i8, h->dct.block[16+i8].residual_ac, 15 );
+        block_residual_write_cavlc( h, &s, 20+i8, h->dct.block[20+i8].residual_ac, 15 );
 
         i8 += x264_pixel_size[i_pixel].h >> 3;
     }
@@ -796,8 +796,8 @@ static int x264_i8x8_chroma_size_cavlc( x264_t *h )
         if( h->mb.i_cbp_chroma == 2 )
         {
             int i;
-            for( i = 0; i < 8; i++ )
-                block_residual_write_cavlc( h, &h->out.bs, 16 + i, h->dct.block[16+i].residual_ac, 15 );
+            for( i = 16; i < 24; i++ )
+                block_residual_write_cavlc( h, &h->out.bs, i, h->dct.block[i].residual_ac, 15 );
         }
     }
     return h->out.bs.i_bits_encoded;



More information about the x264-devel mailing list