[FFmpeg-cvslog] avcodec/snowenc: use log2 instead of log() / log(2...)
Ganesh Ajjanagadde
git at videolan.org
Thu Oct 29 23:46:40 CET 2015
ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Thu Oct 29 00:08:32 2015 -0400| [4870d8518a9270639983da216797d02fc6c445b5] | committer: Ganesh Ajjanagadde
avcodec/snowenc: use log2 instead of log() / log(2...)
This is likely more precise and conveys the intent better.
The expression has also been accordingly simplified.
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=4870d8518a9270639983da216797d02fc6c445b5
---
libavcodec/snowenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 7e8269c..fb0cd3f 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1547,7 +1547,7 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){
}
}
- b->qlog= (int)(log(352256.0/sqrt(error)) / log(pow(2.0, 1.0/QROOT))+0.5);
+ b->qlog= (int)(QROOT * log2(352256.0/sqrt(error)) + 0.5);
}
}
}
More information about the ffmpeg-cvslog
mailing list