aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPEnc
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2016-04-04 16:06:48 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2016-04-04 17:25:36 -0700
commite1c78ed73faa51f2c7fcb0c4a17a92be9cc747f5 (patch)
treea8dc54ef8dba931c72627e7bbebf1844b81a31f7 /libMpegTPEnc
parentef30836651bf059c3120c03dd11e08b6aafdae13 (diff)
downloadfdk-aac-e1c78ed73faa51f2c7fcb0c4a17a92be9cc747f5.tar.gz
fdk-aac-e1c78ed73faa51f2c7fcb0c4a17a92be9cc747f5.tar.bz2
fdk-aac-e1c78ed73faa51f2c7fcb0c4a17a92be9cc747f5.zip
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
Diffstat (limited to 'libMpegTPEnc')
-rw-r--r--libMpegTPEnc/src/tpenc_latm.cpp27
-rw-r--r--libMpegTPEnc/src/version2
2 files changed, 14 insertions, 15 deletions
diff --git a/libMpegTPEnc/src/tpenc_latm.cpp b/libMpegTPEnc/src/tpenc_latm.cpp
index 58e51ef..f292019 100644
--- a/libMpegTPEnc/src/tpenc_latm.cpp
+++ b/libMpegTPEnc/src/tpenc_latm.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
@@ -296,6 +296,7 @@ CreateStreamMuxConfig(
USHORT coreFrameOffset=0;
+ hAss->taraBufferFullness = 0xFF;
hAss->audioMuxVersionA = 0; /* for future extensions */
hAss->streamMuxConfigBits = 0;
@@ -339,13 +340,7 @@ CreateStreamMuxConfig(
hAss->streamMuxConfigBits+=1;
}
if( (useSameConfig == 0) || (transLayer==0) ) {
- UINT bits;
-
- if ( hAss->audioMuxVersion == 1 ) {
- FDKpushFor(hBs, 2); /* align to ASC, even if we do not know the length of the "ascLen" field yet */
- }
-
- bits = FDKgetValidBits( hBs );
+ const UINT alignAnchor = FDKgetValidBits(hBs);
transportEnc_writeASC(
hBs,
@@ -353,19 +348,24 @@ CreateStreamMuxConfig(
cb
);
- bits = FDKgetValidBits( hBs ) - bits;
-
if ( hAss->audioMuxVersion == 1 ) {
- FDKpushBack(hBs, bits+2);
- hAss->streamMuxConfigBits += transportEnc_LatmWriteValue( hBs, bits );
+ UINT ascLen = transportEnc_LatmWriteValue(hBs, 0);
+ FDKbyteAlign(hBs, alignAnchor);
+ ascLen = FDKgetValidBits(hBs) - alignAnchor - ascLen;
+ FDKpushBack(hBs, FDKgetValidBits(hBs) - alignAnchor);
+
+ transportEnc_LatmWriteValue(hBs, ascLen);
+
transportEnc_writeASC(
hBs,
hAss->config[prog][layer],
cb
);
+
+ FDKbyteAlign(hBs, alignAnchor); /* asc length fillbits */
}
- hAss->streamMuxConfigBits += bits; /* add asc length to smc summary */
+ hAss->streamMuxConfigBits += FDKgetValidBits(hBs) - alignAnchor; /* add asc length to smc summary */
}
transLayer++;
@@ -384,7 +384,6 @@ CreateStreamMuxConfig(
case AOT_ER_AAC_LD :
case AOT_ER_AAC_ELD :
case AOT_USAC:
- case AOT_RSVD50:
p_linfo->frameLengthType = 0;
FDKwriteBits( hBs, p_linfo->frameLengthType, 3 ); /* frameLengthType */
diff --git a/libMpegTPEnc/src/version b/libMpegTPEnc/src/version
index fc7e5f0..8742568 100644
--- a/libMpegTPEnc/src/version
+++ b/libMpegTPEnc/src/version
@@ -2,7 +2,7 @@
/* library info */
#define TP_LIB_VL0 2
#define TP_LIB_VL1 3
-#define TP_LIB_VL2 4
+#define TP_LIB_VL2 6
#define TP_LIB_TITLE "MPEG Transport"
#ifdef __ANDROID__
#define TP_LIB_BUILD_DATE ""