AAC decoder: fix boost/attenuation defaults, loudness norm off
For MPEG-D DRC the default value of the boost and attenuation
factors is 127. For MPEG-4 DRC the default value is 0. In the
current DRC presentation mode wrapper, setting boost or attenuation
factor to 0 doesn't work for MPEG-DRC, use value -1 instead.
Fix Target Reference Level set to -1 as a valid value for disabling
loudness normalization.
Bug: 148385721
Test: atest DecoderTestXheAac DecoderTestAacDrc
Change-Id: I33479072c508b5700c0b35f389802dc17b2b4536
diff --git a/media/codec2/components/aac/DrcPresModeWrap.cpp b/media/codec2/components/aac/DrcPresModeWrap.cpp
index 5b9aebc..bee969b 100644
--- a/media/codec2/components/aac/DrcPresModeWrap.cpp
+++ b/media/codec2/components/aac/DrcPresModeWrap.cpp
@@ -47,10 +47,9 @@
mEncoderTarget = -1;
/* Values from last time. */
- /* Initialized to the same values as the desired values */
- mLastTarget = -1;
- mLastAttFactor = 0;
- mLastBoostFactor = 0;
+ mLastTarget = -2;
+ mLastAttFactor = -1;
+ mLastBoostFactor = -1;
mLastHeavy = 0;
}
@@ -163,7 +162,7 @@
if (mDataUpdate) {
// sanity check
- if (mDesTarget < MAX_TARGET_LEVEL){
+ if ((mDesTarget < MAX_TARGET_LEVEL) && (mDesTarget != -1)){
mDesTarget = MAX_TARGET_LEVEL; // limit target level to -10 dB or below
newTarget = MAX_TARGET_LEVEL;
}