]> granicus.if.org Git - libx264/commitdiff
Improved p8x4/4x8 search decision
authorFiona Glaser <fiona@x264.com>
Tue, 19 Jul 2011 06:10:30 +0000 (23:10 -0700)
committerFiona Glaser <fiona@x264.com>
Fri, 22 Jul 2011 22:49:41 +0000 (15:49 -0700)
Use the same thresholding as for p16x8/8x16.
Does p8x4/4x8 search more often, for a small compression improvement.

encoder/analyse.c

index 5e8be51c00327fea9be8629bbb7fd9c92bb7d1ff..a76238781a59ee47415b499bb148a0c3f1e84ce4 100644 (file)
@@ -2998,7 +2998,6 @@ intra_analysis:
             const unsigned int flags = h->param.analyse.inter;
             int i_type;
             int i_partition;
-            int i_thresh16x8;
             int i_satd_inter, i_satd_intra;
 
             x264_mb_analyse_load_costs( h, &analysis );
@@ -3038,7 +3037,8 @@ intra_analysis:
                     for( int i = 0; i < 4; i++ )
                     {
                         x264_mb_analyse_inter_p4x4( h, &analysis, i );
-                        if( !analysis.b_early_terminate || analysis.l0.i_cost4x4[i] < analysis.l0.me8x8[i].cost )
+                        int i_thresh8x4 = analysis.l0.me4x4[i][1].cost_mv + analysis.l0.me4x4[i][2].cost_mv;
+                        if( !analysis.b_early_terminate || analysis.l0.i_cost4x4[i] < analysis.l0.me8x8[i].cost + i_thresh8x4 )
                         {
                             int i_cost8x8 = analysis.l0.i_cost4x4[i];
                             h->mb.i_sub_partition[i] = D_L0_4x4;
@@ -3060,7 +3060,7 @@ intra_analysis:
             }
 
             /* Now do 16x8/8x16 */
-            i_thresh16x8 = analysis.l0.me8x8[1].cost_mv + analysis.l0.me8x8[2].cost_mv;
+            int i_thresh16x8 = analysis.l0.me8x8[1].cost_mv + analysis.l0.me8x8[2].cost_mv;
             if( ( flags & X264_ANALYSE_PSUB16x16 ) && (!analysis.b_early_terminate ||
                 analysis.l0.i_cost8x8 < analysis.l0.me16x16.cost + i_thresh16x8) )
             {