Commit Graph

18 Commits

Author SHA1 Message Date
Jean-Michel Trivi 203e3f28fb AAC/SBR decoder improvements and bugfixes
* AAC-Decoder

   - Add support for AOT 20 (ER-AAC scalable) (base layer only)
   - Add support for AAC as used in Digital Radio Mondiale (DRM30/DRM+)
     Modified file(s):
        libAACdec/src/aacdecoder.cpp
        libAACdec/src/aacdecoder_lib.cpp
        libFDK/src/FDK_core.cpp
        libFDK/src/FDK_tools_rom.cpp
        libMpegTPDec/src/tpdec_asc.cpp
        libMpegTPDec/src/tpdec_lib.cpp
        libMpegTPDec/src/version
        libSBRdec/include/sbrdecoder.h
        libSBRdec/src/env_extr.h
        libSBRdec/src/sbrdecoder.cpp
     Added file(s):
        libMpegTPDec/src/tpdec_drm.cpp
        libMpegTPDec/src/tpdec_drm.h

   - Fix sanity check in HCR module that was performed at the wrong point in time.
     Modified file(s):
        libAACdec/src/aacdecoder_lib.cpp
        libAACdec/src/block.cpp

   - Extend core sampling rate support up to 96 kHz.
     Modified file(s):
        libAACdec/src/aac_rom.cpp
        libAACdec/src/aacdecoder.cpp
        libAACdec/src/aacdecoder_lib.cpp

   - Return correct audio output channel description according number of output
     channels.
     Modified file(s):
        libAACdec/src/aacdecoder_lib.cpp

   - Indroduce decoder intern output buffer. This change allows to use framework
     output buffer with the actual size of the deocder output channels.
     Modified file(s):
        libAACdec/include/aacdecoder_lib.h
        libAACdec/src/aacdecoder.h
        libAACdec/src/aacdecoder_lib.cpp

* SBR-Decoder

   - Increase robustness for erroneous input data.
   - Improve error concealment performance.
   - Fix handling of lowest sub-band for LD-SBR
     Modified file(s):
        libAACdec/src/aacdecoder.cpp
        libAACdec/src/aacdecoder_lib.cpp
        libSBRdec/src/env_calc.cpp
        libSBRdec/src/env_dec.cpp
        libSBRdec/src/env_extr.cpp
        libSBRdec/src/env_extr.h
        libSBRdec/src/sbr_dec.cpp
        libSBRdec/src/sbr_rom.cpp
        libSBRdec/src/sbr_rom.h
        libSBRdec/src/sbrdecoder.cpp

   - Add QMF delay compensation for ELD v2 streams decoded with the complex
     low delay filter-bank.
     Modified file(s):
        libSBRdec/src/sbr_dec.cpp
        libSBRdec/src/sbr_dec.h
        libSBRdec/src/sbrdecoder.cpp

   - Introduce a different handling of frames to be flushed
     dependent on whether there are delayed frames available or not.
     Modified file(s):
        libSBRdec/src/sbr_ram.h
        libSBRdec/src/sbrdecoder.cpp

   - Calculate the correct number of samples for dual-mono copy in case of no
     available PS data.
     Modified file(s):
        libSBRdec/src/sbrdecoder.cpp

* SYS-Library

   - Change include order of genericStds.h to prevent conflict with definitions
     which are also used in math.h.
     Modified file(s):
        libSYS/src/genericStds.cpp

Change-Id: I3ecffbad85f39b056213107955cfadbeb3f4b6e1
2016-04-08 19:10:30 +00:00
Jean-Michel Trivi e1c78ed73f SBR/AAC encoder updates, code clean up
* SBR-Encoder

   - Prevent noise level overflow in noise floor detection.
   - Saturate threshold calculation in transient detection.
     Modified file(s):
        libSBRenc/src/nf_est.cpp
        libSBRenc/src/sbr_encoder.cpp
        libSBRenc/src/tran_det.cpp

