1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-11 17:10:50 +01:00

1359 Commits

Author SHA1 Message Date
Martin Storsjo
143b2537d9 Add files missing from EXTRA_DIST 2021-04-28 15:33:56 +03:00
Martin Storsjo
9e8181c03b Specify the macOS compatibility version to make it a drop-in replacement for the libtool built 2021-04-28 15:33:55 +03:00
Martin Storsjo
b0789a3438 Don't use enums for values read directly from the bitstream
The enums don't cover all possible values read from the bitstream.

This fixes undefined behaviour sanitizer errors.

Fixes: 31011/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-4981228811976704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2021-04-23 16:09:58 +03:00
Staz M
5329a829a0 Made this compatible with cmake version 3.5.1 2021-04-07 14:51:50 +03:00
Martin Storsjo
0a90c09e00 Merge remote-tracking branch 'aosp/master' 2021-03-04 14:24:57 +02:00
Martin Storsjo
f8db6a7b79 Remove the separate nmakefile for MSVC
The CMake files should work equally well for MSVC nowadays.
2021-03-04 14:20:59 +02:00
Christian Budde
606547f4ad Fixed a typo in the documentation 2021-03-01 11:23:46 +02:00
Xin Li
6d10f91a77 Mark ab/7061308 as merged in stage.
Bug: 180401296
Merged-In: Id04d2590c249cad13da8dd8975d0a12ce96a9597
Change-Id: I4da99b78b01817308d8572d3c0d5b224b7d36a73
2021-02-20 00:24:02 -08:00
Bob Badour
7ad87e81d7 Merge "[LSC] Add LOCAL_LICENSE_KINDS to external/aac" am: 9f1be9d06f
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1588770

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I37a9304f439a0ed700126de649a37378d03ce6bc
2021-02-17 18:07:22 +00:00
Bob Badour
9f1be9d06f Merge "[LSC] Add LOCAL_LICENSE_KINDS to external/aac" 2021-02-17 17:32:45 +00:00
Treehugger Robot
b3ae2fd27f Merge "Fix improper assignment in aac_enc_fuzzer" am: dde78303e8
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1592151

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib28a2522296895dec1d6a5cc465a7427e19ab93a
2021-02-17 16:22:30 +00:00
Treehugger Robot
dde78303e8 Merge "Fix improper assignment in aac_enc_fuzzer" 2021-02-17 15:54:03 +00:00
Anuj Joshi
b50bd1751d Fix improper assignment in aac_enc_fuzzer
This commit updates the fuzzer to use correct value of
kSignalingModesSize and prevent OOB access on kSignalingModes

Test: ./aac_enc_fuzzer
Bug: 180220144

Change-Id: Ic9d01c5c166f2291d8d8ffacaa7813fb1560322b
2021-02-17 17:01:03 +05:30
Bob Badour
176eed73f1 [LSC] Add LOCAL_LICENSE_KINDS to external/aac
Added SPDX-license-identifier-Apache-2.0 to:
  fuzzer/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_by_exception_only to:
  Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I518bcad1cb91b80b2bcce1726f53aadf9afc749e
2021-02-14 10:37:21 -08:00
Treehugger Robot
118aad7689 Merge "aac_enc_fuzzer: Improve code coverage" am: fbed528d62
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1566866

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic9e8b3426ba251349474e101fa5038172de4ad70
2021-02-14 04:00:31 +00:00
Treehugger Robot
fbed528d62 Merge "aac_enc_fuzzer: Improve code coverage" 2021-02-14 03:24:05 +00:00
Martin Storsjo
6a2eb8b30f Avoid failing asserts on broken bitstreams
Fixes: 29712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5347313432264704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2021-02-04 14:05:43 +02:00
Anuj Joshi
d3c11e097b aac_enc_fuzzer: Improve code coverage
Test: ./aac_enc_fuzzer
Bug: 172429950

Change-Id: Id8c5c6351627ba09d6b0f8eeb81ad81003eba0c5
2021-02-01 10:30:22 +05:30
Cindy Zhou
2b3a48d3b7 Merge "aac remove diag" am: f13c7a4054
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1549588

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I228ca5c02b5284a17e96c2f09adc27848d364703
2021-01-20 23:40:09 +00:00
Cindy Zhou
f13c7a4054 Merge "aac remove diag" 2021-01-20 23:11:07 +00:00
evpobr
77ee4dd31e Add CMake project 2021-01-20 11:11:54 +02:00
Martin Storsjo
a52114dd69 Merge remote-tracking branch 'aosp/master' 2021-01-14 15:38:20 +02:00
Martin Storsjo
d75500444a Don't use enums for values read directly from the bitstream
The enums don't cover all possible values read from the bitstream.

