]> git.sesse.net Git - x264/commitdiff
Fix 10L in r1612
authorFiona Glaser <fiona@x264.com>
Wed, 26 May 2010 19:40:31 +0000 (12:40 -0700)
committerFiona Glaser <fiona@x264.com>
Wed, 26 May 2010 19:40:31 +0000 (12:40 -0700)
Stats need to be calculated before deblock strength, not after.
Broke ref stats in x264cli (no affect on actual output).

encoder/encoder.c

index 67a58b9e138f610a0d5de1c575dfd48adc6bca53..c1cf92e98d6dd325fb1ffb938fea93e1bca6459e 100644 (file)
@@ -1893,19 +1893,6 @@ static int x264_slice_write( x264_t *h )
         /* save cache */
         x264_macroblock_cache_save( h );
 
-        /* calculate deblock strength values (actual deblocking is done per-row along with hpel) */
-        if( b_deblock )
-        {
-            int mvy_limit = 4 >> h->sh.b_mbaff;
-            uint8_t (*bs)[4][4] = h->deblock_strength[h->mb.i_mb_y&h->sh.b_mbaff][h->mb.i_mb_x];
-            x264_macroblock_cache_load_deblock( h );
-            if( IS_INTRA( h->mb.type[h->mb.i_mb_xy] ) )
-                memset( bs, 3, 2*4*4*sizeof(uint8_t) );
-            else
-                h->loopf.deblock_strength( h->mb.cache.non_zero_count, h->mb.cache.ref, h->mb.cache.mv,
-                                           bs, mvy_limit, h->sh.i_type == SLICE_TYPE_B );
-        }
-
         /* accumulate mb stats */
         h->stat.frame.i_mb_count[h->mb.i_type]++;
 
@@ -1959,6 +1946,19 @@ static int x264_slice_write( x264_t *h )
             }
         }
 
+        /* calculate deblock strength values (actual deblocking is done per-row along with hpel) */
+        if( b_deblock )
+        {
+            int mvy_limit = 4 >> h->sh.b_mbaff;
+            uint8_t (*bs)[4][4] = h->deblock_strength[h->mb.i_mb_y&h->sh.b_mbaff][h->mb.i_mb_x];
+            x264_macroblock_cache_load_deblock( h );
+            if( IS_INTRA( h->mb.type[h->mb.i_mb_xy] ) )
+                memset( bs, 3, 2*4*4*sizeof(uint8_t) );
+            else
+                h->loopf.deblock_strength( h->mb.cache.non_zero_count, h->mb.cache.ref, h->mb.cache.mv,
+                                           bs, mvy_limit, h->sh.i_type == SLICE_TYPE_B );
+        }
+
         x264_ratecontrol_mb( h, mb_size );
 
         if( h->sh.b_mbaff )