aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc/src/aacenc_lib.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-01-08 16:25:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-01-08 16:25:06 +0000
commita108a6cafaa67ef58da0c33838077de086b9d532 (patch)
tree3907998d7ca9d6c2d05884d11a266df6351434c8 /libAACenc/src/aacenc_lib.cpp
parenta5f0e4af6d4c7d169ae52df33b2671321b163052 (diff)
parent31529975883fb1ccce9f4e5692f56eb403cf9e74 (diff)
downloadfdk-aac-a108a6cafaa67ef58da0c33838077de086b9d532.tar.gz
fdk-aac-a108a6cafaa67ef58da0c33838077de086b9d532.tar.bz2
fdk-aac-a108a6cafaa67ef58da0c33838077de086b9d532.zip
Merge "Adjust VBR mode depending on given peak bitrate and fix crash recovery usage." am: 5d8224586c am: 3152997588
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1542709 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Id89e1389e52aaf7ed338f7cf431ed5e9d1fba9f8
Diffstat (limited to 'libAACenc/src/aacenc_lib.cpp')
-rw-r--r--libAACenc/src/aacenc_lib.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index c3977f3..0ae329b 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -1028,6 +1028,13 @@ static AACENC_ERROR FDKaacEnc_AdjustEncSettings(HANDLE_AACENCODER hAacEncoder,
case AACENC_BR_MODE_VBR_3:
case AACENC_BR_MODE_VBR_4:
case AACENC_BR_MODE_VBR_5:
+ /* Adjust bitrate mode in case given peak bitrate is lower than expected
+ * VBR bitrate. */
+ if ((INT)config->userPeakBitrate != -1) {
+ hAacConfig->bitrateMode = FDKaacEnc_AdjustVBRBitrateMode(
+ hAacConfig->bitrateMode, config->userPeakBitrate,
+ hAacConfig->channelMode);
+ }
/* Get bitrate in VBR configuration */
/* In VBR mode; SBR-modul depends on bitrate, core encoder on bitrateMode.
*/