* AAC-Encoder

   - Expand input data range of GetInvInt() function. There was an encoder
     assert observed in non-default bitrate configuration.
     Modified file(s):
        libAACenc/src/aacenc_lib.cpp
        libAACenc/src/intensity.cpp
        libFDK/include/fixpoint_math.h
        libFDK/src/FDK_core.cpp
        libFDK/src/FDK_tools_rom.cpp

   - Make sure that the encoder is stable with regard to very low audio bandwidth
     confguration parameter value.
   - Fix lowdelay blending for low audio bandwidth.
     Modified file(s):
        libAACenc/src/aacenc.cpp
        libAACenc/src/aacenc_lib.cpp
        libAACenc/src/adj_thr.cpp
        libAACenc/src/psy_configuration.cpp
        libAACenc/src/psy_main.cpp

   - Disable pseudo surround flag in case metadata matrix mixdown index is
     present in program config element.
     Modified file(s):
        libAACenc/src/aacenc_lib.cpp

   - Enable variable bitrate mode in encoder api.
   - Add AACENC_PEAK_BITRATE parameter to encoder api.
   - Add AACENC_AUDIOMUXVER parameter to encoder api.
     Modified file(s):
        libAACenc/include/aacenc_lib.h
        libAACenc/src/aacenc.cpp
        libAACenc/src/aacenc.h
        libAACenc/src/aacenc_lib.cpp
        libAACenc/src/qc_main.cpp
        libMpegTPEnc/src/tpenc_latm.cpp
        libMpegTPEnc/src/version

* FDK-Sources

   - Code clean up. Remove unneeded pseudo audio object types and transport types.
     Modified file(s):
        libAACdec/src/aacdecoder.cpp
        libAACdec/src/aacdecoder_lib.cpp
        libAACenc/include/aacenc_lib.h
        libAACenc/src/aacenc.cpp
        libAACenc/src/aacenc_lib.cpp
        libFDK/src/FDK_tools_rom.cpp
        libMpegTPDec/src/tpdec_lib.cpp
        libMpegTPDec/src/version
        libMpegTPEnc/src/tpenc_latm.cpp
        libMpegTPEnc/src/version
        libSBRdec/src/sbrdecoder.cpp
        libSBRenc/src/sbr_encoder.cpp
        libSYS/include/FDK_audio.h
        libSYS/src/genericStds.cpp

Change-Id: I807a53cb7f48c9ee7563cb8da1d0c52221576ca6
2016-04-04 17:25:36 -07:00
Dan Willemsen 6e8330732f Remove __DATE__/__TIME__
Building __DATE__/__TIME__ into the binaries means that every build will
create different binaries, even if all the sources are identical. This
also means that any libraries including this one will need to be patched
during every OTA.

Nothing appears to use the build_date/build_time fields, so just replace
them with empty strings.

Bug: 24204119
Change-Id: I9543eb388a1e8ab9284df9035a62fc8942cdc082
2015-10-23 09:48:27 -07:00
Chih-Hung Hsieh 09f1d04467 Do not include genericStds_linux.cpp.
The __aeabi_memcpy functions are already defined in Android libc.
Redefining them to call memcpy will become recursive when clang/llvm
converts the memcpy call to __aeabi_memcpy.
With this change, we can enable clang/llvm by removing LOCAL_CLANG from Android.mk.

BUG: 12216385
Change-Id: I8b8b4ba7f3ff1e66f8110fc3b6356865a582c1d8
2015-02-12 11:20:14 -08:00
Jean-Michel Trivi 6792cf6361 AAC-Decoder: SBR delay for gapless
Revise decoder output delay determination. The output delay consisted of
  concealment and limiter delay. SBR delay was not covered but must be
  considered for gapless playback delay compensation.

Bug 9428126

Change-Id: I67483712c284de9b5378694f9db7acbed2547dd7
2014-05-20 17:39:03 -07:00
Glenn Kasten fb2e845179 am 35f30c5a: Merge "AArch64: Make LONG 4 bytes"
* commit '35f30c5ab8089f38681d2fdd416c00aebef5a7ff':
  AArch64: Make LONG 4 bytes
