From 7c4f8297e057a439cf1f1d7cf95d05b9f27063c7 Mon Sep 17 00:00:00 2001 From: Jason Garrett-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 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; -- 2.47.3