mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 03:50:05 +01:00
Merge remote-tracking branch 'qatar/master'
* qatar/master:
vc1: export some functions
configure: use HOSTCC_C/O in check_host_cc
configure: use AS_O setting in check_as
configure: use LD_O setting in check_ld()
Revert "dsputil: make {add/put/put_signed}_pixels_clamped() non-static."
build: Restore dependency of acelp_filters.o on celp_math.o
celp_math: Replace duplicate ff_dot_productf() by ff_scalarproduct_c()
celp_math: Move ff_cos() to the only place it is used
build: Use portable abstraction for linker/hostcc output file syntax
configure: Fix shared library creation for OpenBSD
vp56: Don't use DECLARE_ALIGN on a typedef name
mss1: move code that will be reused by MSS2 decoder into separate file
mss1: merge decode_intra() and decode_inter()
avprobe: Get rid of ugly casts in the options table
vf_hqdn3d: Remove a duplicate inline declaration
Conflicts:
Makefile
configure
ffprobe.c
libavcodec/Makefile
libavcodec/amrnbdec.c
libavcodec/amrwbdec.c
libavcodec/celp_math.c
libavcodec/celp_math.h
libavcodec/dsputil.c
libavcodec/lsp.c
libavcodec/mss1.c
libavcodec/ra288.c
libavcodec/vc1dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -29,97 +29,6 @@
|
||||
#include "celp_math.h"
|
||||
#include "libavutil/common.h"
|
||||
|
||||
#ifdef G729_BITEXACT
|
||||
/**
|
||||
* Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
|
||||
*/
|
||||
static const int16_t base_cos[64] =
|
||||
{
|
||||
32767, 32729, 32610, 32413, 32138, 31786, 31357, 30853,
|
||||
30274, 29622, 28899, 28106, 27246, 26320, 25330, 24279,
|
||||
23170, 22006, 20788, 19520, 18205, 16846, 15447, 14010,
|
||||
12540, 11039, 9512, 7962, 6393, 4808, 3212, 1608,
|
||||
0, -1608, -3212, -4808, -6393, -7962, -9512, -11039,
|
||||
-12540, -14010, -15447, -16846, -18205, -19520, -20788, -22006,
|
||||
-23170, -24279, -25330, -26320, -27246, -28106, -28899, -29622,
|
||||
-30274, -30853, -31357, -31786, -32138, -32413, -32610, -32729
|
||||
};
|
||||
|
||||
/**
|
||||
* Slope used to compute cos(x)
|
||||
*
|
||||
* cos(ind*64+offset) = base_cos[ind]+offset*slope_cos[ind]
|
||||
* values multiplied by 1<<19
|
||||
*/
|
||||
static const int16_t slope_cos[64] =
|
||||
{
|
||||
-632, -1893, -3150, -4399, -5638, -6863, -8072, -9261,
|
||||
-10428, -11570, -12684, -13767, -14817, -15832, -16808, -17744,
|
||||
-18637, -19486, -20287, -21039, -21741, -22390, -22986, -23526,
|
||||
-24009, -24435, -24801, -25108, -25354, -25540, -25664, -25726,
|
||||
-25726, -25664, -25540, -25354, -25108, -24801, -24435, -24009,
|
||||
-23526, -22986, -22390, -21741, -21039, -20287, -19486, -18637,
|
||||
-17744, -16808, -15832, -14817, -13767, -12684, -11570, -10428,
|
||||
-9261, -8072, -6863, -5638, -4399, -3150, -1893, -632
|
||||
};
|
||||
|
||||
/**
|
||||
* Table used to compute exp2(x)
|
||||
*
|
||||
* tab_exp2[i] = (1<<14) * exp2(i/32) = 2^(i/32) i=0..32
|
||||
*/
|
||||
static const uint16_t tab_exp2[33] =
|
||||
{
|
||||
16384, 16743, 17109, 17484, 17867, 18258, 18658, 19066, 19484, 19911,
|
||||
20347, 20792, 21247, 21713, 22188, 22674, 23170, 23678, 24196, 24726,
|
||||
25268, 25821, 26386, 26964, 27554, 28158, 28774, 29405, 30048, 30706,
|
||||
31379, 32066, 32767
|
||||
};
|
||||
|
||||
int16_t ff_cos(uint16_t arg)
|
||||
{
|
||||
uint8_t offset= arg;
|
||||
uint8_t ind = arg >> 8;
|
||||
|
||||
av_assert2(arg < 0x4000);
|
||||
|
||||
return FFMAX(base_cos[ind] + ((slope_cos[ind] * offset) >> 12), -0x8000);
|
||||
}
|
||||
|
||||
int ff_exp2(uint16_t power)
|
||||
{
|
||||
uint16_t frac_x0;
|
||||
uint16_t frac_dx;
|
||||
int result;
|
||||
|
||||
av_assert2(power <= 0x7fff);
|
||||
|
||||
frac_x0 = power >> 10;
|
||||
frac_dx = (power & 0x03ff) << 5;
|
||||
|
||||
result = tab_exp2[frac_x0] << 15;
|
||||
result += frac_dx * (tab_exp2[frac_x0+1] - tab_exp2[frac_x0]);
|
||||
|
||||
return result >> 10;
|
||||
}
|
||||
|
||||
#else // G729_BITEXACT
|
||||
|
||||
/**
|
||||
* Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
|
||||
*/
|
||||
static const int16_t tab_cos[65] =
|
||||
{
|
||||
32767, 32738, 32617, 32421, 32145, 31793, 31364, 30860,
|
||||
30280, 29629, 28905, 28113, 27252, 26326, 25336, 24285,
|
||||
23176, 22011, 20793, 19525, 18210, 16851, 15451, 14014,
|
||||
12543, 11043, 9515, 7965, 6395, 4810, 3214, 1609,
|
||||
1, -1607, -3211, -4808, -6393, -7962, -9513, -11040,
|
||||
-12541, -14012, -15449, -16848, -18207, -19523, -20791, -22009,
|
||||
-23174, -24283, -25334, -26324, -27250, -28111, -28904, -29627,
|
||||
-30279, -30858, -31363, -31792, -32144, -32419, -32616, -32736, -32768,
|
||||
};
|
||||
|
||||
static const uint16_t exp2a[]=
|
||||
{
|
||||
0, 1435, 2901, 4400, 5931, 7496, 9096, 10730,
|
||||
@@ -136,16 +45,6 @@ static const uint16_t exp2b[]=
|
||||
17176, 17898, 18620, 19343, 20066, 20790, 21514, 22238,
|
||||
};
|
||||
|
||||
int16_t ff_cos(uint16_t arg)
|
||||
{
|
||||
uint8_t offset= arg;
|
||||
uint8_t ind = arg >> 8;
|
||||
|
||||
av_assert2(arg <= 0x3fff);
|
||||
|
||||
return tab_cos[ind] + (offset * (tab_cos[ind+1] - tab_cos[ind]) >> 8);
|
||||
}
|
||||
|
||||
int ff_exp2(uint16_t power)
|
||||
{
|
||||
unsigned int result= exp2a[power>>10] + 0x10000;
|
||||
@@ -156,8 +55,6 @@ int ff_exp2(uint16_t power)
|
||||
return result + ((result*(power&31)*89)>>22);
|
||||
}
|
||||
|
||||
#endif // else G729_BITEXACT
|
||||
|
||||
/**
|
||||
* Table used to compute log2(x)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user