mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-02-14 18:30:39 +01:00
Snap for 6138855 from 063d5f30864c6293855da6f7b8dd482d7c408158 to rvc-release
Change-Id: I76b653e2aa437267603833e7fade774c4d210243
This commit is contained in:
commit
29c3f50d14
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
||||||
|
|
||||||
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
||||||
Forschung e.V. All rights reserved.
|
Forschung e.V. All rights reserved.
|
||||||
|
|
||||||
1. INTRODUCTION
|
1. INTRODUCTION
|
||||||
@ -545,15 +545,20 @@ inline INT fMultIceil(FIXP_DBL a, INT b) {
|
|||||||
m = fMultNorm(a, (FIXP_DBL)b, &m_e);
|
m = fMultNorm(a, (FIXP_DBL)b, &m_e);
|
||||||
|
|
||||||
if (m_e < (INT)0) {
|
if (m_e < (INT)0) {
|
||||||
if (m_e > (INT)-DFRACT_BITS) {
|
if (m_e > (INT) - (DFRACT_BITS - 1)) {
|
||||||
mi = (m >> (-m_e));
|
mi = (m >> (-m_e));
|
||||||
if ((LONG)m & ((1 << (-m_e)) - 1)) {
|
if ((LONG)m & ((1 << (-m_e)) - 1)) {
|
||||||
mi = mi + (FIXP_DBL)1;
|
mi = mi + (FIXP_DBL)1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mi = (FIXP_DBL)1;
|
if (m > (FIXP_DBL)0) {
|
||||||
if (m < (FIXP_DBL)0) {
|
mi = (FIXP_DBL)1;
|
||||||
mi = (FIXP_DBL)0;
|
} else {
|
||||||
|
if ((m_e == -(DFRACT_BITS - 1)) && (m == (FIXP_DBL)MINVAL_DBL)) {
|
||||||
|
mi = (FIXP_DBL)-1;
|
||||||
|
} else {
|
||||||
|
mi = (FIXP_DBL)0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
||||||
|
|
||||||
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
||||||
Forschung e.V. All rights reserved.
|
Forschung e.V. All rights reserved.
|
||||||
|
|
||||||
1. INTRODUCTION
|
1. INTRODUCTION
|
||||||
@ -142,11 +142,12 @@ amm-info@iis.fraunhofer.de
|
|||||||
} /* How to arrange the packed values. */
|
} /* How to arrange the packed values. */
|
||||||
|
|
||||||
struct FDK_HYBRID_SETUP {
|
struct FDK_HYBRID_SETUP {
|
||||||
UCHAR nrQmfBands; /*!< Number of QMF bands to be converted to hybrid. */
|
UCHAR nrQmfBands; /*!< Number of QMF bands to be converted to hybrid. */
|
||||||
UCHAR nHybBands[3]; /*!< Number of Hybrid bands generated by nrQmfBands. */
|
UCHAR nHybBands[3]; /*!< Number of Hybrid bands generated by nrQmfBands. */
|
||||||
SCHAR kHybrid[3]; /*!< Filter configuration of each QMF band. */
|
UCHAR synHybScale[3]; /*!< Headroom needed in hybrid synthesis filterbank. */
|
||||||
UCHAR protoLen; /*!< Prototype filter length. */
|
SCHAR kHybrid[3]; /*!< Filter configuration of each QMF band. */
|
||||||
UCHAR filterDelay; /*!< Delay caused by hybrid filter. */
|
UCHAR protoLen; /*!< Prototype filter length. */
|
||||||
|
UCHAR filterDelay; /*!< Delay caused by hybrid filter. */
|
||||||
const INT
|
const INT
|
||||||
*pReadIdxTable; /*!< Helper table to access input data ringbuffer. */
|
*pReadIdxTable; /*!< Helper table to access input data ringbuffer. */
|
||||||
};
|
};
|
||||||
@ -156,12 +157,12 @@ static const INT ringbuffIdxTab[2 * 13] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
|
|||||||
9, 10, 11, 12, 0, 1, 2, 3, 4,
|
9, 10, 11, 12, 0, 1, 2, 3, 4,
|
||||||
5, 6, 7, 8, 9, 10, 11, 12};
|
5, 6, 7, 8, 9, 10, 11, 12};
|
||||||
|
|
||||||
static const FDK_HYBRID_SETUP setup_3_16 = {3, {8, 4, 4}, {8, 4, 4},
|
static const FDK_HYBRID_SETUP setup_3_16 = {
|
||||||
13, (13 - 1) / 2, ringbuffIdxTab};
|
3, {8, 4, 4}, {4, 3, 3}, {8, 4, 4}, 13, (13 - 1) / 2, ringbuffIdxTab};
|
||||||
static const FDK_HYBRID_SETUP setup_3_12 = {3, {8, 2, 2}, {8, 2, 2},
|
static const FDK_HYBRID_SETUP setup_3_12 = {
|
||||||
13, (13 - 1) / 2, ringbuffIdxTab};
|
3, {8, 2, 2}, {4, 2, 2}, {8, 2, 2}, 13, (13 - 1) / 2, ringbuffIdxTab};
|
||||||
static const FDK_HYBRID_SETUP setup_3_10 = {3, {6, 2, 2}, {-8, -2, 2},
|
static const FDK_HYBRID_SETUP setup_3_10 = {
|
||||||
13, (13 - 1) / 2, ringbuffIdxTab};
|
3, {6, 2, 2}, {3, 2, 2}, {-8, -2, 2}, 13, (13 - 1) / 2, ringbuffIdxTab};
|
||||||
|
|
||||||
static const FIXP_HTP HybFilterCoef8[] = {
|
static const FIXP_HTP HybFilterCoef8[] = {
|
||||||
HTCP(0x10000000, 0x00000000), HTCP(0x0df26407, 0xfa391882),
|
HTCP(0x10000000, 0x00000000), HTCP(0x0df26407, 0xfa391882),
|
||||||
@ -477,17 +478,18 @@ void FDKhybridSynthesisApply(HANDLE_FDK_SYN_HYB_FILTER hSynthesisHybFilter,
|
|||||||
*/
|
*/
|
||||||
for (k = 0; k < nrQmfBandsLF; k++) {
|
for (k = 0; k < nrQmfBandsLF; k++) {
|
||||||
const int nHybBands = hSynthesisHybFilter->pSetup->nHybBands[k];
|
const int nHybBands = hSynthesisHybFilter->pSetup->nHybBands[k];
|
||||||
|
const int scale = hSynthesisHybFilter->pSetup->synHybScale[k];
|
||||||
|
|
||||||
FIXP_DBL accu1 = FL2FXCONST_DBL(0.f);
|
FIXP_DBL accu1 = FL2FXCONST_DBL(0.f);
|
||||||
FIXP_DBL accu2 = FL2FXCONST_DBL(0.f);
|
FIXP_DBL accu2 = FL2FXCONST_DBL(0.f);
|
||||||
|
|
||||||
/* Perform hybrid filtering. */
|
/* Perform hybrid filtering. */
|
||||||
for (n = 0; n < nHybBands; n++) {
|
for (n = 0; n < nHybBands; n++) {
|
||||||
accu1 += pHybridReal[hybOffset + n];
|
accu1 += pHybridReal[hybOffset + n] >> scale;
|
||||||
accu2 += pHybridImag[hybOffset + n];
|
accu2 += pHybridImag[hybOffset + n] >> scale;
|
||||||
}
|
}
|
||||||
pQmfReal[k] = accu1;
|
pQmfReal[k] = SATURATE_LEFT_SHIFT(accu1, scale, DFRACT_BITS);
|
||||||
pQmfImag[k] = accu2;
|
pQmfImag[k] = SATURATE_LEFT_SHIFT(accu2, scale, DFRACT_BITS);
|
||||||
|
|
||||||
hybOffset += nHybBands;
|
hybOffset += nHybBands;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
||||||
|
|
||||||
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
||||||
Forschung e.V. All rights reserved.
|
Forschung e.V. All rights reserved.
|
||||||
|
|
||||||
1. INTRODUCTION
|
1. INTRODUCTION
|
||||||
@ -117,6 +117,9 @@ amm-info@iis.fraunhofer.de
|
|||||||
/* Scaling of spectral data after applying M2 matrix, but only for binaural
|
/* Scaling of spectral data after applying M2 matrix, but only for binaural
|
||||||
upmix type Scaling is compensated later in synthesis qmf filterbank */
|
upmix type Scaling is compensated later in synthesis qmf filterbank */
|
||||||
#define SCALE_DATA_APPLY_M2 (1)
|
#define SCALE_DATA_APPLY_M2 (1)
|
||||||
|
/* Applying M2 parameter in combination with phase coding needs 2 bits headroom
|
||||||
|
* because up to a maximum of 4 spectral values can be added for USAC */
|
||||||
|
#define SCALE_DATA_APPLY_M2_PC (2)
|
||||||
|
|
||||||
SACDEC_ERROR initM1andM2(spatialDec* self, int initStatesFlag,
|
SACDEC_ERROR initM1andM2(spatialDec* self, int initStatesFlag,
|
||||||
int configChanged);
|
int configChanged);
|
||||||
|
@ -1317,10 +1317,12 @@ static SACDEC_ERROR SpatialDecApplyParameterSets(
|
|||||||
if ((self->tempShapeConfig == 1) && (!isTwoChMode(self->upmixType))) {
|
if ((self->tempShapeConfig == 1) && (!isTwoChMode(self->upmixType))) {
|
||||||
for (ch = 0; ch < self->numOutputChannels; ch++) {
|
for (ch = 0; ch < self->numOutputChannels; ch++) {
|
||||||
for (hyb = 0; hyb < self->tp_hybBandBorder; hyb++) {
|
for (hyb = 0; hyb < self->tp_hybBandBorder; hyb++) {
|
||||||
self->hybOutputRealDry__FDK[ch][hyb] +=
|
self->hybOutputRealDry__FDK[ch][hyb] =
|
||||||
self->hybOutputRealWet__FDK[ch][hyb];
|
fAddSaturate(self->hybOutputRealDry__FDK[ch][hyb],
|
||||||
self->hybOutputImagDry__FDK[ch][hyb] +=
|
self->hybOutputRealWet__FDK[ch][hyb]);
|
||||||
self->hybOutputImagWet__FDK[ch][hyb];
|
self->hybOutputImagDry__FDK[ch][hyb] =
|
||||||
|
fAddSaturate(self->hybOutputImagDry__FDK[ch][hyb],
|
||||||
|
self->hybOutputImagWet__FDK[ch][hyb]);
|
||||||
} /* loop hyb */
|
} /* loop hyb */
|
||||||
} /* loop ch */
|
} /* loop ch */
|
||||||
err = subbandTPApply(
|
err = subbandTPApply(
|
||||||
@ -1341,11 +1343,11 @@ static SACDEC_ERROR SpatialDecApplyParameterSets(
|
|||||||
FIXP_DBL *RESTRICT pRealWet = self->hybOutputRealWet__FDK[ch];
|
FIXP_DBL *RESTRICT pRealWet = self->hybOutputRealWet__FDK[ch];
|
||||||
FIXP_DBL *RESTRICT pImagWet = self->hybOutputImagWet__FDK[ch];
|
FIXP_DBL *RESTRICT pImagWet = self->hybOutputImagWet__FDK[ch];
|
||||||
for (hyb = 0; hyb < nHybBands; hyb++) {
|
for (hyb = 0; hyb < nHybBands; hyb++) {
|
||||||
pRealDry[hyb] += pRealWet[hyb];
|
pRealDry[hyb] = fAddSaturate(pRealDry[hyb], pRealWet[hyb]);
|
||||||
pImagDry[hyb] += pImagWet[hyb];
|
pImagDry[hyb] = fAddSaturate(pImagDry[hyb], pImagWet[hyb]);
|
||||||
} /* loop hyb */
|
} /* loop hyb */
|
||||||
for (; hyb < self->hybridBands; hyb++) {
|
for (; hyb < self->hybridBands; hyb++) {
|
||||||
pRealDry[hyb] += pRealWet[hyb];
|
pRealDry[hyb] = fAddSaturate(pRealDry[hyb], pRealWet[hyb]);
|
||||||
} /* loop hyb */
|
} /* loop hyb */
|
||||||
} /* loop ch */
|
} /* loop ch */
|
||||||
} /* ( self->tempShapeConfig == 1 ) || ( self->tempShapeConfig == 2 ) */
|
} /* ( self->tempShapeConfig == 1 ) || ( self->tempShapeConfig == 2 ) */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
Software License for The Fraunhofer FDK AAC Codec Library for Android
|
||||||
|
|
||||||
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
|
||||||
Forschung e.V. All rights reserved.
|
Forschung e.V. All rights reserved.
|
||||||
|
|
||||||
1. INTRODUCTION
|
1. INTRODUCTION
|
||||||
@ -113,6 +113,8 @@ amm-info@iis.fraunhofer.de
|
|||||||
#include "FDK_trigFcts.h"
|
#include "FDK_trigFcts.h"
|
||||||
#include "FDK_decorrelate.h"
|
#include "FDK_decorrelate.h"
|
||||||
|
|
||||||
|
#define SAC_DEC_APPLY_M2_SCALE(spec, s) ((spec) >> (-(s)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Linear interpolation between two parameter values.
|
* \brief Linear interpolation between two parameter values.
|
||||||
* a*alpha + b*(1-alpha)
|
* a*alpha + b*(1-alpha)
|
||||||
@ -634,8 +636,7 @@ SACDEC_ERROR SpatialDecApplyM2(spatialDec *self, INT ps, const FIXP_SGL alpha,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (self->phaseCoding == 3) {
|
if (self->phaseCoding == 3) {
|
||||||
/* + SCALE_DATA_APPLY_M2 to compensate for Div2 below ?! */
|
scale_param_m2 = -(SCALE_DATA_APPLY_M2_PC - 1);
|
||||||
scale_param_m2 = SCALE_PARAM_M2_212_PRED + SCALE_DATA_APPLY_M2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (row = 0; row < self->numM2rows; row++) {
|
for (row = 0; row < self->numM2rows; row++) {
|
||||||
@ -686,10 +687,10 @@ SACDEC_ERROR SpatialDecApplyM2(spatialDec *self, INT ps, const FIXP_SGL alpha,
|
|||||||
} else { /* isBinauralMode(self->upmixType) */
|
} else { /* isBinauralMode(self->upmixType) */
|
||||||
|
|
||||||
for (qs = 0; qs < complexHybBands; qs++) {
|
for (qs = 0; qs < complexHybBands; qs++) {
|
||||||
pHybOutRealDry[qs] += fMultDiv2(pWReal[qs], pKernel[qs])
|
pHybOutRealDry[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[qs], pKernel[qs]), scale_param_m2);
|
||||||
pHybOutImagDry[qs] += fMultDiv2(pWImag[qs], pKernel[qs])
|
pHybOutImagDry[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[qs], pKernel[qs]), scale_param_m2);
|
||||||
}
|
}
|
||||||
|
|
||||||
M2ParamToKernelMult(pKernel, self->M2Imag__FDK[row][col],
|
M2ParamToKernelMult(pKernel, self->M2Imag__FDK[row][col],
|
||||||
@ -697,27 +698,27 @@ SACDEC_ERROR SpatialDecApplyM2(spatialDec *self, INT ps, const FIXP_SGL alpha,
|
|||||||
self->kernels_width, alpha, complexParBands);
|
self->kernels_width, alpha, complexParBands);
|
||||||
|
|
||||||
/* direct signals sign is -1 for qs = 0,2 */
|
/* direct signals sign is -1 for qs = 0,2 */
|
||||||
pHybOutRealDry[0] += fMultDiv2(pWImag[0], pKernel[0])
|
pHybOutRealDry[0] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[0], pKernel[0]), scale_param_m2);
|
||||||
pHybOutImagDry[0] -= fMultDiv2(pWReal[0], pKernel[0])
|
pHybOutImagDry[0] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[0], pKernel[0]), scale_param_m2);
|
||||||
|
|
||||||
pHybOutRealDry[2] += fMultDiv2(pWImag[2], pKernel[2])
|
pHybOutRealDry[2] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[2], pKernel[2]), scale_param_m2);
|
||||||
pHybOutImagDry[2] -= fMultDiv2(pWReal[2], pKernel[2])
|
pHybOutImagDry[2] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[2], pKernel[2]), scale_param_m2);
|
||||||
|
|
||||||
/* direct signals sign is +1 for qs = 1,3,4,5,...,complexHybBands */
|
/* direct signals sign is +1 for qs = 1,3,4,5,...,complexHybBands */
|
||||||
pHybOutRealDry[1] -= fMultDiv2(pWImag[1], pKernel[1])
|
pHybOutRealDry[1] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[1], pKernel[1]), scale_param_m2);
|
||||||
pHybOutImagDry[1] += fMultDiv2(pWReal[1], pKernel[1])
|
pHybOutImagDry[1] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[1], pKernel[1]), scale_param_m2);
|
||||||
|
|
||||||
for (qs = 3; qs < complexHybBands; qs++) {
|
for (qs = 3; qs < complexHybBands; qs++) {
|
||||||
pHybOutRealDry[qs] -= fMultDiv2(pWImag[qs], pKernel[qs])
|
pHybOutRealDry[qs] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[qs], pKernel[qs]), scale_param_m2);
|
||||||
pHybOutImagDry[qs] += fMultDiv2(pWReal[qs], pKernel[qs])
|
pHybOutImagDry[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[qs], pKernel[qs]), scale_param_m2);
|
||||||
}
|
}
|
||||||
} /* self->upmixType */
|
} /* self->upmixType */
|
||||||
} /* if (activParamBands) */
|
} /* if (activParamBands) */
|
||||||
@ -770,17 +771,17 @@ SACDEC_ERROR SpatialDecApplyM2(spatialDec *self, INT ps, const FIXP_SGL alpha,
|
|||||||
FIXP_DBL *RESTRICT pHybOutImag;
|
FIXP_DBL *RESTRICT pHybOutImag;
|
||||||
|
|
||||||
for (qs = 0; qs < resHybIndex; qs++) {
|
for (qs = 0; qs < resHybIndex; qs++) {
|
||||||
pHybOutRealDry[qs] += fMultDiv2(pWReal[qs], pKernel[qs])
|
pHybOutRealDry[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[qs], pKernel[qs]), scale_param_m2);
|
||||||
pHybOutImagDry[qs] += fMultDiv2(pWImag[qs], pKernel[qs])
|
pHybOutImagDry[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[qs], pKernel[qs]), scale_param_m2);
|
||||||
}
|
}
|
||||||
/* decor signals */
|
/* decor signals */
|
||||||
for (; qs < complexHybBands; qs++) {
|
for (; qs < complexHybBands; qs++) {
|
||||||
pHybOutRealWet[qs] += fMultDiv2(pWReal[qs], pKernel[qs])
|
pHybOutRealWet[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[qs], pKernel[qs]), scale_param_m2);
|
||||||
pHybOutImagWet[qs] += fMultDiv2(pWImag[qs], pKernel[qs])
|
pHybOutImagWet[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[qs], pKernel[qs]), scale_param_m2);
|
||||||
}
|
}
|
||||||
|
|
||||||
M2ParamToKernelMult(pKernel, self->M2Imag__FDK[row][col],
|
M2ParamToKernelMult(pKernel, self->M2Imag__FDK[row][col],
|
||||||
@ -790,20 +791,20 @@ SACDEC_ERROR SpatialDecApplyM2(spatialDec *self, INT ps, const FIXP_SGL alpha,
|
|||||||
/* direct signals sign is -1 for qs = 0,2 */
|
/* direct signals sign is -1 for qs = 0,2 */
|
||||||
/* direct signals sign is +1 for qs = 1,3.. */
|
/* direct signals sign is +1 for qs = 1,3.. */
|
||||||
if (toolsDisabled) {
|
if (toolsDisabled) {
|
||||||
pHybOutRealDry[0] += fMultDiv2(pWImag[0], pKernel[0])
|
pHybOutRealDry[0] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[0], pKernel[0]), scale_param_m2);
|
||||||
pHybOutImagDry[0] -= fMultDiv2(pWReal[0], pKernel[0])
|
pHybOutImagDry[0] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[0], pKernel[0]), scale_param_m2);
|
||||||
|
|
||||||
pHybOutRealDry[1] -= fMultDiv2(pWImag[1], pKernel[1])
|
pHybOutRealDry[1] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[1], pKernel[1]), scale_param_m2);
|
||||||
pHybOutImagDry[1] += fMultDiv2(pWReal[1], pKernel[1])
|
pHybOutImagDry[1] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[1], pKernel[1]), scale_param_m2);
|
||||||
|
|
||||||
pHybOutRealDry[2] += fMultDiv2(pWImag[2], pKernel[2])
|
pHybOutRealDry[2] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[2], pKernel[2]), scale_param_m2);
|
||||||
pHybOutImagDry[2] -= fMultDiv2(pWReal[2], pKernel[2])
|
pHybOutImagDry[2] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[2], pKernel[2]), scale_param_m2);
|
||||||
} else {
|
} else {
|
||||||
pHybOutReal = &pHybOutRealDry[0];
|
pHybOutReal = &pHybOutRealDry[0];
|
||||||
pHybOutImag = &pHybOutImagDry[0];
|
pHybOutImag = &pHybOutImagDry[0];
|
||||||
@ -811,46 +812,60 @@ SACDEC_ERROR SpatialDecApplyM2(spatialDec *self, INT ps, const FIXP_SGL alpha,
|
|||||||
pHybOutReal = &pHybOutRealWet[0];
|
pHybOutReal = &pHybOutRealWet[0];
|
||||||
pHybOutImag = &pHybOutImagWet[0];
|
pHybOutImag = &pHybOutImagWet[0];
|
||||||
}
|
}
|
||||||
pHybOutReal[0] += fMultDiv2(pWImag[0], pKernel[0])
|
pHybOutReal[0] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[0], pKernel[0]), scale_param_m2);
|
||||||
pHybOutImag[0] -= fMultDiv2(pWReal[0], pKernel[0])
|
pHybOutImag[0] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[0], pKernel[0]), scale_param_m2);
|
||||||
|
|
||||||
if (1 == resHybIndex) {
|
if (1 == resHybIndex) {
|
||||||
pHybOutReal = &pHybOutRealWet[0];
|
pHybOutReal = &pHybOutRealWet[0];
|
||||||
pHybOutImag = &pHybOutImagWet[0];
|
pHybOutImag = &pHybOutImagWet[0];
|
||||||
}
|
}
|
||||||
pHybOutReal[1] -= fMultDiv2(pWImag[1], pKernel[1])
|
pHybOutReal[1] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[1], pKernel[1]), scale_param_m2);
|
||||||
pHybOutImag[1] += fMultDiv2(pWReal[1], pKernel[1])
|
pHybOutImag[1] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[1], pKernel[1]), scale_param_m2);
|
||||||
|
|
||||||
if (2 == resHybIndex) {
|
if (2 == resHybIndex) {
|
||||||
pHybOutReal = &pHybOutRealWet[0];
|
pHybOutReal = &pHybOutRealWet[0];
|
||||||
pHybOutImag = &pHybOutImagWet[0];
|
pHybOutImag = &pHybOutImagWet[0];
|
||||||
}
|
}
|
||||||
pHybOutReal[2] += fMultDiv2(pWImag[2], pKernel[2])
|
pHybOutReal[2] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[2], pKernel[2]), scale_param_m2);
|
||||||
pHybOutImag[2] -= fMultDiv2(pWReal[2], pKernel[2])
|
pHybOutImag[2] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[2], pKernel[2]), scale_param_m2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (qs = 3; qs < resHybIndex; qs++) {
|
for (qs = 3; qs < resHybIndex; qs++) {
|
||||||
pHybOutRealDry[qs] -= fMultDiv2(pWImag[qs], pKernel[qs])
|
pHybOutRealDry[qs] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[qs], pKernel[qs]), scale_param_m2);
|
||||||
pHybOutImagDry[qs] += fMultDiv2(pWReal[qs], pKernel[qs])
|
pHybOutImagDry[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[qs], pKernel[qs]), scale_param_m2);
|
||||||
}
|
}
|
||||||
/* decor signals */
|
/* decor signals */
|
||||||
for (; qs < complexHybBands; qs++) {
|
for (; qs < complexHybBands; qs++) {
|
||||||
pHybOutRealWet[qs] -= fMultDiv2(pWImag[qs], pKernel[qs])
|
pHybOutRealWet[qs] -= SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWImag[qs], pKernel[qs]), scale_param_m2);
|
||||||
pHybOutImagWet[qs] += fMultDiv2(pWReal[qs], pKernel[qs])
|
pHybOutImagWet[qs] += SAC_DEC_APPLY_M2_SCALE(
|
||||||
<< (scale_param_m2);
|
fMultDiv2(pWReal[qs], pKernel[qs]), scale_param_m2);
|
||||||
}
|
}
|
||||||
} /* self->upmixType */
|
} /* self->upmixType */
|
||||||
} /* if (activParamBands) { */
|
} /* if (activParamBands) { */
|
||||||
} /* self->numVChannels */
|
} /* self->numVChannels */
|
||||||
|
|
||||||
|
if (self->phaseCoding == 3) {
|
||||||
|
scaleValuesSaturate(pHybOutRealDry, complexHybBands,
|
||||||
|
SCALE_PARAM_M2_212_PRED + SCALE_DATA_APPLY_M2_PC);
|
||||||
|
scaleValuesSaturate(pHybOutImagDry, complexHybBands,
|
||||||
|
SCALE_PARAM_M2_212_PRED + SCALE_DATA_APPLY_M2_PC);
|
||||||
|
|
||||||
|
if (!toolsDisabled) {
|
||||||
|
scaleValuesSaturate(pHybOutRealWet, complexHybBands,
|
||||||
|
SCALE_PARAM_M2_212_PRED + SCALE_DATA_APPLY_M2_PC);
|
||||||
|
scaleValuesSaturate(pHybOutImagWet, complexHybBands,
|
||||||
|
SCALE_PARAM_M2_212_PRED + SCALE_DATA_APPLY_M2_PC);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
C_ALLOC_SCRATCH_END(pKernel, FIXP_SGL, MAX_HYBRID_BANDS);
|
C_ALLOC_SCRATCH_END(pKernel, FIXP_SGL, MAX_HYBRID_BANDS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user