From 132bc634edfb54aa857230eb6976309c8d4a2360 Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Mon, 29 Oct 2007 23:16:41 +0000 Subject: 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 --- apps/codecs/libwma/wmafixed.c | 75 +++++++++++-------------------------------- 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 @@ +/**************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + #include "wmadec.h" #include "wmafixed.h" #include @@ -221,60 +239,3 @@ long fsincos(unsigned long phase, fixed32 *cos) } -/* - Old trig functions. Still used in 1 place each. - -*/ - - -fixed32 fixsin32(fixed32 x) -{ - - fixed64 x2, temp; - int sign = 1; - - if(x < 0) - { - sign = -1; - x = -x; - } - while (x > 0x19220) - { - x -= M_PI_F; - sign = -sign; - } - if (x > 0x19220) - { - x = M_PI_F - x; - } - x2 = (fixed64)x * x; - x2 >>= PRECISION; - if(sign != 1) - { - x = -x; - } - /** - temp = ftofix32(-.0000000239f) * x2; - temp >>= PRECISION; - **/ - temp = 0; // PJJ - //temp = (temp + 0x0) * x2; //MGG: this can't possibly do anything? - //temp >>= PRECISION; - temp = (temp - 0xd) * x2; - temp >>= PRECISION; - temp = (temp + 0x222) * x2; - temp >>= PRECISION; - temp = (temp - 0x2aab) * x2; - temp >>= PRECISION; - temp += 0x10000; - temp = temp * x; - temp >>= PRECISION; - - return (fixed32)(temp); -} - -fixed32 fixcos32(fixed32 x) -{ - return fixsin32(x - (M_PI_F>>1))*-1; -} - 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 @@ +/**************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + /* fixed precision code. We use a combination of Sign 15.16 and Sign.31 precision here. @@ -31,8 +49,6 @@ fixed64 fixmul64byfixed(fixed64 x, fixed32 y); fixed32 fixdiv32(fixed32 x, fixed32 y); fixed64 fixdiv64(fixed64 x, fixed64 y); fixed32 fixsqrt32(fixed32 x); -fixed32 fixsin32(fixed32 x); -fixed32 fixcos32(fixed32 x); long fsincos(unsigned long phase, fixed32 *cos); #ifdef CPU_ARM -- cgit v1.2.3