2014-04-09 15:57:48 +00:00
Marcus Oakland f2f96fb86d AArch64: Make LONG 4 bytes
The libSYS/include/machine_type.h header file states LONG should be
"Data type representing 4 byte signed integer on all supported
platforms" but only provided for defining LONG as INT and ULONG as
UINT when __x86_64__ was defined. This has been changed to when
__LP64__ is defined, so that it also applies to AArch64. The change
to libFDK/include/common_fix.h is then needed to get the project to
compile.

Change-Id: Iea42d7eca97dcc9da772a05b207d134cb999a72a
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2014-03-11 12:01:00 +00:00
Jean-Michel Trivi 47c680c622 AAC Decoder: support 6.1/7.1 decoded as 5.1
- Add 6.1 and 7.1 channel support including downmixer. Per default the
     decoder creates a 5.1 channel output for all streams with more than six
     encoded channels.
     Modified file(s):
        libPCMutils/include/pcmutils_lib.h
        libPCMutils/src/pcmutils_lib.cpp
        libAACdec/include/aacdecoder_lib.h
        libAACdec/src/aac_rom.h
        libAACdec/src/aacdecoder.cpp
        libAACdec/src/aac_ram.cpp
        libAACdec/src/aacdec_drc.cpp
        libAACdec/src/aacdecoder_lib.cpp
        libAACdec/src/aac_rom.cpp
        libAACdec/src/aacdecoder.h
        libSBRdec/include/sbrdecoder.h
        libSBRdec/src/sbrdec_drc.h
        libSBRdec/src/sbrdecoder.cpp
        libSBRdec/src/sbr_ram.cpp
        libSBRdec/src/sbr_ram.h
        libMpegTPDec/include/tp_data.h
        libMpegTPDec/include/tpdec_lib.h
        libMpegTPDec/src/version
        libMpegTPDec/src/tpdec_asc.cpp
        libMpegTPEnc/include/tp_data.h
        libMpegTPEnc/src/version
        libSYS/include/FDK_audio.h
        libSYS/src/genericStds.cpp

   - Fix error concealment modules fade-out/in mechanism.
     Modified file(s):
        libAACdec/src/conceal.cpp

Bug 9428126

Change-Id: I3230bd2072314b730911cd7ec1740e290cb1d254
2013-12-30 09:40:08 -08:00
Jean-Michel Trivi fa3eba1644 Encoder 7.1 support
* AAC-Encoder

   - Add 7.1 rear surround and 7.1 front center support to supported encoder
     channel modes. Change max channels from 6 to 8 and add 7.1 configuration
     to bandwidth and channel mapping functions.
     Modified file(s):
        libAACenc\include\aacenc_lib.h
        libAACenc\src\aacEnc_ram.cpp
        libAACenc\src\aacEnc_ram.h
        libAACenc\src\aacenc.cpp
        libAACenc\src\aacenc.h
        libAACenc\src\aacenc_lib.cpp
        libAACenc\src\adj_thr.cpp
        libAACenc\src\adj_thr.h
        libAACenc\src\adj_thr_data.h
        libAACenc\src\bandwidth.cpp
        libAACenc\src\bitenc.cpp
        libAACenc\src\channel_map.cpp
        libAACenc\src\interface.h
        libAACenc\src\metadata_compressor.cpp
        libAACenc\src\psy_main.cpp
        libAACenc\src\psy_main.h
        libAACenc\src\qc_data.h
        libAACenc\src\qc_main.cpp
        libAACenc\src\qc_main.h

* SBR-Encoder

   - Support up to 7.1 audio channels. Changed max channels from 6 to 8.
     Modified file(s):
        libSBRenc\include\sbr_encoder.h
        libSBRenc\src\sbr.h
        libSBRenc\src\sbr_encoder.cpp
        libSBRenc\src\sbr_ram.cpp

* Transport-Encoder
   - Add 7.1 channel configuration to audio specific config writer in
     transport encoder library.
     Modified file(s):
        libMpegTPEnc\src\tpenc_asc.cpp
        libMpegTPEnc\src\version

