From 3a2a2a4c29a5c835f97498885754f2be37617b22 Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Tue, 13 Jan 2009 19:58:44 -0500 Subject: [PATCH] Remove an IDIV from i8x8 analysis Only one IDIV is left in macroblock level code (transform_rd) --- encoder/analyse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/encoder/analyse.c b/encoder/analyse.c index 6d75fe5a..96574333 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; -- 2.40.0