From: Jason Garrett-Glaser Date: Wed, 14 Jan 2009 00:58:44 +0000 (-0500) Subject: Remove an IDIV from i8x8 analysis X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=7c4f8297e057a439cf1f1d7cf95d05b9f27063c7;p=x264.git Remove an IDIV from i8x8 analysis Only one IDIV is left in macroblock level code (transform_rd) --- diff --git a/encoder/analyse.c b/encoder/analyse.c index f9f5abb7..4ed9a717 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -727,8 +727,9 @@ static void x264_mb_analyse_intra( x264_t *h, x264_mb_analysis_t *a, int i_satd_ } else { + static const uint16_t cost_div_fix8[3] = {1024,512,341}; a->i_satd_i8x8 = COST_MAX; - i_cost = i_cost * 4/(idx+1); + i_cost = (i_cost * cost_div_fix8[idx]) >> 8; } if( X264_MIN(i_cost, a->i_satd_i16x16) > i_satd_inter*(5+!!a->i_mbrd)/4 ) return;