diff options
Diffstat (limited to 'libSBRdec')
-rw-r--r-- | libSBRdec/src/hbe.cpp | 6 | ||||
-rw-r--r-- | libSBRdec/src/psdec.cpp | 26 |
2 files changed, 20 insertions, 12 deletions
diff --git a/libSBRdec/src/hbe.cpp b/libSBRdec/src/hbe.cpp index 1141e9c..3310dcd 100644 --- a/libSBRdec/src/hbe.cpp +++ b/libSBRdec/src/hbe.cpp @@ -641,7 +641,7 @@ static const FIXP_DBL invCubeRootCorrection[3] = {0x40000000, 0x50A28BE6, */ static #ifdef __arm__ - FIXP_DBL __attribute__((always_inline)) + FIXP_DBL FDK_FORCEINLINE invCubeRootNorm2(FIXP_DBL op_m, INT* op_e) #else FIXP_DBL @@ -763,7 +763,7 @@ static const FIXP_DBL invFourthRootCorrection[4] = {0x40000000, 0x4C1BF829, static #ifdef __arm__ - FIXP_DBL __attribute__((always_inline)) + FIXP_DBL FDK_FORCEINLINE invFourthRootNorm2(FIXP_DBL op_m, INT* op_e) #else FIXP_DBL @@ -879,7 +879,7 @@ static const FIXP_DBL inv3EigthRootCorrection[8] = { static #ifdef __arm__ - FIXP_DBL __attribute__((always_inline)) + FIXP_DBL FDK_FORCEINLINE inv3EigthRootNorm2(FIXP_DBL op_m, INT* op_e) #else FIXP_DBL diff --git a/libSBRdec/src/psdec.cpp b/libSBRdec/src/psdec.cpp index 13a21bf..b31b310 100644 --- a/libSBRdec/src/psdec.cpp +++ b/libSBRdec/src/psdec.cpp @@ -325,11 +325,11 @@ void initSlotBasedRotation( int env, int usb) { INT group = 0; INT bin = 0; - INT noIidSteps; + INT noIidSteps, noFactors; FIXP_SGL invL; FIXP_DBL ScaleL, ScaleR; - FIXP_DBL Alpha, Beta; + FIXP_DBL Alpha, Beta, AlphasValue; FIXP_DBL h11r, h12r, h21r, h22r; const FIXP_DBL *PScaleFactors; @@ -337,9 +337,11 @@ void initSlotBasedRotation( if (h_ps_d->bsData[h_ps_d->processSlot].mpeg.bFineIidQ) { PScaleFactors = ScaleFactorsFine; /* values are shiftet right by one */ noIidSteps = NO_IID_STEPS_FINE; + noFactors = NO_IID_LEVELS_FINE; } else { PScaleFactors = ScaleFactors; /* values are shiftet right by one */ noIidSteps = NO_IID_STEPS; + noFactors = NO_IID_LEVELS; } /* dequantize and decode */ @@ -358,17 +360,23 @@ void initSlotBasedRotation( /* ScaleR and ScaleL are scaled by 1 shift right */ - ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo.mpeg.pCoef - ->aaIidIndexMapped[env][bin]]; - ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo.mpeg.pCoef - ->aaIidIndexMapped[env][bin]]; - + ScaleL = ScaleR = 0; + if (noIidSteps + h_ps_d->specificTo.mpeg.pCoef->aaIidIndexMapped[env][bin] >= 0 && noIidSteps + h_ps_d->specificTo.mpeg.pCoef->aaIidIndexMapped[env][bin] < noFactors) + ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo.mpeg.pCoef + ->aaIidIndexMapped[env][bin]]; + if (noIidSteps - h_ps_d->specificTo.mpeg.pCoef->aaIidIndexMapped[env][bin] >= 0 && noIidSteps - h_ps_d->specificTo.mpeg.pCoef->aaIidIndexMapped[env][bin] < noFactors) + ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo.mpeg.pCoef + ->aaIidIndexMapped[env][bin]]; + + AlphasValue = 0; + if (h_ps_d->specificTo.mpeg.pCoef->aaIccIndexMapped[env][bin] >= 0) + AlphasValue = Alphas[h_ps_d->specificTo.mpeg.pCoef->aaIccIndexMapped[env][bin]]; Beta = fMult( - fMult(Alphas[h_ps_d->specificTo.mpeg.pCoef->aaIccIndexMapped[env][bin]], + fMult(AlphasValue, (ScaleR - ScaleL)), FIXP_SQRT05); Alpha = - Alphas[h_ps_d->specificTo.mpeg.pCoef->aaIccIndexMapped[env][bin]] >> 1; + AlphasValue >> 1; /* Alpha and Beta are now both scaled by 2 shifts right */ |