From: Fiona Glaser Date: Sun, 4 Oct 2009 07:48:27 +0000 (-0700) Subject: Slightly improve non-RD p8x8 mode decision X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8270136f6ec2fc72087d1e8f15eed849300768e6;p=libx264 Slightly improve non-RD p8x8 mode decision Subpartition costs are effectively zero in CABAC if sub-8x8 search is off. --- diff --git a/encoder/analyse.c b/encoder/analyse.c index c1c9314a..7ea86f4d 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -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 +