aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cbrt_tablegen.h
diff options
context:
space:
mode:
authorJovan Zelincevic <jovan.zelincevic@imgtec.com>2015-06-30 11:53:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-07-09 14:41:19 +0200
commit08be74ac8154e4a8936b7023cc3a7f5396fb182c (patch)
tree525d36863acea79bb815a2ce3a28db565a952f6e /libavcodec/cbrt_tablegen.h
parentf497a9e84edb24c99a9043e1b21c7e48f3908e87 (diff)
downloadffmpeg-08be74ac8154e4a8936b7023cc3a7f5396fb182c.tar.gz
libavcodec: Implementation of AAC_fixed_decoder (LC-module) [2/4]
Add fixed point implementation of functions for generating tables Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cbrt_tablegen.h')
-rw-r--r--libavcodec/cbrt_tablegen.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/libavcodec/cbrt_tablegen.h b/libavcodec/cbrt_tablegen.h
index d8c77c2221..07ef392f65 100644
--- a/libavcodec/cbrt_tablegen.h
+++ b/libavcodec/cbrt_tablegen.h
@@ -27,13 +27,26 @@
#include <math.h>
#include "libavutil/attributes.h"
+#if USE_FIXED
+#define CBRT_RENAME(a) a ## _fixed
+#define CBRT(x) (int)floor((x).f * 8192 + 0.5)
+#else
+#define CBRT_RENAME(a) a
+#define CBRT(x) x.i
+#endif
+
#if CONFIG_HARDCODED_TABLES
+#if USE_FIXED
+#define cbrt_tableinit_fixed()
+#include "libavcodec/cbrt_fixed_tables.h"
+#else
#define cbrt_tableinit()
#include "libavcodec/cbrt_tables.h"
+#endif
#else
static uint32_t cbrt_tab[1 << 13];
-static av_cold void cbrt_tableinit(void)
+static av_cold void CBRT_RENAME(cbrt_tableinit)(void)
{
if (!cbrt_tab[(1<<13) - 1]) {
int i;
@@ -44,7 +57,7 @@ static av_cold void cbrt_tableinit(void)
uint32_t i;
} f;
f.f = pow(i, 1.0 / 3.0) * i;
- cbrt_tab[i] = f.i;
+ cbrt_tab[i] = CBRT(f);
}
}
}