]> git.videolan.org Git - x264.git/commitdiff
More write-combining
authorHenrik Gramner <hengar-6@student.ltu.se>
Mon, 26 Apr 2010 23:44:33 +0000 (01:44 +0200)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 29 Apr 2010 17:52:55 +0000 (10:52 -0700)
common/common.h
encoder/macroblock.c
encoder/rdo.c

index 44f8c1aaca21b45b8991ff19ccd682ba26256e84..a3b5d5a95a6d487e305abe1dac4c3715609d5a27 100644 (file)
@@ -658,7 +658,7 @@ struct x264_t
             ALIGNED_8( int8_t intra4x4_pred_mode[X264_SCAN8_LUMA_SIZE] );
 
             /* i_non_zero_count if available else 0x80 */
-            ALIGNED_4( uint8_t non_zero_count[X264_SCAN8_SIZE] );
+            ALIGNED_16( uint8_t non_zero_count[X264_SCAN8_SIZE] );
 
             /* -1 if unused, -2 if unavailable */
             ALIGNED_4( int8_t ref[2][X264_SCAN8_LUMA_SIZE] );
index 1125009b3b0059780f41549c6b248f3020b4eea8..a961baf59772565c7a329691bcf151dfa0d39b42 100644 (file)
@@ -458,10 +458,10 @@ void x264_mb_encode_8x8_chroma( x264_t *h, int b_inter, int i_qp )
 
 static void x264_macroblock_encode_skip( x264_t *h )
 {
-    h->mb.i_cbp_luma = 0x00;
-    h->mb.i_cbp_chroma = 0x00;
-    memset( h->mb.cache.non_zero_count, 0, sizeof( h->mb.cache.non_zero_count ) );
-    /* store cbp */
+    for( int i = 0; i < sizeof( h->mb.cache.non_zero_count ); i += 16 )
+        M128( &h->mb.cache.non_zero_count[i] ) = M128_ZERO;
+    h->mb.i_cbp_luma = 0;
+    h->mb.i_cbp_chroma = 0;
     h->mb.cbp[h->mb.i_mb_xy] = 0;
 }
 
index 2d0fad506ace9a7bdc5bd8074759ce3972f4c8f6..4d83b6a7ef193a1bfcef87498d10bea763394095 100644 (file)
@@ -438,10 +438,13 @@ static ALWAYS_INLINE int quant_trellis_cabac( x264_t *h, int16_t *dct,
 
     if( i < b_ac )
     {
-        /* We only need to memset an empty 4x4 block.  8x8 can be
+        /* We only need to zero an empty 4x4 block. 8x8 can be
            implicitly emptied via zero nnz, as can dc. */
         if( i_coefs == 16 && !dc )
-            memset( dct, 0, 16 * sizeof(int16_t) );
+        {
+            M128( &dct[0] ) = M128_ZERO;
+            M128( &dct[8] ) = M128_ZERO;
+        }
         return 0;
     }
 
@@ -608,7 +611,10 @@ static ALWAYS_INLINE int quant_trellis_cabac( x264_t *h, int16_t *dct,
     if( bnode == &nodes_cur[0] )
     {
         if( i_coefs == 16 && !dc )
-            memset( dct, 0, 16 * sizeof(int16_t) );
+        {
+            M128( &dct[0] ) = M128_ZERO;
+            M128( &dct[8] ) = M128_ZERO;
+        }
         return 0;
     }