[x264-devel] commit: More small speed tweaks to macroblock.c (U-TACHIKOMA\Jason )

git version control git at videolan.org
Thu Dec 11 07:44:38 CET 2008


x264 | branch: master | U-TACHIKOMA\Jason <Jason at Tachikoma.(none)> | Wed Dec 10 20:52:06 2008 -0800| [b85beee88bddc3fba3f9adaeee544d77cc4e25a0] | committer: U-TACHIKOMA\Jason 

More small speed tweaks to macroblock.c

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

 encoder/macroblock.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/encoder/macroblock.c b/encoder/macroblock.c
index 4c2c233..d2b33d1 100644
--- a/encoder/macroblock.c
+++ b/encoder/macroblock.c
@@ -594,7 +594,7 @@ void x264_macroblock_encode( x264_t *h )
 
                     h->zigzagf.scan_4x4( h->dct.luma4x4[idx], dct4x4[idx] );
 
-                    if( b_decimate && i_decimate_8x8 <= 6 )
+                    if( b_decimate && i_decimate_8x8 < 6 )
                         i_decimate_8x8 += h->quantf.decimate_score16( h->dct.luma4x4[idx] );
                 }
 
@@ -932,8 +932,13 @@ void x264_macroblock_encode_p8x8( x264_t *h, int i8 )
             {
                 for( i4 = 0; i4 < 4; i4++ )
                 {
-                    h->quantf.dequant_4x4( dct4x4[i4], h->dequant4_mf[CQM_4PY], i_qp );
-                    h->mb.cache.non_zero_count[x264_scan8[i8*4+i4]] = array_non_zero( dct4x4[i4] );
+                    if( array_non_zero( dct4x4[i4] ) )
+                    {
+                        h->quantf.dequant_4x4( dct4x4[i4], h->dequant4_mf[CQM_4PY], i_qp );
+                        h->mb.cache.non_zero_count[x264_scan8[i8*4+i4]] = 1;
+                    }
+                    else
+                        h->mb.cache.non_zero_count[x264_scan8[i8*4+i4]] = 0;
                 }
                 h->dctf.add8x8_idct( p_fdec, dct4x4 );
             }
@@ -960,9 +965,9 @@ void x264_macroblock_encode_p8x8( x264_t *h, int i8 )
             else
                 h->quantf.quant_4x4( dct4x4, h->quant4_mf[CQM_4PC][i_qp], h->quant4_bias[CQM_4PC][i_qp] );
 
-            h->zigzagf.scan_4x4( h->dct.luma4x4[16+i8+ch*4], dct4x4 );
             if( array_non_zero( dct4x4 ) )
             {
+                h->zigzagf.scan_4x4( h->dct.luma4x4[16+i8+ch*4], dct4x4 );
                 h->quantf.dequant_4x4( dct4x4, h->dequant4_mf[CQM_4PC], i_qp );
                 h->dctf.add4x4_idct( p_fdec, dct4x4 );
                 h->mb.cache.non_zero_count[x264_scan8[16+i8+ch*4]] = 1;
@@ -1000,9 +1005,9 @@ void x264_macroblock_encode_p4x4( x264_t *h, int i4 )
         DECLARE_ALIGNED_16( int16_t dct4x4[4][4] );
         h->dctf.sub4x4_dct( dct4x4, p_fenc, p_fdec );
         x264_quant_4x4( h, dct4x4, i_qp, DCT_LUMA_4x4, 0, i4 );
-        h->zigzagf.scan_4x4( h->dct.luma4x4[i4], dct4x4 );
         if( array_non_zero( dct4x4 ) )
         {
+            h->zigzagf.scan_4x4( h->dct.luma4x4[i4], dct4x4 );
             h->quantf.dequant_4x4( dct4x4, h->dequant4_mf[CQM_4PY], i_qp );
             h->dctf.add4x4_idct( p_fdec, dct4x4 );
             h->mb.cache.non_zero_count[x264_scan8[i4]] = 1;



More information about the x264-devel mailing list