summaryrefslogtreecommitdiffstats
path: root/libSBRdec/src/arm
diff options
context:
space:
mode:
authorDave Burke <daveburke@google.com>2012-04-17 09:51:45 -0700
committerDave Burke <daveburke@google.com>2012-04-17 23:04:43 -0700
commit9bf37cc9712506b2483650c82d3c41152337ef7e (patch)
tree77db44e2bae06e3d144b255628be2b7a55c581d3 /libSBRdec/src/arm
parenta37315fe10ee143d6d0b28c19d41a476a23e63ea (diff)
downloadODR-AudioEnc-9bf37cc9712506b2483650c82d3c41152337ef7e.tar.gz
ODR-AudioEnc-9bf37cc9712506b2483650c82d3c41152337ef7e.tar.bz2
ODR-AudioEnc-9bf37cc9712506b2483650c82d3c41152337ef7e.zip
Fraunhofer AAC codec.
License boilerplate update to follow. Change-Id: I2810460c11a58b6d148d84673cc031f3685e79b5
Diffstat (limited to 'libSBRdec/src/arm')
-rw-r--r--libSBRdec/src/arm/env_calc_arm.cpp86
-rw-r--r--libSBRdec/src/arm/lpp_tran_arm.cpp89
2 files changed, 175 insertions, 0 deletions
diff --git a/libSBRdec/src/arm/env_calc_arm.cpp b/libSBRdec/src/arm/env_calc_arm.cpp
new file mode 100644
index 0000000..8fa3718
--- /dev/null
+++ b/libSBRdec/src/arm/env_calc_arm.cpp
@@ -0,0 +1,86 @@
+/******************************** Fraunhofer IIS ***************************
+
+ (C) Copyright Fraunhofer IIS (2010)
+ All Rights Reserved
+
+ Please be advised that this software and/or program delivery is
+ Confidential Information of Fraunhofer and subject to and covered by the
+
+ Fraunhofer IIS Software Evaluation Agreement
+ between Google Inc. and Fraunhofer
+ effective and in full force since March 1, 2012.
+
+ You may use this software and/or program only under the terms and
+ conditions described in the above mentioned Fraunhofer IIS Software
+ Evaluation Agreement. Any other and/or further use requires a separate agreement.
+
+
+ $Id$
+ Author(s): Arthur Tritthart
+ Description: (ARM optimised) SBR domain coding
+
+ This software and/or program is protected by copyright law and international
+ treaties. Any reproduction or distribution of this software and/or program,
+ or any portion of it, may result in severe civil and criminal penalties, and
+ will be prosecuted to the maximum extent possible under law.
+
+******************************************************************************/
+#ifndef INCLUSION_GUARD_CALC_ENV_ARM
+#define INCLUSION_GUARD_CALC_ENV_ARM
+
+
+/*!
+ \brief Compute maximal value of a complex array (re/im) of a given width
+ Negative values are temporarily logically or'ed with 0xFFFFFFFF
+ instead of negating the value, if the sign bit is set.
+ \param maxVal Preset maximal value
+ \param reTmp real input signal
+ \param imTmp imaginary input signal
+ \return new maximal value
+*/
+
+#ifdef FUNCTION_FDK_get_maxval
+__asm FIXP_DBL FDK_get_maxval (FIXP_DBL maxVal, FIXP_DBL *reTmp, FIXP_DBL *imTmp, int width )
+{
+
+ /* Register map:
+ r0 maxVal
+ r1 reTmp
+ r2 imTmp
+ r3 width
+ r4 real
+ r5 imag
+ */
+ PUSH {r4-r5}
+
+ MOVS r3, r3, ASR #1
+ ADC r3, r3, #0
+ BCS FDK_get_maxval_loop_2nd_part
+ BEQ FDK_get_maxval_loop_end
+
+FDK_get_maxval_loop
+ LDR r4, [r1], #4
+ LDR r5, [r2], #4
+ EOR r4, r4, r4, ASR #31
+ EOR r5, r5, r5, ASR #31
+ ORR r0, r0, r4
+ ORR r0, r0, r5
+
+FDK_get_maxval_loop_2nd_part
+ LDR r4, [r1], #4
+ LDR r5, [r2], #4
+ EOR r4, r4, r4, ASR #31
+ EOR r5, r5, r5, ASR #31
+ ORR r0, r0, r4
+ ORR r0, r0, r5
+
+ SUBS r3, r3, #1
+ BNE FDK_get_maxval_loop
+
+FDK_get_maxval_loop_end
+ POP {r4-r5}
+ BX lr
+}
+#endif /* FUNCTION_FDK_get_maxval */
+
+#endif /* INCLUSION_GUARD_CALC_ENV_ARM */
diff --git a/libSBRdec/src/arm/lpp_tran_arm.cpp b/libSBRdec/src/arm/lpp_tran_arm.cpp
new file mode 100644
index 0000000..789f4db
--- /dev/null
+++ b/libSBRdec/src/arm/lpp_tran_arm.cpp
@@ -0,0 +1,89 @@
+/******************************** Fraunhofer IIS ***************************
+
+ (C) Copyright Fraunhofer IIS (2011)
+ All Rights Reserved
+
+ Please be advised that this software and/or program delivery is
+ Confidential Information of Fraunhofer and subject to and covered by the
+
+ Fraunhofer IIS Software Evaluation Agreement
+ between Google Inc. and Fraunhofer
+ effective and in full force since March 1, 2012.
+
+ You may use this software and/or program only under the terms and
+ conditions described in the above mentioned Fraunhofer IIS Software
+ Evaluation Agreement. Any other and/or further use requires a separate agreement.
+
+
+ $Id$
+ Author(s): Arthur Tritthart
+ Description: (ARM optimised) LPP transposer subroutines
+
+ This software and/or program is protected by copyright law and international
+ treaties. Any reproduction or distribution of this software and/or program,
+ or any portion of it, may result in severe civil and criminal penalties, and
+ will be prosecuted to the maximum extent possible under law.
+
+******************************************************************************/
+
+
+#if defined(__arm__)
+
+
+#define FUNCTION_LPPTRANSPOSER_func1
+
+#ifdef FUNCTION_LPPTRANSPOSER_func1
+
+/* Note: This code requires only 43 cycles per iteration instead of 61 on ARM926EJ-S */
+__attribute__ ((noinline)) static void lppTransposer_func1(
+ FIXP_DBL *lowBandReal,
+ FIXP_DBL *lowBandImag,
+ FIXP_DBL **qmfBufferReal,
+ FIXP_DBL **qmfBufferImag,
+ int loops,
+ int hiBand,
+ int dynamicScale,
+ int descale,
+ FIXP_SGL a0r,
+ FIXP_SGL a0i,
+ FIXP_SGL a1r,
+ FIXP_SGL a1i)
+{
+
+ FIXP_DBL real1, real2, imag1, imag2, accu1, accu2;
+
+ real2 = lowBandReal[-2];
+ real1 = lowBandReal[-1];
+ imag2 = lowBandImag[-2];
+ imag1 = lowBandImag[-1];
+ for(int i=0; i < loops; i++)
+ {
+ accu1 = fMultDiv2( a0r,real1);
+ accu2 = fMultDiv2( a0i,imag1);
+ accu1 = fMultAddDiv2(accu1,a1r,real2);
+ accu2 = fMultAddDiv2(accu2,a1i,imag2);
+ real2 = fMultDiv2( a1i,real2);
+ accu1 = accu1 - accu2;
+ accu1 = accu1 >> dynamicScale;
+
+ accu2 = fMultAddDiv2(real2,a1r,imag2);
+ real2 = real1;
+ imag2 = imag1;
+ accu2 = fMultAddDiv2(accu2,a0i,real1);
+ real1 = lowBandReal[i];
+ accu2 = fMultAddDiv2(accu2,a0r,imag1);
+ imag1 = lowBandImag[i];
+ accu2 = accu2 >> dynamicScale;
+
+ accu1 <<= 1;
+ accu2 <<= 1;
+
+ qmfBufferReal[i][hiBand] = accu1 + (real1>>descale);
+ qmfBufferImag[i][hiBand] = accu2 + (imag1>>descale);
+ }
+}
+#endif /* #ifdef FUNCTION_LPPTRANSPOSER_func1 */
+#endif /* __arm__ */
+
+
+