[FFmpeg-cvslog] avcodec/zmbvenc: use log2 instead of log()/M_LN2

Ganesh Ajjanagadde git at videolan.org
Thu Oct 29 23:46:41 CET 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Thu Oct 29 00:10:45 2015 -0400| [603d62745710220f9ecd97f4d0cc6831394ebcd3] | committer: Ganesh Ajjanagadde

avcodec/zmbvenc: use log2 instead of log()/M_LN2

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=603d62745710220f9ecd97f4d0cc6831394ebcd3
---

 libavcodec/zmbvenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
index df06e37..e832bed 100644
--- a/libavcodec/zmbvenc.c
+++ b/libavcodec/zmbvenc.c
@@ -277,7 +277,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
     int lvl = 9;
 
     for(i=1; i<256; i++)
-        score_tab[i]= -i * log(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * (256/M_LN2);
+        score_tab[i]= -i * log2(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * 256;
 
     c->avctx = avctx;
 



More information about the ffmpeg-cvslog mailing list