/*---------------------------------------------------------------------------- ; LOCAL STORE/BUFFER/POINTER DEFINITIONS ; Variable declaration - defined here and used outside this module ----------------------------------------------------------------------------*/ const int32 pretab[22] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0}; const int32 pow_2_1_fourth[4] = { Q30_fmt(1.0), Q30_fmt(1.18920711500272), Q30_fmt(1.41421356237310), Q30_fmt(1.68179283050743) }; const int32 two_cubic_roots[7] = { Q29_fmt(0), Q29_fmt(1.25992104989487), Q29_fmt(1.58740105196820), Q29_fmt(2.00000000000000), Q29_fmt(2.51984209978975), Q29_fmt(3.17480210393640), Q29_fmt(3.99999999999999) }; /*---------------------------------------------------------------------------- ; EXTERNAL FUNCTION REFERENCES ; Declare functions defined elsewhere and referenced in this module ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/
void eight_ch_filtering(const Int32 *pQmfReal, const Int32 *pQmfImag, Int32 *mHybridReal, Int32 *mHybridImag, Int32 scratch_mem[]) { Int32 real; Int32 imag; Int32 tmp1; Int32 tmp2; real = fxp_mul32_Q29(Q29_fmt(-0.06989827306334f), pQmfReal[ 4]); real = fxp_mac32_Q31(real, Qfmt31(0.01055120626280f), pQmfReal[12]); imag = fxp_mul32_Q29(Q29_fmt(-0.06989827306334f), pQmfImag[ 4]); imag = fxp_mac32_Q31(imag, Qfmt31(0.01055120626280f), pQmfImag[12]); mHybridReal[2] = (imag - real); mHybridImag[2] = -(imag + real); real = fxp_mul32_Q29(Q29_fmt(-0.07266113929591f), pQmfReal[ 3]); real = fxp_mac32_Q31(real, Qfmt31(0.04540841899650f), pQmfReal[11]); imag = fxp_mul32_Q29(Q29_fmt(-0.07266113929591f), pQmfImag[ 3]); imag = fxp_mac32_Q31(imag, Qfmt31(0.04540841899650f), pQmfImag[11]); tmp1 = fxp_mul32_Q29(Q29_fmt(-0.38268343236509f), real); mHybridReal[3] = fxp_mac32_Q29(Q29_fmt(0.92387953251129f), imag, tmp1); tmp2 = fxp_mul32_Q29(Q29_fmt(-0.92387953251129f), real); mHybridImag[3] = fxp_mac32_Q29(Q29_fmt(-0.38268343236509f), imag, tmp2); mHybridImag[4] = fxp_mul32_Q31(Qfmt31(0.09093731860946f), (pQmfReal[ 2] - pQmfReal[10])); mHybridReal[4] = fxp_mul32_Q31(Qfmt31(0.09093731860946f), (pQmfImag[10] - pQmfImag[ 2])); real = fxp_mul32_Q29(Q29_fmt(-0.02270420949825f), pQmfReal[ 1]); real = fxp_mac32_Q31(real, Qfmt31(0.14532227859182f), pQmfReal[ 9]); imag = fxp_mul32_Q29(Q29_fmt(-0.02270420949825f), pQmfImag[ 1]); imag = fxp_mac32_Q31(imag, Qfmt31(0.14532227859182f), pQmfImag[ 9]); tmp1 = fxp_mul32_Q29(Q29_fmt(0.92387953251129f), imag); mHybridReal[5] = fxp_mac32_Q31(tmp1, Qfmt31(0.76536686473018f), real); tmp2 = fxp_mul32_Q29(Q29_fmt(-0.92387953251129f), real); mHybridImag[5] = fxp_mac32_Q31(tmp2, Qfmt31(0.76536686473018f), imag); real = fxp_mul32_Q29(Q29_fmt(-0.00527560313140f), pQmfReal[ 0]); real = fxp_mac32_Q31(real, Qfmt31(0.13979654612668f), pQmfReal[ 8]); imag = fxp_mul32_Q29(Q29_fmt(-0.00527560313140f), pQmfImag[ 0]); imag = fxp_mac32_Q31(imag, Qfmt31(0.13979654612668f), pQmfImag[ 8]); mHybridReal[6] = (imag + real); mHybridImag[6] = (imag - real); tmp1 = fxp_mul32_Q31(Qfmt31(0.21791935610828f), pQmfReal[ 7]); mHybridReal[7] = fxp_mac32_Q31(tmp1, Qfmt31(0.09026515280366f), pQmfImag[ 7]); tmp2 = fxp_mul32_Q29(Q29_fmt(-0.04513257640183f), pQmfReal[ 7]); mHybridImag[7] = fxp_mac32_Q31(tmp2, Qfmt31(0.21791935610828f), pQmfImag[ 7]); mHybridReal[0] = pQmfReal[HYBRID_FILTER_DELAY] >> 3; mHybridImag[0] = pQmfImag[HYBRID_FILTER_DELAY] >> 3; tmp1 = fxp_mul32_Q29(Q29_fmt(-0.04513257640183f), pQmfImag[ 5]); mHybridReal[1] = fxp_mac32_Q31(tmp1, Qfmt31(0.21791935610828f), pQmfReal[ 5]); tmp2 = fxp_mul32_Q31(Qfmt31(0.21791935610828f), pQmfImag[ 5]); mHybridImag[1] = fxp_mac32_Q31(tmp2, Qfmt31(0.09026515280366f), pQmfReal[ 5]); /* * 8*ifft */ ps_fft_rx8(mHybridReal, mHybridImag, scratch_mem); }