* SYS-Library
   - Add 7.1 channel modes to CHANNEL_MODE description.
     Modified file(s):
        libSYS\include\FDK_audio.h
        libSYS\src\genericStds.cpp

Bug 9428126

Change-Id: Ide53583aa8e03df4537b98db80740dfe0e7a9e0f
2013-09-03 14:19:38 -07:00
Jean-Michel Trivi dbf9680648 Encoder explicit signaling
* AAC-Encoder

   - Revise explicit signaling method which is required for downsampled SBR.
     The parameter is optional and default configuration is implicit signaling
     for dualrate SBR as before. In case of downsampled SBR and HE-AAC explicit
     signaling is configured as default.
     Modified file(s):
        documentation\aacEncoder.pdf
        libAACenc\include\aacenc_lib.h
        libAACenc\src\aacenc_lib.cpp
        libMpegTPEnc\src\tpenc_asc.cpp
        libMpegTPEnc\src\version
        libSYS\include\FDK_audio.h
        libSYS\src\genericStds.cpp

Bug 9428126

Change-Id: I35138140346f17384d109ee5829be9ea5bab80fc
2013-09-03 11:31:55 -07:00
Jean-Michel Trivi 5016eb7f65 Decoder stability, sanity checks improvements
* AAC-Decoder

   - Improved PCE handling for saver (re-)configuration and metadata processing.
     Modified file(s):
        libAACdec/src/aacdecoder.cpp
        libAACdec/src/aacdecoder_lib.cpp

   - Transport layer changes (config found) -> to be evaluated.
     Modified file(s):
        libMpegTPDec/include/tpdec_lib.h
        libMpegTPDec/src/tpdec_latm.h
        libMpegTPDec/src/version
        libMpegTPDec/src/tpdec_asc.cpp
        libMpegTPDec/src/tpdec_lib.cpp
        libMpegTPDec/src/tpdec_adts.cpp
        libMpegTPDec/src/tpdec_latm.cpp
        libSYS/include/FDK_audio.h
        libSYS/src/genericStds.cpp

   - Enable concealment state machine to skip states if the corresponding
     parameter is set to zero.
     Modified file(s):
        libAACdec/src/conceal.cpp

   - Add some more sanity checks to avoid segmentation faults especially when
     setting dynamic API params.
     Modified file(s):
        libAACdec/src/aacdecoder_lib.cpp

   - Fix to do a fail-safe initialization of IMDCT for all channels even with
     corrupt streams.
     Modified file(s):
        libAACdec/src/aacdecoder.cpp

   - HCR decoder fix (remove warnings).
     Modified file(s):
        libAACdec/src/block.cpp

   - Fix border calculation in SBR decoder's LPP transposer patch determination.
     Modified file(s):
        libSBRdec/src/env_dec.cpp
        libSBRdec/src/sbrdecoder.cpp
        libSBRdec/src/lpp_tran.cpp

Bug 9428126

Change-Id: Ib415b702b88a7ec8e9a55789d79cafb39296d26b
2013-08-27 16:28:09 -07:00
Jean-Michel Trivi 577fcbb570 Decode and SYS lib cleanup
* AAC-Encoder

   - Remove source snippets related to unsupported frame length of 960.
   - Adjust minBits initialization for disabled VBR configuration.
     Modified file(s):
        libAACenc/src/aacenc.h
        libAACenc/src/aacenc_lib.cpp
        libAACenc/src/aacenc_tns.cpp
        libAACenc/src/bandwidth.cpp
        libAACenc/src/psy_const.h
        libAACenc/src/transform.h

   - Revise encoder parameter restrictions: "Error Resilient(ER) AAC Low Complexity"
     is not supported. Where the AAC part of the FDK encoder threw an
     initialization error, now the aacEncoder_SetParam() returns an error
     before initialization if the application tries to configure this
     audio object type.
     Modified file(s):
        libAACenc/src/aacenc_lib.cpp

