[x264-devel] commit: Remove an IDIV from i8x8 analysis (Jason Garrett-Glaser )

git version control git at videolan.org
Wed Jan 14 03:17:46 CET 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Tue Jan 13 19:58:44 2009 -0500| [7c4f8297e057a439cf1f1d7cf95d05b9f27063c7] | committer: Jason Garrett-Glaser 

Remove an IDIV from i8x8 analysis
Only one IDIV is left in macroblock level code (transform_rd)

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=7c4f8297e057a439cf1f1d7cf95d05b9f27063c7
---

 encoder/analyse.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/encoder/analyse.c b/encoder/analyse.c
index f9f5abb..4ed9a71 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;



More information about the x264-devel mailing list