diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2016-04-09 00:36:07 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-04-09 00:36:07 +0000 |
commit | 125815b0ed558c72bb019a2d36c662e5e7f7c030 (patch) | |
tree | 626b5c026f23b0c8ec4dab155faf86d55cd9d94e /libAACenc/src/qc_main.cpp | |
parent | d75233c2da4b49259d2e2de701f326d1a8d897b1 (diff) | |
parent | 46ba3676b854acbc69a4c7845f578d4c2886377b (diff) | |
download | fdk-aac-125815b0ed558c72bb019a2d36c662e5e7f7c030.tar.gz fdk-aac-125815b0ed558c72bb019a2d36c662e5e7f7c030.tar.bz2 fdk-aac-125815b0ed558c72bb019a2d36c662e5e7f7c030.zip |
AAC/SBR encoder improvements
am: 46ba367
* commit '46ba3676b854acbc69a4c7845f578d4c2886377b':
AAC/SBR encoder improvements
Change-Id: Id839c5ba8b79eddb7e239b7ec1b26fb5079b7d81
Diffstat (limited to 'libAACenc/src/qc_main.cpp')
-rw-r--r-- | libAACenc/src/qc_main.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libAACenc/src/qc_main.cpp b/libAACenc/src/qc_main.cpp index 7503309..9cd73f6 100644 --- a/libAACenc/src/qc_main.cpp +++ b/libAACenc/src/qc_main.cpp @@ -380,7 +380,7 @@ AAC_ENCODER_ERROR FDKaacEnc_QCInit(QC_STATE *hQC, if ( isConstantBitrateMode(hQC->bitrateMode) ) { INT bitresPerChannel = (hQC->bitResTotMax / init->channelMapping->nChannelsEff); /* 0: full bitreservoir, 1: reduced bitreservoir, 2: disabled bitreservoir */ - hQC->bitDistributionMode = (bitresPerChannel>100) ? 0 : (bitresPerChannel>0) ? 1 : 2; + hQC->bitDistributionMode = (bitresPerChannel>BITRES_MIN_LD) ? 0 : (bitresPerChannel>0) ? 1 : 2; } else { hQC->bitDistributionMode = 0; /* full bitreservoir */ @@ -405,6 +405,16 @@ AAC_ENCODER_ERROR FDKaacEnc_QCInit(QC_STATE *hQC, } } + if (init->channelMapping->nChannelsEff == 1 && + (init->bitrate / init->channelMapping->nChannelsEff) < 32000 && + init->advancedBitsToPe != 0 + ) + { + hQC->dZoneQuantEnable = 1; + } else { + hQC->dZoneQuantEnable = 0; + } + FDKaacEnc_AdjThrInit( hQC->hAdjThr, init->meanPe, @@ -414,7 +424,8 @@ AAC_ENCODER_ERROR FDKaacEnc_QCInit(QC_STATE *hQC, init->channelMapping->nChannelsEff, init->sampleRate, /* output sample rate */ init->advancedBitsToPe, /* if set, calc bits2PE factor depending on samplerate */ - hQC->vbrQualFactor + hQC->vbrQualFactor, + hQC->dZoneQuantEnable ); return AAC_ENC_OK; @@ -877,6 +888,7 @@ AAC_ENCODER_ERROR FDKaacEnc_QCMain(QC_STATE* RESTRICT hQC, qcOut[c], psyOut[c]->psyOutElement, isConstantBitrateMode(hQC->bitrateMode), + hQC->hAdjThr->maxIter2ndGuess, cm); } /* -end- sub frame counter */ @@ -904,6 +916,7 @@ AAC_ENCODER_ERROR FDKaacEnc_QCMain(QC_STATE* RESTRICT hQC, FDKaacEnc_EstimateScaleFactors(psyOut[c]->psyOutElement[i]->psyOutChannel, qcElement[c][i]->qcOutChannel, hQC->invQuant, + hQC->dZoneQuantEnable, cm->elInfo[i].nChannelsInEl); @@ -998,7 +1011,8 @@ AAC_ENCODER_ERROR FDKaacEnc_QCMain(QC_STATE* RESTRICT hQC, qcOutCh->mdctSpectrum, qcOutCh->globalGain, qcOutCh->scf, - qcOutCh->quantSpec) ; + qcOutCh->quantSpec, + hQC->dZoneQuantEnable); /*-------------------------------------------- */ if (FDKaacEnc_calcMaxValueInSfb(psyOutCh->sfbCnt, |