1
0
Fork 0
forked from len0rd/rockbox

Reinstate ICONST_ATTR for matrixCoeffs_fix ; remove (silly) gain_tab1 and replace with a simple bitshift in the code

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24788 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Hooper 2010-02-20 12:55:35 +00:00
parent e90deded40
commit e4217d4845
2 changed files with 3 additions and 9 deletions

View file

@ -726,7 +726,7 @@ static void gainCompensateAndOverlap (int32_t *pIn, int32_t *pPrev, int32_t *pOu
if (pGain2->num_gain_data == 0)
gain1 = ONE_16;
else
gain1 = gain_tab1[pGain2->levcode[0]];
gain1 = (ONE_16<<4)>>(pGain2->levcode[0]);
if (pGain1->num_gain_data == 0) {
/* Remark: This path is called >90%. */
@ -743,7 +743,7 @@ static void gainCompensateAndOverlap (int32_t *pIn, int32_t *pPrev, int32_t *pOu
for (cnt = 0; cnt < numdata; cnt++) {
startLoc = pGain1->loccode[cnt] * 8;
gain2 = gain_tab1[pGain1->levcode[cnt]];
gain2 = (ONE_16<<4)>>(pGain1->levcode[cnt]);
gain_inc = gain_tab2[(pGain1->levcode[cnt+1] - pGain1->levcode[cnt])+15];
/* Apply variable gain (gain1 -> gain2) to samples */

View file

@ -78,12 +78,6 @@ static const int32_t window_lookup[128] ICONST_ATTR = {
};
/* Gain tables scaled by 2^16 */
static const int32_t gain_tab1[16] ICONST_ATTR = {
0x00100000, 0x00080000, 0x00040000, 0x00020000, 0x00010000, 0x00008000,
0x00004000, 0x00002000, 0x00001000, 0x00000800, 0x00000400, 0x00000200,
0x00000100, 0x00000080, 0x00000040, 0x00000020,
};
static const int32_t gain_tab2[31] ICONST_ATTR = {
0x0003ab03, 0x00035d14, 0x0003159d, 0x0002d414, 0x000297fb, 0x000260e0,
0x00022e57, 0x00020000, 0x0001d582, 0x0001ae8a, 0x00018ace, 0x00016a0a,
@ -95,7 +89,7 @@ static const int32_t gain_tab2[31] ICONST_ATTR = {
};
/* Joint-Stereo related tables, scaled by 2^16 */
static const int32_t matrixCoeffs_fix[8]= {
static const int32_t matrixCoeffs_fix[8] ICONST_ATTR = {
0x00000000, 0x00020000, 0x00020000, 0x00020000,
0x00000000, 0x00000000, 0x00010000, 0x00010000,
};