summaryrefslogtreecommitdiffstats
path: root/libAACenc/src/qc_main.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-14 17:32:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-09 14:01:13 +0200
commitc89fb86cefb19ac9cf198c1e5cc31a85beab072e (patch)
tree74a5bd821b8a2823d6a0391066bce9fca23e6f35 /libAACenc/src/qc_main.cpp
parenta0bd8aa3b6339082fbe9d830264839fa50c0a4b7 (diff)
downloadfdk-aac-c89fb86cefb19ac9cf198c1e5cc31a85beab072e.tar.gz
fdk-aac-c89fb86cefb19ac9cf198c1e5cc31a85beab072e.tar.bz2
fdk-aac-c89fb86cefb19ac9cf198c1e5cc31a85beab072e.zip
Add DAB+ support
Diffstat (limited to 'libAACenc/src/qc_main.cpp')
-rw-r--r--libAACenc/src/qc_main.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/libAACenc/src/qc_main.cpp b/libAACenc/src/qc_main.cpp
index 9cd73f6..1025894 100644
--- a/libAACenc/src/qc_main.cpp
+++ b/libAACenc/src/qc_main.cpp
@@ -87,7 +87,7 @@ amm-info@iis.fraunhofer.de
contents/description: Quantizing & coding
******************************************************************************/
-
+#include <stdio.h>
#include "qc_main.h"
#include "quantize.h"
#include "interface.h"
@@ -487,20 +487,24 @@ AAC_ENCODER_ERROR FDKaacEnc_AdjustBitrate(QC_STATE *RESTRICT hQC,
INT sampleRate, /* output sampling rate */
INT granuleLength) /* frame length */
{
- INT paddingOn;
+ INT paddingOn=0;
INT frameLen;
+ //fprintf(stderr, "hQC->padding.paddingRest=%d bytes! (before)\n", hQC->padding.paddingRest);
/* Do we need an extra padding byte? */
paddingOn = FDKaacEnc_framePadding(bitRate,
sampleRate,
granuleLength,
&hQC->padding.paddingRest);
+ //fprintf(stderr, "hQC->padding.paddingRest=%d bytes! (after)\n", hQC->padding.paddingRest);
frameLen = paddingOn + FDKaacEnc_calcFrameLen(bitRate,
sampleRate,
granuleLength,
FRAME_LEN_BYTES_INT);
+ //fprintf(stderr, "frameLen=%d bytes!\n", frameLen);
+
*avgTotalBits = frameLen<<3;
return AAC_ENC_OK;
@@ -1377,7 +1381,7 @@ AAC_ENCODER_ERROR FDKaacEnc_FinalizeBitConsumption(CHANNEL_MAPPING *cm,
/* Get total consumed bits in AU */
qcOut->totalBits = qcOut->staticBits + qcOut->usedDynBits + qcOut->totFillBits +
qcOut->elementExtBits + qcOut->globalExtBits;
-
+#if 1
if (qcKernel->bitrateMode==QCDATA_BR_MODE_CBR) {
/* Now we can get the exact transport bit amount, and hopefully it is equal to the estimated value */
@@ -1419,7 +1423,7 @@ AAC_ENCODER_ERROR FDKaacEnc_FinalizeBitConsumption(CHANNEL_MAPPING *cm,
}
} /* MODE_CBR */
-
+#endif
/* Update exact number of consumed header bits. */
qcKernel->globHdrBits = transportEnc_GetStaticBits(hTpEnc, qcOut->totalBits);
@@ -1440,6 +1444,8 @@ AAC_ENCODER_ERROR FDKaacEnc_FinalizeBitConsumption(CHANNEL_MAPPING *cm,
aot,
epConfig );
+ //fprintf(stderr, "FinalizeBitConsumption(): totFillBits=%d, qcOut->totFillBits=%d \n", totFillBits, qcOut->totFillBits);
+
/* now distribute extra fillbits and alignbits */
alignBits = 7 - (qcOut->staticBits + qcOut->usedDynBits + qcOut->elementExtBits
+ qcOut->totFillBits + qcOut->globalExtBits -1)%8;