* SYS-Library

   - Portability fix for Mingw32.
     Modified file(s):
        libSYS/include/machine_type.h

   - Minor changes.
     Modified file(s):
        libSYS/include/wav_file.h
        libSYS/src/wav_file.cpp
        libSYS/src/cmdl_parser.cpp
        libSYS/src/genericStds.cpp

Bug 9428126

Change-Id: I9fa44923d34f033d0dc607f2b85abacb8a85eb61
2013-08-20 14:51:53 -07:00
Jean-Michel Trivi 4f0d97057c Disclaimer update, lib version increment
- Update disclaimer in all source files.
- Increment library version in each FDK sub-module.

Bug 9428126

Change-Id: I490b96d4ee472246b01483202b0bb4f1e9c2a5d7
2013-08-20 14:38:55 -07:00
Elliott Hughes 03a143bcb4 Remove a bionic workaround.
(Requires corresponding bionic patch 3975cec694a0c9b42e3f7e671fcd678da92836c3.)

(cherry-pick of 1d24ddc612489f57c23e78a5deaaad91f1bf6ce5.)

Change-Id: I7105b17c285ff24fb48be23cf2067aef37f36d45
2012-11-29 19:51:22 -08:00
Jean-Michel Trivi 381d69840a Bug fixes in AAC decoder, AAC encoder, FDK library
Latest code drop from Fraunhofer:

* AAC-Decoder

   - Expanded AAC-LD/ELD decoder TNS max band tables to avoid wrong data
     access for sampling rates <22kHz and >48kHz.
     Modified file(s):
        libAACdec\src\aacdec_tns.cpp
        libAACdec\src\aac_rom.h
        libAACdec\src\aac_rom.cpp

  - Fixed ELD synthesis QMF filterbank scaling for downsampled SBR.
    Modified file(s):
        libFDK\src\qmf.cpp

* AAC-Encoder

  - Fixed bit rate limiting for lower limit as introduced in the Delivery 2012-05-11.
    Modified file(s):
        libAACenc\include\aacenc_lib.h
        libAACenc\src\aacenc.h
        libAACenc\src\aacenc.cpp
        libSBRenc\src\sbr_rom.h
        libSBRenc\src\sbr_rom.cpp

  - Allow negative prediction gain as meaning that there is no coding gain.
    Make use of scaleValueSaturate in gauss window calculation.
    Modified file(s):
        libAACenc\src\aacenc_tns.cpp

  - Added energy saturation to prevent overflow in short blocks.
    Modified file(s):
        libAACenc\src\grp_data.cpp

  - Perform scalefactor adaption in case quantized lines are out of valid range.
    Modified file(s):
        libAACenc\src\quantize.cpp

  - Interrupt quantization loop when no spectral data is available.
    Adjustments in bitreservoir adaption.
    Modified file(s):
        libAACenc\src\qc_main.cpp

  - Indroduced dynamic scaling in none missing harmonic energy lowering compensation.
    Modified file(s):
        libSBRenc\src\env_est.cpp

* FDK-Library

  - Fixed saturation for negative values in scaleValueSaturate.
    Modified file(s):
        libFDK\include\scale.h

Change-Id: If830ea65caef6b5554281e4b7a77a8b2e08825ce
2012-09-09 11:52:09 -07:00
Irina Tirdea ad749575b4 Remove workaround in aac for broken toolchain
aac project forces the system not to include sys/types.h by defining
_SYS_TYPES_H_. This is a workaround for broken android toolchain.

This is no longer needed in latest android version and can be safely
removed. This will also lead to more errors if changes in bionic
headers are needed.

Change-Id: Icb76c207d6b47e811eacff9f9403177629bfb451
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
2012-09-03 02:48:01 +03:00
Martin Storsjo 52396724f8 Only use __int64 on MSVC, not on all win32 compilers
Mingw32 doesn't define the __int64 types.

Change-Id: Ia45add37be1bf85abde664fd6e382334a6bb4498
2012-07-12 17:06:45 +03:00
The Android Open Source Project 2228e36059 Snapshot 2bda038c16
Change-Id: If584e579464f28b97d50e51fc76ba654a5536c54
2012-07-11 10:15:24 -07:00