diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-01-15 16:28:03 -0500 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2013-10-15 16:52:07 +0100 |
commit | 008014b5e72442fe7c8bf4a31e6bb74469b81359 (patch) | |
tree | 31f96fd701ed2e92a97f2e680b7b8611ebcd4965 /libavcodec/cbrt_tablegen.h | |
parent | 00aa24ffee91d52488765088ea0f60748e2a2083 (diff) | |
download | ffmpeg-008014b5e72442fe7c8bf4a31e6bb74469b81359.tar.gz |
tablegen: Don't use cbrtf in host tools
You cannot count on them being present on all systems, and you
cannot include libm.h in a host tool, so just hard code baseline
implementations.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/cbrt_tablegen.h')
-rw-r--r-- | libavcodec/cbrt_tablegen.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/cbrt_tablegen.h b/libavcodec/cbrt_tablegen.h index a9d34dc75d..5ef97c8545 100644 --- a/libavcodec/cbrt_tablegen.h +++ b/libavcodec/cbrt_tablegen.h @@ -36,12 +36,13 @@ static void 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 = cbrtf(i) * i; + f.f = powf(i, 1.0 / 3.0) * i; cbrt_tab[i] = f.i; } } |