SBR bit allocation

This commit is contained in:
Christian R. Helmrich
2020-11-20 22:00:00 +01:00
parent 6fe06fa78b
commit 5373500b9c
8 changed files with 148 additions and 105 deletions

View File

@ -418,7 +418,7 @@ unsigned BitAllocator::imprSfbStepSizes (const SfbGroupData* const groupData[USA
const unsigned firstChannelIndex, const uint8_t* const sfm, const bool commonWindow,
const uint8_t* const sfbStereoData /*= nullptr*/, const uint8_t stereoConfig /*= 0*/)
{
const uint8_t maxSfbL16k = 16 + __min (35, (9 << 17) / __max (1, samplingRate)); // SFB index at 15.8 kHz
const uint8_t maxSfbL16k = 16 + __min (4 + (samplingRate >> 10), (9 << 17) / __max (1, samplingRate)); // SFB index at 15.8 kHz
const uint32_t redFactor = __max ((samplingRate < 27713 ? 2 : 1), __min (3, m_rateIndex)) - (stereoConfig >> 3);
const uint32_t redWeight = __min (4, 9 - __min (9, m_rateIndex));
short* const tempCoeffs = (short* const) m_tempSfbValue;