From d468889147ca54279ec29a705e31bd5491cab921 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Mon, 7 Mar 2022 14:26:02 -0800 Subject: [PATCH 01/26] Add license_note Comments not preserved during refresh. Bug: 68860345 Test: m nothing Change-Id: I46129df85a9242587621756be25d797bf90428d6 --- METADATA | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/METADATA b/METADATA index 5c12860..4dab5e4 100644 --- a/METADATA +++ b/METADATA @@ -1,3 +1,7 @@ +# *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE +# CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE +# DEPENDING ON IT IN YOUR PROJECT. *** third_party { + license_note: "Software License for The Fraunhofer FDK AAC Codec Library for Android" license_type: BY_EXCEPTION_ONLY } From eb07c22519d94e573f2a02947094acd2219dc07a Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 02/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 506aed3..3603a77 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From 6a3817573b089f01b13f4f3a195dda8a345d8fe0 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 03/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index ca35184..a4c0521 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From c650c88c62fce5a1027a0e30484164ac14e130d8 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 04/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 091d011..8cd9cb0 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From 2768a078f34a4d6cdb05916ad0e1f02d4c73fb6b Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 05/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 091d011..8cd9cb0 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From 067929dcd3467fd8e1383303efaff2cfc37224e9 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 06/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 091d011..8cd9cb0 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From b297bcbf2a2950cce6dad473f236949a0003769c Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 07/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index ca35184..a4c0521 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From 23ef1ac38c2dae4cd755880fc8f98491efd26027 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 5 Apr 2022 18:53:20 +0200 Subject: [PATCH 08/26] Reject invalid out of band config in transportDec_OutOfBandConfig() and skip re-allocation. Bug: 224314979 Bug: 221734266 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5461414938804224 Test: adb shell /data/fuzz/arm64/C2FuzzerAacDec/C2FuzzerAacDec /data/local/tmp/clusterfuzz-testcase-minimized-C2FuzzerAacDec-5062403589275648 Change-Id: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 Merged-In: I64e7fe1b258be2f59c6d39c0b7b699fa881d79e6 --- libMpegTPDec/src/tpdec_lib.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 091d011..8cd9cb0 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -351,6 +351,12 @@ TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, } } } + + /* if an error is detected terminate config parsing to avoid that an invalid + * config is accepted in the second pass */ + if (err != TRANSPORTDEC_OK) { + break; + } } if (err == TRANSPORTDEC_OK && fConfigFound) { From 3aabcb6abd1b32344370758aaae424735ca061a6 Mon Sep 17 00:00:00 2001 From: "haocheng.zy" Date: Fri, 13 May 2022 23:26:42 +0800 Subject: [PATCH 09/26] Add riscv64 support Signed-off-by: Zhang Ye Signed-off-by: Mao Han Change-Id: Ifc1c8801d885b0b4ac1bf91842830ab650780328 --- libFDK/include/FDK_archdef.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libFDK/include/FDK_archdef.h b/libFDK/include/FDK_archdef.h index 95601bb..3d0cddf 100644 --- a/libFDK/include/FDK_archdef.h +++ b/libFDK/include/FDK_archdef.h @@ -219,6 +219,13 @@ amm-info@iis.fraunhofer.de #define POW2COEFF_16BIT #define LDCOEFF_16BIT +#elif defined(__riscv) +#define ARCH_PREFER_MULT_32x16 +#define SINETABLE_16BIT +#define POW2COEFF_16BIT +#define LDCOEFF_16BIT +#define WINDOWTABLE_16BIT + #else #warning >>>> Please set architecture characterization defines for your platform (FDK_HIGH_PERFORMANCE)! <<<< From 2bb735c4fb21de64242fd8e87dfa7708dcbc2206 Mon Sep 17 00:00:00 2001 From: William Escande Date: Mon, 22 Aug 2022 11:27:53 -0700 Subject: [PATCH 10/26] [Bluetooth apex] Use new apex name The Bluetooth apex name is now called com.android.btservices Bug: 243054261 Test: Build Change-Id: I504a8727ddf73d3568616bc0f57983331dd28744 --- Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android.bp b/Android.bp index b5ebb72..6060256 100644 --- a/Android.bp +++ b/Android.bp @@ -94,7 +94,7 @@ cc_library_static { apex_available: [ "//apex_available:platform", - "com.android.bluetooth", + "com.android.btservices", "com.android.media.swcodec", ], min_sdk_version: "29", From 32c697660d9d4d525133322f9d061d42a43e1756 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 1 Nov 2013 12:06:46 +0200 Subject: [PATCH 11/26] Include the encoder library version in the publicly installed header This allows callers to conditionally use new API features without breaking compatibility with the earlier versions of the library. Bug: 261048742 Test: atest android.media.encoder.cts.EncoderTest Change-Id: Icdf18317e120caf8be750a839ae75a6ac8eba142 --- libAACenc/include/aacenc_lib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libAACenc/include/aacenc_lib.h b/libAACenc/include/aacenc_lib.h index f0f23b4..22c07c0 100644 --- a/libAACenc/include/aacenc_lib.h +++ b/libAACenc/include/aacenc_lib.h @@ -1005,6 +1005,10 @@ internally. #include "machine_type.h" #include "FDK_audio.h" +#define AACENCODER_LIB_VL0 3 +#define AACENCODER_LIB_VL1 4 +#define AACENCODER_LIB_VL2 12 + /** * AAC encoder error codes. */ From 7cb7d8c181837f437152a8edcfd3c0f9c6e3f68c Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 17 Nov 2020 12:41:48 +0200 Subject: [PATCH 12/26] Update the version numbers in the public installed headers Bug: 261048742 Test: atest android.media.encoder.cts.EncoderTest Change-Id: I44537c067e6ef34e77a67d02d8e9a8e9dfffab92 --- libAACdec/include/aacdecoder_lib.h | 4 ++++ libAACenc/include/aacenc_lib.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libAACdec/include/aacdecoder_lib.h b/libAACdec/include/aacdecoder_lib.h index d7928c0..02596b2 100644 --- a/libAACdec/include/aacdecoder_lib.h +++ b/libAACdec/include/aacdecoder_lib.h @@ -431,6 +431,10 @@ Where N equals to CStreamInfo::frameSize . #include "machine_type.h" #include "FDK_audio.h" +#define AACDECODER_LIB_VL0 3 +#define AACDECODER_LIB_VL1 2 +#define AACDECODER_LIB_VL2 0 + #include "genericStds.h" /** * \brief AAC decoder error codes. diff --git a/libAACenc/include/aacenc_lib.h b/libAACenc/include/aacenc_lib.h index 22c07c0..faf9bb1 100644 --- a/libAACenc/include/aacenc_lib.h +++ b/libAACenc/include/aacenc_lib.h @@ -1005,9 +1005,9 @@ internally. #include "machine_type.h" #include "FDK_audio.h" -#define AACENCODER_LIB_VL0 3 -#define AACENCODER_LIB_VL1 4 -#define AACENCODER_LIB_VL2 12 +#define AACENCODER_LIB_VL0 4 +#define AACENCODER_LIB_VL1 0 +#define AACENCODER_LIB_VL2 1 /** * AAC encoder error codes. From e575d5741da82f85ae18ce4231afe56a2d7b5071 Mon Sep 17 00:00:00 2001 From: Ayushi Khopkar Date: Thu, 2 Mar 2023 15:21:15 +0530 Subject: [PATCH 13/26] Updated fuzz_config in Android.bp file Added new fields in fuzz_config like - hotlists, description, vector, service_privilege, users, fuzzed_code_usage, etc. Bug: 271384401 Test: Build aac_dec_fuzzer and aac_enc_fuzzer Change-Id: I2637accffa42e37fc90e19b531ca5aef299b811e --- fuzzer/Android.bp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fuzzer/Android.bp b/fuzzer/Android.bp index 6739798..3ea7559 100644 --- a/fuzzer/Android.bp +++ b/fuzzer/Android.bp @@ -46,6 +46,14 @@ cc_defaults { "android-media-fuzzing-reports@google.com", ], componentid: 155276, + hotlists: [ + "4593311", + ], + description: "The fuzzer targets the APIs of libFraunhoferAAC", + vector: "remote", + service_privilege: "privileged", + users: "multi_user", + fuzzed_code_usage: "shipped", }, } From 477ac94c2d3f759396c41c0b152370637ef8df1a Mon Sep 17 00:00:00 2001 From: wujianxing1 Date: Mon, 3 Apr 2023 14:43:20 +0800 Subject: [PATCH 14/26] Correct comment spelling error. Change-Id: I2b0451986e70d0fbb7fefa5bbb95b1ca98e4f7ac Signed-off-by: wujianxing1 --- libAACenc/include/aacenc_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libAACenc/include/aacenc_lib.h b/libAACenc/include/aacenc_lib.h index f0f23b4..cb59287 100644 --- a/libAACenc/include/aacenc_lib.h +++ b/libAACenc/include/aacenc_lib.h @@ -1086,7 +1086,7 @@ typedef struct { write edit lists for gapless playback. The decoder may not know how much delay is introdcued by SBR, since it may not know if SBR is active at all (implicit signaling), - therefore the deocder must take into account any delay + therefore the decoder must take into account any delay caused by the SBR module. */ UCHAR confBuf[64]; /*!< Configuration buffer in binary format as an From 2f4c595c4abd721967ecb494f5aec3f6b6dafb9e Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Fri, 21 Apr 2023 17:14:34 -0700 Subject: [PATCH 15/26] Disable MPEG-D DRC for legacy AOTs Disable MPEG-D DRC metadata for legacy AOTs 2 (AAC-LC), 5 (HE-AAC), and 29 (HE-AAC v2). Bug: 241391733 Test: see bug Change-Id: Ie84badaa24bb4169adfdb1d3243525c32b44d3e9 --- libAACdec/src/aacdecoder.cpp | 39 +------------------------------- libAACdec/src/aacdecoder_lib.cpp | 4 ++-- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index d5f0cea..ee448c3 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -912,43 +912,6 @@ static AAC_DECODER_ERROR CAacDecoder_ExtPayloadParse( } *count -= readBits; } break; - case EXT_UNI_DRC: { - DRC_DEC_ERROR drcErr = DRC_DEC_OK; - DRC_DEC_CODEC_MODE drcDecCodecMode = DRC_DEC_CODEC_MODE_UNDEFINED; - INT nBitsRemaining = FDKgetValidBits(hBs); - INT readBits; - - switch (self->streamInfo.aot) { - case AOT_AAC_LC: - case AOT_SBR: - case AOT_PS: - drcDecCodecMode = DRC_DEC_MPEG_4_AAC; - break; - default: - error = AAC_DEC_PARSE_ERROR; - goto bail; - } - - drcErr = FDK_drcDec_SetCodecMode(self->hUniDrcDecoder, drcDecCodecMode); - if (drcErr) { - error = AAC_DEC_PARSE_ERROR; - goto bail; - } - - drcErr = FDK_drcDec_ReadUniDrc(self->hUniDrcDecoder, hBs); - if (drcErr) { - error = AAC_DEC_PARSE_ERROR; - goto bail; - } - readBits = (INT)nBitsRemaining - (INT)FDKgetValidBits(hBs); - if (readBits > *count) { /* Read too much. Something went wrong! */ - error = AAC_DEC_PARSE_ERROR; - } - *count -= readBits; - /* Skip any trailing bits */ - FDKpushFor(hBs, *count); - *count = 0; - } break; case EXT_LDSAC_DATA: case EXT_SAC_DATA: /* Read MPEG Surround Extension payload */ diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index 0c83191..c74ec1a 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -1681,7 +1681,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, { if ((FDK_drcDec_GetParam(self->hUniDrcDecoder, DRC_DEC_IS_ACTIVE)) && - !(self->flags[0] & AC_RSV603DA)) { + (self->flags[0] & AC_USAC)) { /* Apply DRC gains*/ int ch, drcDelay = 0; int needsDeinterleaving = 0; From 4c41b05b6c60275c2a6b28918f40c218a8b818f6 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Fri, 21 Apr 2023 16:06:29 +0200 Subject: [PATCH 16/26] Remove obsolete uni drc precedence handling Bug: 241391733 Test: see bug Change-Id: I0ddc479626fb6a89d04bc989256ad1d8ec4275a3 --- libAACdec/src/aacdec_drc.cpp | 10 +--------- libAACdec/src/aacdec_drc.h | 5 ++--- libAACdec/src/aacdec_drc_types.h | 7 +------ libAACdec/src/aacdecoder.cpp | 6 ------ libAACdec/src/aacdecoder_lib.cpp | 31 +++++++------------------------ 5 files changed, 11 insertions(+), 48 deletions(-) diff --git a/libAACdec/src/aacdec_drc.cpp b/libAACdec/src/aacdec_drc.cpp index 760a9ba..abb9af7 100644 --- a/libAACdec/src/aacdec_drc.cpp +++ b/libAACdec/src/aacdec_drc.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -217,7 +217,6 @@ void aacDecoder_drcInit(HANDLE_AAC_DRC self) { self->progRefLevel = pParams->targetRefLevel; self->progRefLevelPresent = 0; self->presMode = -1; - self->uniDrcPrecedence = 0; aacDecoder_drcReset(self); } @@ -353,12 +352,6 @@ AAC_DECODER_ERROR aacDecoder_drcSetParam(HANDLE_AAC_DRC self, self->numOutChannels = (INT)value; self->update = 1; break; - case UNIDRC_PRECEDENCE: - if (self == NULL) { - return AAC_DEC_INVALID_HANDLE; - } - self->uniDrcPrecedence = (UCHAR)value; - break; default: return AAC_DEC_SET_PARAM_FAIL; } /* switch(param) */ @@ -1258,7 +1251,6 @@ static void aacDecoder_drcParameterHandling(HANDLE_AAC_DRC self, /* switch on/off processing */ self->enable = ((p->boost > (FIXP_DBL)0) || (p->cut > (FIXP_DBL)0) || (p->applyHeavyCompression == ON) || (p->targetRefLevel >= 0)); - self->enable = (self->enable && !self->uniDrcPrecedence); self->prevAacNumChannels = aacNumChannels; self->update = 0; diff --git a/libAACdec/src/aacdec_drc.h b/libAACdec/src/aacdec_drc.h index 2bb945d..f2c1390 100644 --- a/libAACdec/src/aacdec_drc.h +++ b/libAACdec/src/aacdec_drc.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -133,8 +133,7 @@ typedef enum { APPLY_HEAVY_COMPRESSION, DEFAULT_PRESENTATION_MODE, ENCODER_TARGET_LEVEL, - MAX_OUTPUT_CHANNELS, - UNIDRC_PRECEDENCE + MAX_OUTPUT_CHANNELS } AACDEC_DRC_PARAM; /** diff --git a/libAACdec/src/aacdec_drc_types.h b/libAACdec/src/aacdec_drc_types.h index d4393f7..c4c0794 100644 --- a/libAACdec/src/aacdec_drc_types.h +++ b/libAACdec/src/aacdec_drc_types.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,11 +207,6 @@ typedef struct { position in the bitstream (only one per frame) */ UINT drcPayloadPosition[MAX_DRC_THREADS]; /* Used to store the DRC payload positions in the bitstream */ - - UCHAR - uniDrcPrecedence; /* Flag for signalling that uniDrc is active and takes - precedence over legacy DRC */ - UCHAR applyExtGain; /* Flag is 1 if extGain has to be applied, otherwise 0. */ FIXP_DBL additionalGainPrev; /* Gain of previous frame to be applied to the diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index ee448c3..ad8ce0d 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -3273,12 +3273,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( FDKmemcpy(drcChMap, self->chMapping, (8) * sizeof(UCHAR)); } - /* deactivate legacy DRC in case uniDrc is active, i.e. uniDrc payload is - * present and one of DRC or Loudness Normalization is switched on */ - aacDecoder_drcSetParam( - self->hDrcInfo, UNIDRC_PRECEDENCE, - FDK_drcDec_GetParam(self->hUniDrcDecoder, DRC_DEC_IS_ACTIVE)); - /* Extract DRC control data and map it to channels (without bitstream delay) */ mapped = aacDecoder_drcProlog( diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index c74ec1a..ef0515c 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -1689,8 +1689,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, FIXP_DBL channelGain[(8)]; int reverseInChannelMap[(8)]; int reverseOutChannelMap[(8)]; - int numDrcOutChannels = FDK_drcDec_GetParam( - self->hUniDrcDecoder, DRC_DEC_TARGET_CHANNEL_COUNT_SELECTED); FDKmemclear(channelGain, sizeof(channelGain)); for (ch = 0; ch < (8); ch++) { reverseInChannelMap[ch] = ch; @@ -1713,17 +1711,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, drcDelay += CConcealment_GetDelay(&self->concealCommonData) * self->streamInfo.frameSize; - for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - UCHAR mapValue = FDK_chMapDescr_getMapValue( - &self->mapDescr, (UCHAR)ch, self->chMapIndex); - if (mapValue < (8)) reverseInChannelMap[mapValue] = ch; - } - for (ch = 0; ch < (int)numDrcOutChannels; ch++) { - UCHAR mapValue = FDK_chMapDescr_getMapValue( - &self->mapDescr, (UCHAR)ch, numDrcOutChannels); - if (mapValue < (8)) reverseOutChannelMap[mapValue] = ch; - } - /* The output of SBR and MPS is interleaved. Deinterleaving may be * necessary for FDK_drcDec_ProcessTime, which accepts deinterleaved * audio only. */ @@ -1758,11 +1745,9 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, FDK_drcDec_Preprocess(self->hUniDrcDecoder); /* apply DRC1 gain sequence */ - for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, DRC_DEC_DRC1, - ch, reverseInChannelMap[ch] - ch, 1, - drcWorkBuffer, self->streamInfo.frameSize); - } + FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, DRC_DEC_DRC1, + 0, 0, self->streamInfo.numChannels, + drcWorkBuffer, self->streamInfo.frameSize); /* apply downmix */ FDK_drcDec_ApplyDownmix( self->hUniDrcDecoder, reverseInChannelMap, reverseOutChannelMap, @@ -1770,12 +1755,10 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, &self->streamInfo.numChannels); /* self->streamInfo.numChannels may change here */ /* apply DRC2/3 gain sequence */ - for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, - DRC_DEC_DRC2_DRC3, ch, - reverseOutChannelMap[ch] - ch, 1, - drcWorkBuffer, self->streamInfo.frameSize); - } + FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, + DRC_DEC_DRC2_DRC3, 0, 0, + self->streamInfo.numChannels, drcWorkBuffer, + self->streamInfo.frameSize); if (needsDeinterleaving) { FDK_interleave( From 167dcc380a53c0eb69cdfae97d0ba0fdc5af398d Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 25 Apr 2023 17:04:25 +0000 Subject: [PATCH 17/26] Remove obsolete uni drc precedence handling Bug: 241391733 Test: see bug (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4c41b05b6c60275c2a6b28918f40c218a8b818f6) Merged-In: I0ddc479626fb6a89d04bc989256ad1d8ec4275a3 Change-Id: I0ddc479626fb6a89d04bc989256ad1d8ec4275a3 --- libAACdec/src/aacdec_drc.cpp | 10 +--------- libAACdec/src/aacdec_drc.h | 5 ++--- libAACdec/src/aacdec_drc_types.h | 7 +------ libAACdec/src/aacdecoder.cpp | 6 ------ libAACdec/src/aacdecoder_lib.cpp | 31 +++++++------------------------ 5 files changed, 11 insertions(+), 48 deletions(-) diff --git a/libAACdec/src/aacdec_drc.cpp b/libAACdec/src/aacdec_drc.cpp index 760a9ba..abb9af7 100644 --- a/libAACdec/src/aacdec_drc.cpp +++ b/libAACdec/src/aacdec_drc.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -217,7 +217,6 @@ void aacDecoder_drcInit(HANDLE_AAC_DRC self) { self->progRefLevel = pParams->targetRefLevel; self->progRefLevelPresent = 0; self->presMode = -1; - self->uniDrcPrecedence = 0; aacDecoder_drcReset(self); } @@ -353,12 +352,6 @@ AAC_DECODER_ERROR aacDecoder_drcSetParam(HANDLE_AAC_DRC self, self->numOutChannels = (INT)value; self->update = 1; break; - case UNIDRC_PRECEDENCE: - if (self == NULL) { - return AAC_DEC_INVALID_HANDLE; - } - self->uniDrcPrecedence = (UCHAR)value; - break; default: return AAC_DEC_SET_PARAM_FAIL; } /* switch(param) */ @@ -1258,7 +1251,6 @@ static void aacDecoder_drcParameterHandling(HANDLE_AAC_DRC self, /* switch on/off processing */ self->enable = ((p->boost > (FIXP_DBL)0) || (p->cut > (FIXP_DBL)0) || (p->applyHeavyCompression == ON) || (p->targetRefLevel >= 0)); - self->enable = (self->enable && !self->uniDrcPrecedence); self->prevAacNumChannels = aacNumChannels; self->update = 0; diff --git a/libAACdec/src/aacdec_drc.h b/libAACdec/src/aacdec_drc.h index 2bb945d..f2c1390 100644 --- a/libAACdec/src/aacdec_drc.h +++ b/libAACdec/src/aacdec_drc.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -133,8 +133,7 @@ typedef enum { APPLY_HEAVY_COMPRESSION, DEFAULT_PRESENTATION_MODE, ENCODER_TARGET_LEVEL, - MAX_OUTPUT_CHANNELS, - UNIDRC_PRECEDENCE + MAX_OUTPUT_CHANNELS } AACDEC_DRC_PARAM; /** diff --git a/libAACdec/src/aacdec_drc_types.h b/libAACdec/src/aacdec_drc_types.h index d4393f7..c4c0794 100644 --- a/libAACdec/src/aacdec_drc_types.h +++ b/libAACdec/src/aacdec_drc_types.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,11 +207,6 @@ typedef struct { position in the bitstream (only one per frame) */ UINT drcPayloadPosition[MAX_DRC_THREADS]; /* Used to store the DRC payload positions in the bitstream */ - - UCHAR - uniDrcPrecedence; /* Flag for signalling that uniDrc is active and takes - precedence over legacy DRC */ - UCHAR applyExtGain; /* Flag is 1 if extGain has to be applied, otherwise 0. */ FIXP_DBL additionalGainPrev; /* Gain of previous frame to be applied to the diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index d5f0cea..ab8dc79 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -3310,12 +3310,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( FDKmemcpy(drcChMap, self->chMapping, (8) * sizeof(UCHAR)); } - /* deactivate legacy DRC in case uniDrc is active, i.e. uniDrc payload is - * present and one of DRC or Loudness Normalization is switched on */ - aacDecoder_drcSetParam( - self->hDrcInfo, UNIDRC_PRECEDENCE, - FDK_drcDec_GetParam(self->hUniDrcDecoder, DRC_DEC_IS_ACTIVE)); - /* Extract DRC control data and map it to channels (without bitstream delay) */ mapped = aacDecoder_drcProlog( diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index 0c83191..af29366 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -1689,8 +1689,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, FIXP_DBL channelGain[(8)]; int reverseInChannelMap[(8)]; int reverseOutChannelMap[(8)]; - int numDrcOutChannels = FDK_drcDec_GetParam( - self->hUniDrcDecoder, DRC_DEC_TARGET_CHANNEL_COUNT_SELECTED); FDKmemclear(channelGain, sizeof(channelGain)); for (ch = 0; ch < (8); ch++) { reverseInChannelMap[ch] = ch; @@ -1713,17 +1711,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, drcDelay += CConcealment_GetDelay(&self->concealCommonData) * self->streamInfo.frameSize; - for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - UCHAR mapValue = FDK_chMapDescr_getMapValue( - &self->mapDescr, (UCHAR)ch, self->chMapIndex); - if (mapValue < (8)) reverseInChannelMap[mapValue] = ch; - } - for (ch = 0; ch < (int)numDrcOutChannels; ch++) { - UCHAR mapValue = FDK_chMapDescr_getMapValue( - &self->mapDescr, (UCHAR)ch, numDrcOutChannels); - if (mapValue < (8)) reverseOutChannelMap[mapValue] = ch; - } - /* The output of SBR and MPS is interleaved. Deinterleaving may be * necessary for FDK_drcDec_ProcessTime, which accepts deinterleaved * audio only. */ @@ -1758,11 +1745,9 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, FDK_drcDec_Preprocess(self->hUniDrcDecoder); /* apply DRC1 gain sequence */ - for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, DRC_DEC_DRC1, - ch, reverseInChannelMap[ch] - ch, 1, - drcWorkBuffer, self->streamInfo.frameSize); - } + FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, DRC_DEC_DRC1, + 0, 0, self->streamInfo.numChannels, + drcWorkBuffer, self->streamInfo.frameSize); /* apply downmix */ FDK_drcDec_ApplyDownmix( self->hUniDrcDecoder, reverseInChannelMap, reverseOutChannelMap, @@ -1770,12 +1755,10 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, &self->streamInfo.numChannels); /* self->streamInfo.numChannels may change here */ /* apply DRC2/3 gain sequence */ - for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, - DRC_DEC_DRC2_DRC3, ch, - reverseOutChannelMap[ch] - ch, 1, - drcWorkBuffer, self->streamInfo.frameSize); - } + FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, + DRC_DEC_DRC2_DRC3, 0, 0, + self->streamInfo.numChannels, drcWorkBuffer, + self->streamInfo.frameSize); if (needsDeinterleaving) { FDK_interleave( From b5b590367af9043aaf5e13b0d573aa7261945880 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 25 Apr 2023 17:09:22 +0000 Subject: [PATCH 18/26] Disable MPEG-D DRC for legacy AOTs Disable MPEG-D DRC metadata for legacy AOTs 2 (AAC-LC), 5 (HE-AAC), and 29 (HE-AAC v2). Bug: 241391733 Test: see bug (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2f4c595c4abd721967ecb494f5aec3f6b6dafb9e) Merged-In: Ie84badaa24bb4169adfdb1d3243525c32b44d3e9 Change-Id: Ie84badaa24bb4169adfdb1d3243525c32b44d3e9 --- libAACdec/src/aacdecoder.cpp | 39 +------------------------------- libAACdec/src/aacdecoder_lib.cpp | 4 ++-- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index d5f0cea..ee448c3 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -912,43 +912,6 @@ static AAC_DECODER_ERROR CAacDecoder_ExtPayloadParse( } *count -= readBits; } break; - case EXT_UNI_DRC: { - DRC_DEC_ERROR drcErr = DRC_DEC_OK; - DRC_DEC_CODEC_MODE drcDecCodecMode = DRC_DEC_CODEC_MODE_UNDEFINED; - INT nBitsRemaining = FDKgetValidBits(hBs); - INT readBits; - - switch (self->streamInfo.aot) { - case AOT_AAC_LC: - case AOT_SBR: - case AOT_PS: - drcDecCodecMode = DRC_DEC_MPEG_4_AAC; - break; - default: - error = AAC_DEC_PARSE_ERROR; - goto bail; - } - - drcErr = FDK_drcDec_SetCodecMode(self->hUniDrcDecoder, drcDecCodecMode); - if (drcErr) { - error = AAC_DEC_PARSE_ERROR; - goto bail; - } - - drcErr = FDK_drcDec_ReadUniDrc(self->hUniDrcDecoder, hBs); - if (drcErr) { - error = AAC_DEC_PARSE_ERROR; - goto bail; - } - readBits = (INT)nBitsRemaining - (INT)FDKgetValidBits(hBs); - if (readBits > *count) { /* Read too much. Something went wrong! */ - error = AAC_DEC_PARSE_ERROR; - } - *count -= readBits; - /* Skip any trailing bits */ - FDKpushFor(hBs, *count); - *count = 0; - } break; case EXT_LDSAC_DATA: case EXT_SAC_DATA: /* Read MPEG Surround Extension payload */ diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index 0c83191..c74ec1a 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -1681,7 +1681,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self, { if ((FDK_drcDec_GetParam(self->hUniDrcDecoder, DRC_DEC_IS_ACTIVE)) && - !(self->flags[0] & AC_RSV603DA)) { + (self->flags[0] & AC_USAC)) { /* Apply DRC gains*/ int ch, drcDelay = 0; int needsDeinterleaving = 0; From 0c4954dd87acd1896976f626fd5c5650b87f1346 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 19/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From 451762ca48e7fb30a0ce77a8962813a3419ec420 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 20/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From 46c53ba0cb6ac4c0fb22b6527832be5b8c5e766b Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 21/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From 173576b2b39083c425f0ca37382a047b6ca3b524 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 22/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From 35a37fd6edda4c966e7072d1f1de060fb74c9694 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 23/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From cd6f2198617dcfbdeeb08e2cb2d36046659291c7 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 24/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From 2f8c08a4e7b228a55e4c89f0931069de8eda2df6 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 25/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream From cf141c714f177a526aff9e8a48efc3b2953b9a00 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Tue, 30 May 2023 16:39:32 +0200 Subject: [PATCH 26/26] Increase patchParam array size by one and fix out-of-bounce write in resetLppTransposer(). Bug: 279766766 Test: see POC Change-Id: I206973e0bb21140865efffd930e39f920f477359 Merged-In: I206973e0bb21140865efffd930e39f920f477359 (cherry picked from commit f682b8787eb312b9f8997dac4c2c18bb779cf0df) --- libSBRdec/src/lpp_tran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libSBRdec/src/lpp_tran.h b/libSBRdec/src/lpp_tran.h index 51b4395..21c4101 100644 --- a/libSBRdec/src/lpp_tran.h +++ b/libSBRdec/src/lpp_tran.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2023 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -207,7 +207,7 @@ typedef struct { inverse filtering levels */ PATCH_PARAM - patchParam[MAX_NUM_PATCHES]; /*!< new parameter set for patching */ + patchParam[MAX_NUM_PATCHES + 1]; /*!< new parameter set for patching */ WHITENING_FACTORS whFactors; /*!< the pole moving factors for certain whitening levels as indicated in the bitstream