On Wed, Dec 3, 2014 at 3:27 AM, Vittorio Giovara
<[email protected]> wrote:
> CC: [email protected]
> Bug-Id: CID 1238835
> ---
> Yet another version, albeit tested only with fate.
> Vittorio
>
>  libavcodec/mpegaudio_tablegen.
> h | 4 ++--
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h
> index 8a3e51a..9608a68 100644
> --- a/libavcodec/mpegaudio_tablegen.h
> +++ b/libavcodec/mpegaudio_tablegen.h
> @@ -42,13 +42,12 @@ static float expval_table_float[512][16];
>
>  static void mpegaudio_tableinit(void)
>  {
> -    int i, value, exponent;
> +    int i, exponent;
>      for (i = 1; i < TABLE_4_3_SIZE; i++) {
> -        double value = i / 4;
>          double f, fm;
>          int e, m;
>          /* cbrtf() isn't available on all systems, so we use powf(). */
> -        f  = value * powf(value, 1.0 / 3.0) * pow(2, (i & 3) * 0.25);
> +        f  = (i / 4) * powf(i / 4, 1.0 / 3.0) * pow(2, (i & 3) * 0.25);
>          fm = frexp(f, &e);
>          m  = (uint32_t)(fm * (1LL << 31) + 0.5);
>          e += FRAC_BITS - 31 + 5 - 100;
> @@ -58,6 +57,7 @@ static void mpegaudio_tableinit(void)
>          table_4_3_exp[i]   = -e;
>      }
>      for (exponent = 0; exponent < 512; exponent++) {
> +        int value;
>          for (value = 0; value < 16; value++) {
>              /* cbrtf() isn't available on all systems, so we use powf(). */
>              double f = (double)value * powf(value, 1.0 / 3.0) *
> pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5);
>
> --
> 1.9.3 (koda git)

ping

-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to