X-Git-Url: https://git.videolan.org/?p=ffmpeg.git;a=blobdiff_plain;f=libavcodec%2Fcbrt_tablegen.h;h=59b5a1d2363d8557db7f798a6fe882717b5af64b;hp=27a3e3ae29df51b745bee8b74b7b5a44f0ab7368;hb=2f5075f5513fdec21ddba802af0f2433fcfd430e;hpb=1d0c94ddaef8225c75f72d5d8c54c34270f88d80 diff --git a/libavcodec/cbrt_tablegen.h b/libavcodec/cbrt_tablegen.h index 27a3e3ae29..59b5a1d236 100644 --- a/libavcodec/cbrt_tablegen.h +++ b/libavcodec/cbrt_tablegen.h @@ -29,7 +29,7 @@ #include "libavcodec/aac_defines.h" #if USE_FIXED -#define CBRT(x) (int)floor((x).f * 8192 + 0.5) +#define CBRT(x) lrint((x).f * 8192) #else #define CBRT(x) x.i #endif @@ -49,13 +49,12 @@ static av_cold void AAC_RENAME(cbrt_tableinit)(void) { if (!cbrt_tab[(1<<13) - 1]) { int i; - /* cbrtf() isn't available on all systems, so we use powf(). */ for (i = 0; i < 1<<13; i++) { union { float f; uint32_t i; } f; - f.f = pow(i, 1.0 / 3.0) * i; + f.f = cbrt(i) * i; cbrt_tab[i] = CBRT(f); } }