[FFmpeg-devel] [PATCH 03/11] avcodec/snowenc: use log2 instead of log() / log(2...)

Michael Niedermayer michael at niedermayer.cc
Thu Oct 29 13:20:31 CET 2015


On Thu, Oct 29, 2015 at 12:20:01AM -0400, Ganesh Ajjanagadde wrote:
> This is likely more precise and conveys the intent better.
> The expression has also been accordingly simplified.
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  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);

LGTM

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151029/8512d98a/attachment.sig>


More information about the ffmpeg-devel mailing list