This fixes undefined behaviour sanitizer errors.

Fixes: 27647/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5654559200116736
Fixes: 28193/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-4901213455515648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2021-01-14 15:36:03 +02:00
Rosen Penev
d284d42e71 fix compilation with mips16
Some users wrongly pass both -mips16 and -mdsp when compiling on MIPS
platforms. Handle such a case.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-01-14 14:56:46 +02:00
Cindy Zhou
5e70d8a295 aac remove diag
Removing diag mode since it's only required for debugging purposes.
Bug: 158010610
Test: n/a

Change-Id: I597880ef5b63d12d2971237d02406faceda7e623
2021-01-13 12:28:12 -08:00
Kris Alder
a85ab74b62 Merge "Added aac_enc_fuzzer" am: 093573a634
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1527719

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib3295eaed1814e256668526f4ea9c41743dd4431
2021-01-13 01:33:01 +00:00
Kris Alder
093573a634 Merge "Added aac_enc_fuzzer" 2021-01-13 01:03:20 +00:00
Cindy Zhou
738df3d018 Merge "Enable cfi for aac" am: 5690f9c39f
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1518238

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3b4ff4c9a2e1ccd1139a37ac2a537467efee9583
2021-01-08 18:17:46 +00:00
Cindy Zhou
5690f9c39f Merge "Enable cfi for aac" 2021-01-08 17:47:26 +00:00
Treehugger Robot
3152997588 Merge "Adjust VBR mode depending on given peak bitrate and fix crash recovery usage." am: 5d8224586c
Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1542709

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I676c98594c21af87992da5e4286d8c83f6a11098
2021-01-08 16:10:59 +00:00
Treehugger Robot
5d8224586c Merge "Adjust VBR mode depending on given peak bitrate and fix crash recovery usage." 2021-01-08 15:47:48 +00:00
Fraunhofer IIS FDK
e499f9485e Adjust VBR mode depending on given peak bitrate and fix crash recovery usage.
Operating the FDK encoder in A2DP with variable bitrate mode
configuration resulted in unexpected encoder return value AACENC_ENCODE_ERROR.

Due to peak bitrate restriction the encoder quite often runs into requantization.
In case the bitrate constraint is not fulfilled, the so-called crash recovery is
used as final emergency step. The crash recovery reduces the overall bit
consumption considering the given number of bits to be saved. The bit difference
is extracted from audio element structures. In VBR mode the element wise bit
consumption state was not updated since there is typically no bitrate limitation
required.

The patch solves the choppy audio problems and increases audio quality for
AAC VBR encoding.

The changes in FDKaacEnc_QCMain() ensure that audio element bit info is always
updated. This is achieved by always calling FDKaacEnc_BitResRedistribution()
and FDKaacEnc_prepareBitDistribution() with maxBitsPerFrame variable as total
bits parameter.
Furthermore, VBR assumes a certain target bitrate which is used for internal
configuration and limitations. In case the peak bitrate parameter is less than
the VBR mode target bitrate the maximum of both bitrate configurations was used.

The function FDKaacEnc_AdjustVBRBitrateMode() is added to adjust the encoder
internal VBR mode to a desired target bitrate less than given peak bitrate.
It is possible that the peak bitrate is very close to the desired target bitrate.
The virtual available bitreservoir is quite low and the encoder would run quite
often into requantization with needless audio quality reduction. In such a
configuration, it is a better choice to use the CBR targeted threshold adaption
to avoid audio quality reduction.

In FDKaacEnc_Initialize(), there was already a bitResMode selection depending
on available bitreservoir for CBR. This selection will now also be used for VBR.
In case the bitResMode is AACENC_BR_MODE_FULL and VBR mode is selected, the VBR
threshold adaption is used. Otherwise, CBR threshold adaption strategy is used
and therefore, no unnecessary fill bits are written.

Bug: 161400526
Test: see bug
Change-Id: I1865f817180150da6add2623a64f1a102622784a
2021-01-08 10:52:53 +08:00
Anuj Joshi
ec3d6d9f0e Added aac_enc_fuzzer
Test: ./aac_enc_fuzzer
Bug: 172429950

Change-Id: Ia84f85425f6df10b13a3d045472f7f684f27eb8a
2020-12-28 10:33:12 +05:30
Cindy Zhou
c93fff6784 Enable cfi for aac
Bug: 158010610
Bug: 173497308
Test: ran atest DecoderConformanceTest, ImageReaderDecoderTest,
VideoDecoderPerfTest, VideoEncoderTest.  Compare the
before and after enabling CFI results since there was a number of tests
that were initially failing.

