From 4870d8518a9270639983da216797d02fc6c445b5 Mon Sep 17 00:00:00 2001 From: Ganesh Ajjanagadde Date: Thu, 29 Oct 2015 00:08:32 -0400 Subject: [PATCH] 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 Signed-off-by: Ganesh Ajjanagadde --- libavcodec/snowenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 7e8269cd92..fb0cd3f474 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); } } }