]> granicus.if.org Git - libx264/commitdiff
Slightly improve non-RD p8x8 mode decision
authorFiona Glaser <fiona@x264.com>
Sun, 4 Oct 2009 07:48:27 +0000 (00:48 -0700)
committerFiona Glaser <fiona@x264.com>
Wed, 7 Oct 2009 00:33:59 +0000 (17:33 -0700)
Subpartition costs are effectively zero in CABAC if sub-8x8 search is off.

encoder/analyse.c

index c1c9314a0a38d2958179e1a63e6aa5c19026a52d..7ea86f4d1d855ce1aed42ec9a5ed52dc46ed0b9c 100644 (file)
@@ -1308,8 +1308,10 @@ static void x264_mb_analyse_inter_p8x8_mixed_ref( x264_t *h, x264_mb_analysis_t
         x264_macroblock_cache_mv_ptr( h, 2*x8, 2*y8, 2, 2, 0, l0m->mv );
         x264_macroblock_cache_ref( h, 2*x8, 2*y8, 2, 2, 0, l0m->i_ref );
 
-        /* mb type cost */
-        l0m->cost += a->i_lambda * i_sub_mb_p_cost_table[D_L0_8x8];
+        /* If CABAC is on and we're not doing sub-8x8 analysis, the costs
+           are effectively zero. */
+        if( !h->param.b_cabac || (h->param.analyse.inter & X264_ANALYSE_PSUB8x8) )
+            l0m->cost += a->i_lambda * i_sub_mb_p_cost_table[D_L0_8x8];
     }
 
     a->l0.i_cost8x8 = a->l0.me8x8[0].cost + a->l0.me8x8[1].cost +
@@ -1361,7 +1363,8 @@ static void x264_mb_analyse_inter_p8x8( x264_t *h, x264_mb_analysis_t *a )
 
         /* mb type cost */
         m->cost += i_ref_cost;
-        m->cost += a->i_lambda * i_sub_mb_p_cost_table[D_L0_8x8];
+        if( !h->param.b_cabac || (h->param.analyse.inter & X264_ANALYSE_PSUB8x8) )
+            m->cost += a->i_lambda * i_sub_mb_p_cost_table[D_L0_8x8];
     }
 
     a->l0.i_cost8x8 = a->l0.me8x8[0].cost + a->l0.me8x8[1].cost +