summaryrefslogtreecommitdiff
path: root/libavcodec/cbrt_tablegen.h
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2013-01-15 16:08:59 -0500
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2013-10-15 17:00:28 +0100
commitbc31a7a3b6bcd7409e4440d7d8124006813fe15a (patch)
treec013de7d9dcb5f207defc4aefb6b1821e5d0961b /libavcodec/cbrt_tablegen.h
parent884fd4d2590c30c7787fc05b86b050125fd53f33 (diff)
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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/cbrt_tablegen.h b/libavcodec/cbrt_tablegen.h
index 01963a3f9d..60d900a94f 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;
}
}