diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2007-10-29 23:16:41 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2007-10-29 23:16:41 +0000 |
commit | 132bc634edfb54aa857230eb6976309c8d4a2360 (patch) | |
tree | 424469a9823452addcd39b0f55d5bff57dbf17b5 /apps/codecs/libwma | |
parent | 3da91a9cd13004515aec710b1e55ab1e98c3d1da (diff) | |
download | rockbox-132bc634edfb54aa857230eb6976309c8d4a2360.tar.gz rockbox-132bc634edfb54aa857230eb6976309c8d4a2360.zip |
We removed the old Q15.16 precision trig functions from decoding ages ago, so no need to leave them in. Also, this code needs a GPL header.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15366 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma')
-rw-r--r-- | apps/codecs/libwma/wmafixed.c | 75 | ||||
-rw-r--r-- | apps/codecs/libwma/wmafixed.h | 20 |
2 files changed, 36 insertions, 59 deletions
diff --git a/apps/codecs/libwma/wmafixed.c b/apps/codecs/libwma/wmafixed.c index 9c3b211f59..333f1d4033 100644 --- a/apps/codecs/libwma/wmafixed.c +++ b/apps/codecs/libwma/wmafixed.c | |||
@@ -1,3 +1,21 @@ | |||
1 | /**************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ****************************************************************************/ | ||
18 | |||
1 | #include "wmadec.h" | 19 | #include "wmadec.h" |
2 | #include "wmafixed.h" | 20 | #include "wmafixed.h" |
3 | #include <codecs.h> | 21 | #include <codecs.h> |
@@ -221,60 +239,3 @@ long fsincos(unsigned long phase, fixed32 *cos) | |||
221 | } | 239 | } |
222 | 240 | ||
223 | 241 | ||
224 | /* | ||
225 | Old trig functions. Still used in 1 place each. | ||
226 | |||
227 | */ | ||
228 | |||
229 | |||
230 | fixed32 fixsin32(fixed32 x) | ||
231 | { | ||
232 | |||
233 | fixed64 x2, temp; | ||
234 | int sign = 1; | ||
235 | |||
236 | if(x < 0) | ||
237 | { | ||
238 | sign = -1; | ||
239 | x = -x; | ||
240 | } | ||
241 | while (x > 0x19220) | ||
242 | { | ||
243 | x -= M_PI_F; | ||
244 | sign = -sign; | ||
245 | } | ||
246 | if (x > 0x19220) | ||
247 | { | ||
248 | x = M_PI_F - x; | ||
249 | } | ||
250 | x2 = (fixed64)x * x; | ||
251 | x2 >>= PRECISION; | ||
252 | if(sign != 1) | ||
253 | { | ||
254 | x = -x; | ||
255 | } | ||
256 | /** | ||
257 | temp = ftofix32(-.0000000239f) * x2; | ||
258 | temp >>= PRECISION; | ||
259 | **/ | ||
260 | temp = 0; // PJJ | ||
261 | //temp = (temp + 0x0) * x2; //MGG: this can't possibly do anything? | ||
262 | //temp >>= PRECISION; | ||
263 | temp = (temp - 0xd) * x2; | ||
264 | temp >>= PRECISION; | ||
265 | temp = (temp + 0x222) * x2; | ||
266 | temp >>= PRECISION; | ||
267 | temp = (temp - 0x2aab) * x2; | ||
268 | temp >>= PRECISION; | ||
269 | temp += 0x10000; | ||
270 | temp = temp * x; | ||
271 | temp >>= PRECISION; | ||
272 | |||
273 | return (fixed32)(temp); | ||
274 | } | ||
275 | |||
276 | fixed32 fixcos32(fixed32 x) | ||
277 | { | ||
278 | return fixsin32(x - (M_PI_F>>1))*-1; | ||
279 | } | ||
280 | |||
diff --git a/apps/codecs/libwma/wmafixed.h b/apps/codecs/libwma/wmafixed.h index b92c12a50a..713c4d0b19 100644 --- a/apps/codecs/libwma/wmafixed.h +++ b/apps/codecs/libwma/wmafixed.h | |||
@@ -1,3 +1,21 @@ | |||
1 | /**************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ****************************************************************************/ | ||
18 | |||
1 | /* fixed precision code. We use a combination of Sign 15.16 and Sign.31 | 19 | /* fixed precision code. We use a combination of Sign 15.16 and Sign.31 |
2 | precision here. | 20 | precision here. |
3 | 21 | ||
@@ -31,8 +49,6 @@ fixed64 fixmul64byfixed(fixed64 x, fixed32 y); | |||
31 | fixed32 fixdiv32(fixed32 x, fixed32 y); | 49 | fixed32 fixdiv32(fixed32 x, fixed32 y); |
32 | fixed64 fixdiv64(fixed64 x, fixed64 y); | 50 | fixed64 fixdiv64(fixed64 x, fixed64 y); |
33 | fixed32 fixsqrt32(fixed32 x); | 51 | fixed32 fixsqrt32(fixed32 x); |
34 | fixed32 fixsin32(fixed32 x); | ||
35 | fixed32 fixcos32(fixed32 x); | ||
36 | long fsincos(unsigned long phase, fixed32 *cos); | 52 | long fsincos(unsigned long phase, fixed32 *cos); |
37 | 53 | ||
38 | #ifdef CPU_ARM | 54 | #ifdef CPU_ARM |