diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2013-08-08 18:32:55 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2013-08-20 15:31:42 -0700 |
commit | 16c472c201c197d3660334df5952eb4084897f9f (patch) | |
tree | 33f6729a47fb3a6021e9a6f6bc2c330fb17924e3 /libAACenc/src/metadata_compressor.cpp | |
parent | a84864deb7c36b88f104f3116552d52d1ce64045 (diff) | |
download | fdk-aac-dabplus-16c472c201c197d3660334df5952eb4084897f9f.tar.gz fdk-aac-dabplus-16c472c201c197d3660334df5952eb4084897f9f.tar.bz2 fdk-aac-dabplus-16c472c201c197d3660334df5952eb4084897f9f.zip |
AAC encoder metadata improvement
AAC-Encoder
- Introduce metadata support for parametric stereo audio object type.
Write metadata matrix mixdown coefficient only for channel config 5 and 6.
Modified file(s):
libAACenc/src/aacenc_lib.cpp
- Revise metadata encoder downmix gain and fix matrix mixdown coefficient.
Modified file(s):
libAACenc/src/aacenc_lib.cpp
libAACenc/src/metadata_compressor.cpp
libMpegTPEnc/src/tpenc_asc.cpp
libMpegTPEnc/src/tpenc_lib.cpp
libMpegTPEnc/src/version
Bug 9428126
Change-Id: I87f5f1a1fdddd8223187aa0f9dc733e0ecc3e7e4
Diffstat (limited to 'libAACenc/src/metadata_compressor.cpp')
-rw-r--r-- | libAACenc/src/metadata_compressor.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libAACenc/src/metadata_compressor.cpp b/libAACenc/src/metadata_compressor.cpp index a96afbf..6fd8266 100644 --- a/libAACenc/src/metadata_compressor.cpp +++ b/libAACenc/src/metadata_compressor.cpp @@ -421,7 +421,7 @@ static FIXP_DBL tc2Coeff( result = f2Pow(-exponent, DFRACT_BITS-1-METADATA_FRACT_BITS, &e_res); /* result = 1.0 - exp(-1.0/((t) * (f))) */ - result = FL2FXCONST_DBL(1.0f) - scaleValue(result, e_res); + result = (FIXP_DBL)MAXVAL_DBL - scaleValue(result, e_res); return result; } @@ -832,12 +832,12 @@ INT FDK_DRC_Generator_Calc( FIXP_DBL accu; /* drcComp->smoothLevel[i] = (1-alpha) * drcComp->smoothLevel[i] + alpha * level; */ - accu = fMult((FL2FXCONST_DBL(1.f)-alpha), drcComp->smoothLevel[i]); + accu = fMult(((FIXP_DBL)MAXVAL_DBL-alpha), drcComp->smoothLevel[i]); accu += fMult(alpha,level); drcComp->smoothLevel[i] = accu; /* drcComp->smoothGain[i] = (1-alpha) * drcComp->smoothGain[i] + alpha * gain; */ - accu = fMult((FL2FXCONST_DBL(1.f)-alpha), drcComp->smoothGain[i]); + accu = fMult(((FIXP_DBL)MAXVAL_DBL-alpha), drcComp->smoothGain[i]); accu += fMult(alpha,gain); drcComp->smoothGain[i] = accu; } @@ -941,7 +941,7 @@ INT FDK_DRC_Generator_Calc( if ((drcComp->channelIdx[LS] >= 0) && (drcComp->channelIdx[LS2] >= 0)) tmp = fMult(FL2FXCONST_DBL(0.707f), tmp); /* 7.1ch */ /*if ((drcComp->channelIdx[RS] >= 0) && (drcComp->channelIdx[RS2] >= 0)) tmp *=0.707f;*/ /* 7.1ch */ if (drcComp->channelIdx[S] >= 0) tmp += fMultDiv2(slev, fMult(FL2FXCONST_DBL(0.7f), (FIXP_PCM)pSamples[drcComp->channelIdx[S]]))>>(DOWNMIX_SHIFT-1); /* S */ - if (drcComp->channelIdx[C] >= 0) tmp += fMultDiv2(clev, (FIXP_PCM)pSamples[drcComp->channelIdx[C]])>>(DOWNMIX_SHIFT-1); /* C */ + if (drcComp->channelIdx[C] >= 0) tmp += fMult(clev, (FIXP_PCM)pSamples[drcComp->channelIdx[C]])>>(DOWNMIX_SHIFT-1); /* C (2*clev) */ tmp += (FX_PCM2FX_DBL((FIXP_PCM)pSamples[drcComp->channelIdx[L]])>>DOWNMIX_SHIFT); /* L */ tmp += (FX_PCM2FX_DBL((FIXP_PCM)pSamples[drcComp->channelIdx[R]])>>DOWNMIX_SHIFT); /* R */ @@ -973,7 +973,7 @@ INT FDK_DRC_Generator_Calc( * + 0.2f*2^(-METADATA_FRACT_BITS) + drcComp->smoothGain[i] */ peak[i] = fMult((FIXP_DBL)(10<<(METADATA_FRACT_BITS+LD_DATA_SHIFT)), fMult( FL2FX_DBL(2*0.30102999566398119521373889472449f), ld_peak)); - peak[i] += (FL2FX_DBL(0.2f)>>METADATA_INT_BITS); /* add a little bit headroom */ + peak[i] += (FL2FX_DBL(0.5f)>>METADATA_INT_BITS); /* add a little bit headroom */ peak[i] += drcComp->smoothGain[i]; } |