Change-Id: I0d0d2a76512dc909a67f34adacff9ffbf536dbe7
2020-12-17 07:45:11 -08:00
Martin Storsjo
2e64f76d2e Don't use an enum for a value read directly from the bitstream
The enum doesn't cover all possible values read from the bitstream.

This fixes undefined behaviour sanitizer errors.

Fixes: 27624/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-6049277318791168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2020-11-30 12:55:07 +02:00
Xin Li
a5f0e4af6d Mark ab/6881855 as merged am: b831187d3a
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/aac/+/13112547

Change-Id: Id04d2590c249cad13da8dd8975d0a12ce96a9597
2020-11-24 00:10:16 +00:00
Xin Li
b831187d3a Mark ab/6881855 as merged
Bug: 172690556
Change-Id: I4edc064b9a87da525672e61919ec8fb59a70202e
2020-11-23 11:29:57 -08:00
Martin Storsjo
a0411159e8 Revert "Avoid a failed assert on invalid channel indices"
This reverts commit 9b0f848911068943bbadeb37c0b8857605e74093.

This local fix doesn't seem to be needed any more after the latest
upstream update.
2020-11-17 12:58:59 +02:00
Martin Storsjo
2b3e9ddc81 Revert "Don't use an enum for a value read directly from the bitstream"
This reverts commit 28fcbe9faed794a9d74aef529beb83386da1f4aa.

This local fix doesn't seem to be needed any more after the latest
upstream update.
2020-11-17 12:58:30 +02:00
Martin Storsjo
d9a9f3b793 Revert "Don't use an enum for a value read directly from the bitstream"
This reverts commit e7d8591ff208803eee35dc289e89a0d69b707585.

This local fix doesn't seem to be needed any more after the latest
upstream update.
2020-11-17 12:58:00 +02:00
Martin Storsjo
60a11ea3ef Revert "Don't use an enum for a value read directly from the bitstream"
This reverts commit 8439b745f65bce3fd55ffc9f9edcc04f5f447c55.

This local fix doesn't seem to be needed any more after the latest
upstream update.
2020-11-17 12:57:21 +02:00
Martin Storsjo
ea21799a7b Revert "Avoid undefined shifts in SATURATE_SHIFT"
This reverts commit 3a831a5fbc990c83e9b5b804a082bb158364e793.

This local fix doesn't seem to be needed any more after the latest
upstream update.
2020-11-17 12:56:58 +02:00
Martin Storsjo
559379e08b Update the version numbers in the public installed headers 2020-11-17 12:41:48 +02:00
Martin Storsjo
dc29bf5457 Remove references to sbr_crc.cpp that was removed upstream 2020-11-17 12:40:36 +02:00
Martin Storsjo
c7a3808a2f Merge remote-tracking branch 'aosp/master' 2020-11-17 12:38:51 +02:00
Martin Storsjo
d23a21ab42 Avoid undefined shifts in calculateSbrEnvelope
Fixes: 26845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5670674796118016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2020-11-17 12:26:19 +02:00
Martin Storsjo
4e944af756 Avoid undefined shifts in SBR calcCRC
Fixes: 25404/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5397024709804032

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2020-11-17 12:26:19 +02:00
Bill Yi
de35b0d3cc [automerger skipped] Merge "Merge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE" am: f4adff7fbb am: 0834f1a0b8 -s ours am: dd90d1595f -s ours
am skip reason: Change-Id I44e842648acbceb02bbc28cf2ad729a0caddf60d with SHA-1 1f2e0ecb62 is in history

Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1486978

Change-Id: I9d8f11842a7d222ff9eaf50be2e44f1507c4bb49
2020-11-05 04:21:11 +00:00
Bill Yi
700bc783fb [automerger skipped] Merge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE am: 5b4265a02a am: 8b4e287ff6 -s ours am: 51ff3aa199 -s ours
am skip reason: Change-Id I44e842648acbceb02bbc28cf2ad729a0caddf60d with SHA-1 1f2e0ecb62 is in history

Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1486978

Change-Id: Ifc66ac802e4e6eec723e5e762cf94f107f5f7ba6
2020-11-05 04:21:02 +00:00
Bill Yi
dd90d1595f [automerger skipped] Merge "Merge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE" am: f4adff7fbb am: 0834f1a0b8 -s ours
am skip reason: Change-Id I44e842648acbceb02bbc28cf2ad729a0caddf60d with SHA-1 1f2e0ecb62 is in history

Original change: https://android-review.googlesource.com/c/platform/external/aac/+/1486978

Change-Id: Ic6a0942fdd1af69a14653a456accfd76e9361bf1
2020-11-05 04:01:22 +00:00