diff --git a/src/app/exhaleApp.cpp b/src/app/exhaleApp.cpp index e7d4165..1f5a5f1 100644 --- a/src/app/exhaleApp.cpp +++ b/src/app/exhaleApp.cpp @@ -73,7 +73,6 @@ #define EA_PEAK_MIN 0.262f // 20 * log10() + EA_PEAK_NORM = -108 dbFS #define EA_USE_WORK_DIR 1 // 1: use working instead of app directory #define ENABLE_STDOUT_LOAS 0 // 1: experimental LOAS packed pipe output -#define XHE_AAC_LOW_DELAY 0 // 1: allow encoding with 768 frame length #define FULL_FRM_LOOKAHEAD // on: encoder delay = zero or frame length static const int16_t usfc2x[32] = { // 2x upsampling filter coefficients @@ -95,7 +94,7 @@ static bool eaInitUpsampler2x (int32_t** upsampleBuffer, const uint16_t bitRateM { const uint16_t inLength = frameSize >> 1; const uint16_t chLength = inLength + (32 << 1); - const bool useUpsampler = (frameSize > (32 << 1) && bitRateMode * 4000 > sampleRate); + const bool useUpsampler = (frameSize > (32 << 1) && bitRateMode * 3675 > sampleRate); if (useUpsampler) { @@ -495,19 +494,11 @@ int main (const int argc, char* argv[]) fprintf_s (stdout, "%s preset [inputWaveFile.wav] outputMP4File.m4a\n\n where\n\n", exeFileName); #endif #ifdef EXHALE_APP_WIN - fprintf_s (stdout, " preset\t= # (0-9) low-complexity standard compliant xHE-AAC at 16ú#+48 kbit/s\n"); -# if XHE_AAC_LOW_DELAY - fprintf_s (stdout, " \t (A-J) 41ms low-delay compatible xHE-AAC with BE at 16ú#+48 kbit/s\n"); -# else - fprintf_s (stdout, " \t (a-g) low-complexity compliant xHE-AAC with SBR at 12ú#+36 kbit/s\n"); -# endif + fprintf_s (stdout, " preset\t= # (0-9) low-complexity ISO/MPEG-D Extended HE-AAC at 16ú#+48 kbit/s\n"); + fprintf_s (stdout, " \t (a-g) low-complexity Extended HE-AAC using eSBR at 12ú#+36 kbit/s\n"); #else - fprintf_s (stdout, " preset\t= # (0-9) low-complexity standard compliant xHE-AAC at 16*#+48 kbit/s\n"); -# if XHE_AAC_LOW_DELAY - fprintf_s (stdout, " \t (A-J) 41ms low-delay compatible xHE-AAC with BE at 16*#+48 kbit/s\n"); -# else - fprintf_s (stdout, " \t (a-g) low-complexity compliant xHE-AAC with SBR at 12*#+36 kbit/s\n"); -# endif + fprintf_s (stdout, " preset\t= # (0-9) low-complexity ISO/MPEG-D Extended HE-AAC at 16*#+48 kbit/s\n"); + fprintf_s (stdout, " \t (a-g) low-complexity Extended HE-AAC using eSBR at 12*#+36 kbit/s\n"); #endif fprintf_s (stdout, "\n inputWaveFile.wav lossless WAVE audio input, read from stdin if not specified\n\n"); fprintf_s (stdout, " outputMP4File.m4a encoded MPEG-4 bit-stream, extension should be .m4a or .mp4\n\n\n"); @@ -536,11 +527,7 @@ int main (const int argc, char* argv[]) } // check preset mode, derive coder config -#if XHE_AAC_LOW_DELAY - if ((*argv[1] >= '0' && *argv[1] <= '9') || (*argv[1] >= 'A' && *argv[1] <= 'J')) -#else if ((*argv[1] >= '0' && *argv[1] <= '9') || (*argv[1] >= 'a' && *argv[1] <= 'g')) -#endif { i = (uint16_t) argv[1][0]; compatibleExtensionFlag = (i & 0x40) >> 6; @@ -560,11 +547,8 @@ int main (const int argc, char* argv[]) } else { -#if XHE_AAC_LOW_DELAY - _ERROR2 (" ERROR reading preset mode: character %s is not supported! Use 0-9 or A-J.\n\n", argv[1]); -#else _ERROR2 (" ERROR reading preset mode: character %s is not supported! Use 0-9 or a-g.\n\n", argv[1]); -#endif + return 16384; // preset isn't supported } @@ -666,7 +650,7 @@ int main (const int argc, char* argv[]) if (wavReader.getSampleRate () >= 1000 && wavReader.getSampleRate () < 22050 && enableSbrCoding) { - _ERROR2 (" The sampling rate is %d kHz but xHE-AAC with SBR requires at least 22 kHz.\n\n", wavReader.getSampleRate () / 1000); + _ERROR2 (" The sampling rate is %d kHz but encoding using eSBR requires at least 22 kHz.\n\n", wavReader.getSampleRate () / 1000); } i = 8192; // return value @@ -865,6 +849,14 @@ int main (const int argc, char* argv[]) fprintf_s (stdout, " NOTE: Upsampling the input audio from %d kHz to %d kHz with preset mode %d\n\n", i / 1000, i / 500, variableCoreBitRateMode); } + if (variableCoreBitRateMode == 0) + { + if (enableSbrCoding) + _ERROR1 (" WARNING: The usage of preset mode a is not recommended since the audio quality\n resulting from preset a does not reflect the full capabilities of the Extended\n HE-AAC standard. Therefore, use the lowest bit-rate modes only when necessary!\n\n"); + else + _ERROR1 (" WARNING: The usage of preset mode 0 is not recommended since the audio quality\n resulting from preset 0 does not reflect the full capabilities of the Extended\n HE-AAC standard. Therefore, use the lowest bit-rate modes only when necessary!\n\n"); + } + // allocate dynamic frame memory buffers inPcmData = (int32_t*) malloc (inFrameSize * numChannels); // max frame in size #ifdef NO_PREROLL_DATA @@ -965,7 +957,7 @@ int main (const int argc, char* argv[]) #endif , indepPeriod, outAuData, bw, (time (nullptr) + 2082844800) & UINT_MAX, (char) variableCoreBitRateMode)) != 0) { - _ERROR2 (" ERROR while trying to initialize xHE-AAC encoder: error value %d was returned!\n\n", i); + _ERROR2 (" ERROR while trying to initialize exhale encoder: error value %d was returned!\n\n", i); i <<= 2; // return value #if USE_EXHALELIB_DLL exhaleDelete (&exhaleEnc); @@ -1029,7 +1021,7 @@ int main (const int argc, char* argv[]) // initial frame, encode look-ahead AU if ((bw = exhaleEnc.encodeLookahead ()) < 3) { - _ERROR2 ("\n ERROR while trying to create first xHE-AAC frame: error value %d was returned!\n\n", bw); + _ERROR2 ("\n ERROR while trying to create first audio frame: error value %d was returned!\n\n", bw); i = 2; // return value #if USE_EXHALELIB_DLL exhaleDelete (&exhaleEnc); @@ -1057,7 +1049,7 @@ int main (const int argc, char* argv[]) // leading frame, actual look-ahead AU if ((bw = exhaleEnc.encodeFrame ()) < 3) { - _ERROR2 ("\n ERROR while trying to create first xHE-AAC frame: error value %d was returned!\n\n", bw); + _ERROR2 ("\n ERROR while trying to create first audio frame: error value %d was returned!\n\n", bw); i = 2; // return value # if USE_EXHALELIB_DLL exhaleDelete (&exhaleEnc); @@ -1100,7 +1092,7 @@ int main (const int argc, char* argv[]) if ((bw = exhaleEnc.encodeFrame ()) < 3) { - _ERROR2 ("\n ERROR while trying to create xHE-AAC frame: error value %d was returned!\n\n", bw); + _ERROR2 ("\n ERROR while trying to create audio frame: error value %d was returned!\n\n", bw); i = 2; // return value #if USE_EXHALELIB_DLL exhaleDelete (&exhaleEnc); @@ -1153,7 +1145,7 @@ int main (const int argc, char* argv[]) if ((bw = exhaleEnc.encodeFrame ()) < 3) { - _ERROR2 ("\n ERROR while trying to create xHE-AAC frame: error value %d was returned!\n\n", bw); + _ERROR2 ("\n ERROR while trying to create audio frame: error value %d was returned!\n\n", bw); i = 2; // return value #if USE_EXHALELIB_DLL exhaleDelete (&exhaleEnc); @@ -1212,7 +1204,7 @@ int main (const int argc, char* argv[]) if ((bw = exhaleEnc.encodeFrame ()) < 3) { - _ERROR2 ("\n ERROR while trying to create last xHE-AAC frame: error value %d was returned!\n\n", bw); + _ERROR2 ("\n ERROR while trying to create last audio frame: error value %d was returned!\n\n", bw); i = 2; // return value #if USE_EXHALELIB_DLL exhaleDelete (&exhaleEnc); diff --git a/src/app/exhaleApp.rc b/src/app/exhaleApp.rc index 6c79c20..fa8fdc4 100644 --- a/src/app/exhaleApp.rc +++ b/src/app/exhaleApp.rc @@ -13,7 +13,7 @@ 0 ICON "exhaleApp.ico" VS_VERSION_INFO VERSIONINFO -FILEVERSION 1,1,7 +FILEVERSION 1,1,7,1 BEGIN BLOCK "StringFileInfo" BEGIN diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index e0f3d9b..da01f41 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -5,7 +5,7 @@ # and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- # party rights, including patent rights. No such rights are granted under this License. # - # Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + # Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. ## add_library(exhaleLib diff --git a/src/lib/bitAllocation.cpp b/src/lib/bitAllocation.cpp index c7848e6..fad3a03 100644 --- a/src/lib/bitAllocation.cpp +++ b/src/lib/bitAllocation.cpp @@ -101,9 +101,16 @@ void BitAllocator::getChAverageTempFlat (uint8_t meanTempFlatInCh[USAC_MAX_NUM_C memcpy (meanTempFlatInCh, m_avgTempFlat, nChannels * sizeof (uint8_t)); } -uint16_t BitAllocator::getRateCtrlFac (const int32_t rateRatio, const unsigned samplingRate, const uint32_t specFlatness) +uint16_t BitAllocator::getRateCtrlFac (const int32_t rateRatio, const unsigned samplingRate, const uint32_t specFlatness, + const bool prevEightShorts /*= false*/) { +#if BA_MORE_CBR + const int32_t ratioFac = rateRatio * (40 - 5 * m_rateIndex); + const uint32_t brRatio = __max ((prevEightShorts ? (ratioFac * ratioFac + (1 << 16)) >> 17 : 0) - SHRT_MIN, __min (USHRT_MAX, ratioFac)) - + (m_rateIndex == 2 ? (1 << 11) : 0); +#else const uint32_t brRatio = __max (1 << 15, __min (USHRT_MAX, rateRatio * (36 - 9 * m_rateIndex))); +#endif const uint16_t mSfmSqr = (m_rateIndex < 2 && samplingRate >= 27713 ? (specFlatness * specFlatness) >> m_rateIndex : 0); const uint16_t mSfmFac = 256 - (((32 + m_rateIndex) * (specFlatness << 4) - mSfmSqr + (1 << 9)) >> 10); diff --git a/src/lib/bitAllocation.h b/src/lib/bitAllocation.h index 8f9b309..34fd968 100644 --- a/src/lib/bitAllocation.h +++ b/src/lib/bitAllocation.h @@ -16,6 +16,7 @@ // constants, experimental macros #define BA_EPS 1 +#define BA_MORE_CBR 0 // 1: force more constant bit-rate (CBR, experimental!) // class for audio bit-allocation class BitAllocator @@ -39,7 +40,8 @@ public: // public functions void getChAverageSpecFlat (uint8_t meanSpecFlatInCh[USAC_MAX_NUM_CHANNELS], const unsigned nChannels); void getChAverageTempFlat (uint8_t meanTempFlatInCh[USAC_MAX_NUM_CHANNELS], const unsigned nChannels); - uint16_t getRateCtrlFac (const int32_t rateRatio, const unsigned samplingRate, const uint32_t specFlatness); + uint16_t getRateCtrlFac (const int32_t rateRatio, const unsigned samplingRate, const uint32_t specFlatness, + const bool prevEightShorts = false); uint8_t getScaleFac (const uint32_t sfbStepSize, const int32_t* const sfbSignal, const uint8_t sfbWidth, const uint32_t sfbRmsValue); unsigned initAllocMemory (LinearPredictor* const linPredictor, const uint8_t numSwb, const uint8_t bitRateMode); diff --git a/src/lib/bitStreamWriter.cpp b/src/lib/bitStreamWriter.cpp index 684e91c..0795722 100644 --- a/src/lib/bitStreamWriter.cpp +++ b/src/lib/bitStreamWriter.cpp @@ -10,6 +10,7 @@ #include "exhaleLibPch.h" #include "bitStreamWriter.h" +#include "bitAllocation.h" // define BA_MORE_CBR (more constant bit-rate, experimental!) #ifndef NO_PREROLL_DATA static const uint8_t zeroAu[2][14] = { // single-element AUs incl. SBR for digital silence @@ -1126,7 +1127,11 @@ unsigned BitStreamWriter::createAudioFrame (CoreCoderData** const elementData, if (framesPerSec > 0.0 && targetRate > 0 && frameCount < UINT_MAX) // running overcoding ratio { +#if BA_MORE_CBR + *rate = uint32_t (0.5 + (m_auByteCount * framesPerSec) / (__max (framesPerSec, (double) frameCount) * targetRate)); +#else *rate = uint32_t (0.5 + (m_auByteCount * framesPerSec) / (__max (20.0 * framesPerSec, (double) frameCount) * targetRate)); +#endif } else *rate = 0; // insufficient data } diff --git a/src/lib/entropyCoding.cpp b/src/lib/entropyCoding.cpp index f11decf..4af1855 100644 --- a/src/lib/entropyCoding.cpp +++ b/src/lib/entropyCoding.cpp @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #include "exhaleLibPch.h" diff --git a/src/lib/entropyCoding.h b/src/lib/entropyCoding.h index d1039ea..20b25b9 100644 --- a/src/lib/entropyCoding.h +++ b/src/lib/entropyCoding.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _ENTROPY_CODING_H_ diff --git a/src/lib/exhaleEnc.cpp b/src/lib/exhaleEnc.cpp index 0211b6b..34e2c90 100644 --- a/src/lib/exhaleEnc.cpp +++ b/src/lib/exhaleEnc.cpp @@ -931,7 +931,7 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s #if !RESTRICT_TO_AAC const uint8_t numSwbCh = (eightShorts ? m_numSwbShort : m_numSwbLong); #endif - const uint16_t rateFac = m_bitAllocator.getRateCtrlFac (m_priLength ? m_rateFactor : 0, samplingRate, meanSpecFlat[ci]); // RC factor + const uint16_t rateFac = m_bitAllocator.getRateCtrlFac (m_rateFactor, samplingRate, meanSpecFlat[ci], coreConfig.icsInfoPrev[ch].windowSequence == EIGHT_SHORT); uint32_t* stepSizes = &sfbStepSizes[ci * m_numSwbShort * NUM_WINDOW_GROUPS]; memset (grpData.scaleFactors, 0, (MAX_NUM_SWB_SHORT * NUM_WINDOW_GROUPS) * sizeof (uint8_t)); @@ -961,13 +961,13 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s } // for gr #if !RESTRICT_TO_AAC - if ((maxSfbCh > 0) && m_noiseFilling[el] && (m_bitRateMode <= 3 || !eightShorts)) + if ((maxSfbCh > 0) && m_noiseFilling[el] && (m_shiftValSBR > 0 || m_bitRateMode <= 3 || !eightShorts)) { - const uint32_t maxSfbCurr = (eightShorts ? (useMaxBandwidth ? 17 - (samplingRate >> 13) // was 14, good for 22.05 - 32 kHz + const uint32_t maxSfbCurr = (eightShorts ? (useMaxBandwidth ? __min (15, 17 - (samplingRate >> 13) + (samplingRate >> 15)) : brModeAndFsToMaxSfbShort (m_bitRateMode, samplingRate)) : maxSfbLong); const bool keepMaxSfbCurr = ((samplingRate < 37566) || (samplingRate >= 46009 && samplingRate < 55426 && eightShorts)); const uint8_t numSwbFrame = __min ((numSwbCh * ((maxSfbCh == maxSfbCurr) || (m_bitRateMode <= 2) || (m_shiftValSBR > 0) ? 4u : 3u)) >> 2, - (eightShorts ? maxSfbCh : maxSfbLong) + (m_bitRateMode < 2 || m_bitRateMode > 3 || keepMaxSfbCurr ? 0u : 1u)); + maxSfbCurr + (m_bitRateMode < 2 || m_bitRateMode > 3 || keepMaxSfbCurr ? 0u : 1u)); if ((m_bitRateMode == 0) && (m_numElements == 1) && (samplingRate < 27713) && eightShorts) { @@ -994,8 +994,7 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s if (grpRms[s] < getThr (ch, sfbIdx)) grpData.scaleFactors[s + m_numSwbShort * gr] = 0; } } - else - if ((m_bitRateMode <= 4) && (meanSpecFlat[ci] <= (SCHAR_MAX >> 1))) // low-RMS + else if ((m_bitRateMode <= 4) && (meanSpecFlat[ci] <= (SCHAR_MAX >> 1))) // lo { for (s = __max (samplingRate < 27713 ? (samplingRate < 18783 ? 17 : 24) : 22, m_specGapFiller.getFirstGapFillSfb ()); s < maxSfbCh; s++) { @@ -1005,7 +1004,7 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s memset (&grpData.scaleFactors[maxSfbCh + m_numSwbShort * gr], 0, (numSwbFrame - maxSfbCh) * sizeof (uint8_t)); } - grpData.sfbsPerGroup = coreConfig.icsInfoCurr[ch].maxSfb = numSwbFrame; + grpData.sfbsPerGroup = coreConfig.icsInfoCurr[ch].maxSfb = __max (maxSfbCh, numSwbFrame); } if (ch > 0 && coreConfig.commonWindow) // resynchronize the two max_sfb for stereo { @@ -1023,7 +1022,7 @@ unsigned ExhaleEncoder::psychBitAllocation () // perceptual bit-allocation via s { for (s = 0; s < 26; s++) m_sfbLoudMem[ch][s][m_frameCount & 31] = BA_EPS; } -#endif // !RESTRICT_TO_AAC +#endif ci++; } // for ch @@ -1325,7 +1324,7 @@ unsigned ExhaleEncoder::quantizationCoding () // apply MDCT quantization and en } } // for el #if !RESTRICT_TO_AAC - if (m_priLength) m_rateFactor = samplingRate; + m_rateFactor = samplingRate; // for RC #endif return (errorValue > 0 ? 0 : m_outStream.createAudioFrame (m_elementData, m_entropyCoder, m_mdctSignals, m_mdctQuantMag, m_indepFlag, m_numElements, m_numSwbShort, (uint8_t* const) m_tempIntBuf, diff --git a/src/lib/exhaleLibPch.h b/src/lib/exhaleLibPch.h index a58ce04..2432af7 100644 --- a/src/lib/exhaleLibPch.h +++ b/src/lib/exhaleLibPch.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _EXHALE_LIB_PCH_H_ diff --git a/src/lib/lappedTransform.cpp b/src/lib/lappedTransform.cpp index 1400784..486f944 100644 --- a/src/lib/lappedTransform.cpp +++ b/src/lib/lappedTransform.cpp @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #include "exhaleLibPch.h" diff --git a/src/lib/lappedTransform.h b/src/lib/lappedTransform.h index 80b9325..b088461 100644 --- a/src/lib/lappedTransform.h +++ b/src/lib/lappedTransform.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _LAPPED_TRANSFORM_H_ diff --git a/src/lib/linearPrediction.cpp b/src/lib/linearPrediction.cpp index 2e40b25..a9b6f55 100644 --- a/src/lib/linearPrediction.cpp +++ b/src/lib/linearPrediction.cpp @@ -1,11 +1,11 @@ /* linearPrediction.cpp - source file for class providing linear prediction capability - * written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices + * written by C. R. Helmrich, last modified in 2021 - see License.htm for legal notices * * The copyright in this software is being made available under the exhale Copyright License * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #include "exhaleLibPch.h" @@ -417,5 +417,5 @@ bool LinearPredictor::similarParCorCoeffs (const short* const parCorCoeffs1, con sumAbsDiff += abs (parCorCoeffs1[s] - parCorCoeffs2[s]); } - return (sumAbsDiff < ((4u * (unsigned) nCoeffs) << (parCorCoeffBitDepth >> 1))); + return (sumAbsDiff + 12u * nCoeffs < ((4u * nCoeffs) << (parCorCoeffBitDepth >> 1))); } diff --git a/src/lib/linearPrediction.h b/src/lib/linearPrediction.h index 1344c2b..24714c9 100644 --- a/src/lib/linearPrediction.h +++ b/src/lib/linearPrediction.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _LINEAR_PREDICTION_H_ diff --git a/src/lib/makefile b/src/lib/makefile index 2e7c78a..364aaba 100644 --- a/src/lib/makefile +++ b/src/lib/makefile @@ -5,7 +5,7 @@ # and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- # party rights, including patent rights. No such rights are granted under this License. # - # Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + # Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. ## # define as source code library diff --git a/src/lib/quantization.cpp b/src/lib/quantization.cpp index a34b8a4..24f029d 100644 --- a/src/lib/quantization.cpp +++ b/src/lib/quantization.cpp @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #include "exhaleLibPch.h" diff --git a/src/lib/quantization.h b/src/lib/quantization.h index dc15a8f..fa1b123 100644 --- a/src/lib/quantization.h +++ b/src/lib/quantization.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _QUANTIZATION_H_ diff --git a/src/lib/specGapFilling.cpp b/src/lib/specGapFilling.cpp index 96077e9..8f17cc7 100644 --- a/src/lib/specGapFilling.cpp +++ b/src/lib/specGapFilling.cpp @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #include "exhaleLibPch.h" diff --git a/src/lib/specGapFilling.h b/src/lib/specGapFilling.h index ce2aa58..71a7d67 100644 --- a/src/lib/specGapFilling.h +++ b/src/lib/specGapFilling.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _SPEC_GAP_FILLING_H_ diff --git a/src/lib/stereoProcessing.cpp b/src/lib/stereoProcessing.cpp index cd10adc..0a58f26 100644 --- a/src/lib/stereoProcessing.cpp +++ b/src/lib/stereoProcessing.cpp @@ -10,6 +10,7 @@ #include "exhaleLibPch.h" #include "stereoProcessing.h" +#include "bitAllocation.h" // define BA_MORE_CBR (more constant bit-rate, experimental!) // static helper functions static inline uint64_t complexAbsMS (const int32_t realPart, const int32_t imagPart) @@ -363,7 +364,7 @@ unsigned StereoProcessor::applyPredJointStereo (int32_t* const mdctSpectrum1, in nonZeroPredCoef = true; } sfbTempVar *= sfbTempVar; // account for residual RMS reduction due to prediction -#if SP_MDST_PRED +#if SP_MDST_PRED && !(BA_MORE_CBR) if (bitRateMode > 0) sfbTempVar += alphaLimit * alphaLimit; // including alpha_im #endif for (b = sfbIsOdd; b >= 0; b--) diff --git a/src/lib/stereoProcessing.h b/src/lib/stereoProcessing.h index d60bbd4..b8efff2 100644 --- a/src/lib/stereoProcessing.h +++ b/src/lib/stereoProcessing.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _STEREO_PROCESSING_H_ diff --git a/src/lib/tempAnalysis.h b/src/lib/tempAnalysis.h index c9eabd1..73b1d78 100644 --- a/src/lib/tempAnalysis.h +++ b/src/lib/tempAnalysis.h @@ -5,7 +5,7 @@ * and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third- * party rights, including patent rights. No such rights are granted under this License. * - * Copyright (c) 2018-2020 Christian R. Helmrich, project ecodis. All rights reserved. + * Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved. */ #ifndef _TEMP_ANALYSIS_H_