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>
This commit is contained in:
Jovan Zelincevic
2015-06-30 11:53:04 +02:00
committed by Michael Niedermayer
parent f497a9e84e
commit 08be74ac81
16 changed files with 680 additions and 35 deletions

View File

@@ -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);
}
}
}