[FFmpeg-devel] [PATCH] WMA: use a table instead of pow() in decode_exp_vlc

Reimar Döffinger Reimar.Doeffinger
Tue Sep 29 15:50:06 CEST 2009


This one has been applied it seems.

> @@ -271,8 +339,9 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
>              return -1;
>          /* NOTE: this offset is the same as MPEG4 AAC ! */
>          last_exp += code - 60;
> -        /* XXX: use a table */
> -        v = pow(10, last_exp * (1.0 / 16.0));
> +        if ((unsigned)last_exp + 60 > FF_ARRAY_ELEMS(pow_tab))
> +            return -1;

Should we maybe add a request for samples here? If we get a real-world
sample, it might be worth to try doing something better than just giving
up here.
Note that this is in part a general question, would it make sense to
request sample for all "fail hard" errors we have where we potentially
could do better?



More information about the ffmpeg-devel mailing list