diff options
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/libatrac/atrac3.c | 4 | ||||
-rw-r--r-- | apps/codecs/libatrac/atrac3data_fixed.h | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c index fa0400a408..ecb5a1480d 100644 --- a/apps/codecs/libatrac/atrac3.c +++ b/apps/codecs/libatrac/atrac3.c | |||
@@ -726,7 +726,7 @@ static void gainCompensateAndOverlap (int32_t *pIn, int32_t *pPrev, int32_t *pOu | |||
726 | if (pGain2->num_gain_data == 0) | 726 | if (pGain2->num_gain_data == 0) |
727 | gain1 = ONE_16; | 727 | gain1 = ONE_16; |
728 | else | 728 | else |
729 | gain1 = gain_tab1[pGain2->levcode[0]]; | 729 | gain1 = (ONE_16<<4)>>(pGain2->levcode[0]); |
730 | 730 | ||
731 | if (pGain1->num_gain_data == 0) { | 731 | if (pGain1->num_gain_data == 0) { |
732 | /* Remark: This path is called >90%. */ | 732 | /* Remark: This path is called >90%. */ |
@@ -743,7 +743,7 @@ static void gainCompensateAndOverlap (int32_t *pIn, int32_t *pPrev, int32_t *pOu | |||
743 | for (cnt = 0; cnt < numdata; cnt++) { | 743 | for (cnt = 0; cnt < numdata; cnt++) { |
744 | startLoc = pGain1->loccode[cnt] * 8; | 744 | startLoc = pGain1->loccode[cnt] * 8; |
745 | 745 | ||
746 | gain2 = gain_tab1[pGain1->levcode[cnt]]; | 746 | gain2 = (ONE_16<<4)>>(pGain1->levcode[cnt]); |
747 | gain_inc = gain_tab2[(pGain1->levcode[cnt+1] - pGain1->levcode[cnt])+15]; | 747 | gain_inc = gain_tab2[(pGain1->levcode[cnt+1] - pGain1->levcode[cnt])+15]; |
748 | 748 | ||
749 | /* Apply variable gain (gain1 -> gain2) to samples */ | 749 | /* Apply variable gain (gain1 -> gain2) to samples */ |
diff --git a/apps/codecs/libatrac/atrac3data_fixed.h b/apps/codecs/libatrac/atrac3data_fixed.h index 0ea7b86d62..b733ee71c4 100644 --- a/apps/codecs/libatrac/atrac3data_fixed.h +++ b/apps/codecs/libatrac/atrac3data_fixed.h | |||
@@ -78,12 +78,6 @@ static const int32_t window_lookup[128] ICONST_ATTR = { | |||
78 | }; | 78 | }; |
79 | 79 | ||
80 | /* Gain tables scaled by 2^16 */ | 80 | /* Gain tables scaled by 2^16 */ |
81 | static const int32_t gain_tab1[16] ICONST_ATTR = { | ||
82 | 0x00100000, 0x00080000, 0x00040000, 0x00020000, 0x00010000, 0x00008000, | ||
83 | 0x00004000, 0x00002000, 0x00001000, 0x00000800, 0x00000400, 0x00000200, | ||
84 | 0x00000100, 0x00000080, 0x00000040, 0x00000020, | ||
85 | }; | ||
86 | |||
87 | static const int32_t gain_tab2[31] ICONST_ATTR = { | 81 | static const int32_t gain_tab2[31] ICONST_ATTR = { |
88 | 0x0003ab03, 0x00035d14, 0x0003159d, 0x0002d414, 0x000297fb, 0x000260e0, | 82 | 0x0003ab03, 0x00035d14, 0x0003159d, 0x0002d414, 0x000297fb, 0x000260e0, |
89 | 0x00022e57, 0x00020000, 0x0001d582, 0x0001ae8a, 0x00018ace, 0x00016a0a, | 83 | 0x00022e57, 0x00020000, 0x0001d582, 0x0001ae8a, 0x00018ace, 0x00016a0a, |
@@ -95,7 +89,7 @@ static const int32_t gain_tab2[31] ICONST_ATTR = { | |||
95 | }; | 89 | }; |
96 | 90 | ||
97 | /* Joint-Stereo related tables, scaled by 2^16 */ | 91 | /* Joint-Stereo related tables, scaled by 2^16 */ |
98 | static const int32_t matrixCoeffs_fix[8]= { | 92 | static const int32_t matrixCoeffs_fix[8] ICONST_ATTR = { |
99 | 0x00000000, 0x00020000, 0x00020000, 0x00020000, | 93 | 0x00000000, 0x00020000, 0x00020000, 0x00020000, |
100 | 0x00000000, 0x00000000, 0x00010000, 0x00010000, | 94 | 0x00000000, 0x00000000, 0x00010000, 0x00010000, |
101 | }; | 95 | }; |