diff options
Diffstat (limited to 'apps/codecs/libatrac/atrac3.c')
-rw-r--r-- | apps/codecs/libatrac/atrac3.c | 80 |
1 files changed, 70 insertions, 10 deletions
diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c index ac63925ce7..467f42f161 100644 --- a/apps/codecs/libatrac/atrac3.c +++ b/apps/codecs/libatrac/atrac3.c | |||
@@ -98,6 +98,20 @@ static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM; | |||
98 | * @param in input buffer | 98 | * @param in input buffer |
99 | * @param win windowing coefficients | 99 | * @param win windowing coefficients |
100 | * @param nIn size of spectrum buffer | 100 | * @param nIn size of spectrum buffer |
101 | * Reference implementation: | ||
102 | * | ||
103 | * for (j = nIn; j != 0; j--) { | ||
104 | * s1 = fixmul32(in[0], win[0]); | ||
105 | * s2 = fixmul32(in[1], win[1]); | ||
106 | * for (i = 2; i < 48; i += 2) { | ||
107 | * s1 += fixmul31(in[i ], win[i ]); | ||
108 | * s2 += fixmul31(in[i+1], win[i+1]); | ||
109 | * } | ||
110 | * out[0] = s2; | ||
111 | * out[1] = s1; | ||
112 | * in += 2; | ||
113 | * out += 2; | ||
114 | * } | ||
101 | */ | 115 | */ |
102 | 116 | ||
103 | #if defined(CPU_ARM) | 117 | #if defined(CPU_ARM) |
@@ -116,16 +130,62 @@ static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM; | |||
116 | int32_t i, j, s1, s2; | 130 | int32_t i, j, s1, s2; |
117 | 131 | ||
118 | for (j = nIn; j != 0; j--) { | 132 | for (j = nIn; j != 0; j--) { |
119 | /* i=0 */ | 133 | i = 0; |
120 | s1 = fixmul31(win[0], in[0]); | 134 | /* 0.. 7 */ |
121 | s2 = fixmul31(win[1], in[1]); | 135 | s1 = fixmul31(win[i], in[i]); i++; |
122 | 136 | s2 = fixmul31(win[i], in[i]); i++; | |
123 | /* i=2..46 */ | 137 | s1 += fixmul31(win[i], in[i]); i++; |
124 | for (i = 2; i < 48; i += 2) { | 138 | s2 += fixmul31(win[i], in[i]); i++; |
125 | s1 += fixmul31(win[i ], in[i ]); | 139 | s1 += fixmul31(win[i], in[i]); i++; |
126 | s2 += fixmul31(win[i+1], in[i+1]); | 140 | s2 += fixmul31(win[i], in[i]); i++; |
127 | } | 141 | s1 += fixmul31(win[i], in[i]); i++; |
128 | 142 | s2 += fixmul31(win[i], in[i]); i++; | |
143 | /* 8..15 */ | ||
144 | s1 += fixmul31(win[i], in[i]); i++; | ||
145 | s2 += fixmul31(win[i], in[i]); i++; | ||
146 | s1 += fixmul31(win[i], in[i]); i++; | ||
147 | s2 += fixmul31(win[i], in[i]); i++; | ||
148 | s1 += fixmul31(win[i], in[i]); i++; | ||
149 | s2 += fixmul31(win[i], in[i]); i++; | ||
150 | s1 += fixmul31(win[i], in[i]); i++; | ||
151 | s2 += fixmul31(win[i], in[i]); i++; | ||
152 | /* 16..23 */ | ||
153 | s1 += fixmul31(win[i], in[i]); i++; | ||
154 | s2 += fixmul31(win[i], in[i]); i++; | ||
155 | s1 += fixmul31(win[i], in[i]); i++; | ||
156 | s2 += fixmul31(win[i], in[i]); i++; | ||
157 | s1 += fixmul31(win[i], in[i]); i++; | ||
158 | s2 += fixmul31(win[i], in[i]); i++; | ||
159 | s1 += fixmul31(win[i], in[i]); i++; | ||
160 | s2 += fixmul31(win[i], in[i]); i++; | ||
161 | /* 24..31 */ | ||
162 | s1 += fixmul31(win[i], in[i]); i++; | ||
163 | s2 += fixmul31(win[i], in[i]); i++; | ||
164 | s1 += fixmul31(win[i], in[i]); i++; | ||
165 | s2 += fixmul31(win[i], in[i]); i++; | ||
166 | s1 += fixmul31(win[i], in[i]); i++; | ||
167 | s2 += fixmul31(win[i], in[i]); i++; | ||
168 | s1 += fixmul31(win[i], in[i]); i++; | ||
169 | s2 += fixmul31(win[i], in[i]); i++; | ||
170 | /* 32..39 */ | ||
171 | s1 += fixmul31(win[i], in[i]); i++; | ||
172 | s2 += fixmul31(win[i], in[i]); i++; | ||
173 | s1 += fixmul31(win[i], in[i]); i++; | ||
174 | s2 += fixmul31(win[i], in[i]); i++; | ||
175 | s1 += fixmul31(win[i], in[i]); i++; | ||
176 | s2 += fixmul31(win[i], in[i]); i++; | ||
177 | s1 += fixmul31(win[i], in[i]); i++; | ||
178 | s2 += fixmul31(win[i], in[i]); i++; | ||
179 | /* 40..47 */ | ||
180 | s1 += fixmul31(win[i], in[i]); i++; | ||
181 | s2 += fixmul31(win[i], in[i]); i++; | ||
182 | s1 += fixmul31(win[i], in[i]); i++; | ||
183 | s2 += fixmul31(win[i], in[i]); i++; | ||
184 | s1 += fixmul31(win[i], in[i]); i++; | ||
185 | s2 += fixmul31(win[i], in[i]); i++; | ||
186 | s1 += fixmul31(win[i], in[i]); i++; | ||
187 | s2 += fixmul31(win[i], in[i]); | ||
188 | |||
129 | out[0] = s2; | 189 | out[0] = s2; |
130 | out[1] = s1; | 190 | out[1] = s1; |
131 | 191 | ||