summaryrefslogtreecommitdiffstats
path: root/libMpegTPEnc
diff options
context:
space:
mode:
Diffstat (limited to 'libMpegTPEnc')
-rw-r--r--libMpegTPEnc/include/mpegFileWrite.h2
-rw-r--r--libMpegTPEnc/include/tp_data.h2
-rw-r--r--libMpegTPEnc/include/tpenc_lib.h2
-rw-r--r--libMpegTPEnc/src/tpenc_adif.cpp2
-rw-r--r--libMpegTPEnc/src/tpenc_adif.h2
-rw-r--r--libMpegTPEnc/src/tpenc_adts.cpp2
-rw-r--r--libMpegTPEnc/src/tpenc_adts.h2
-rw-r--r--libMpegTPEnc/src/tpenc_asc.cpp42
-rw-r--r--libMpegTPEnc/src/tpenc_asc.h2
-rw-r--r--libMpegTPEnc/src/tpenc_latm.cpp2
-rw-r--r--libMpegTPEnc/src/tpenc_latm.h2
-rw-r--r--libMpegTPEnc/src/tpenc_lib.cpp14
-rw-r--r--libMpegTPEnc/src/version4
13 files changed, 55 insertions, 25 deletions
diff --git a/libMpegTPEnc/include/mpegFileWrite.h b/libMpegTPEnc/include/mpegFileWrite.h
index 6716d8f..f886a0b 100644
--- a/libMpegTPEnc/include/mpegFileWrite.h
+++ b/libMpegTPEnc/include/mpegFileWrite.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/include/tp_data.h b/libMpegTPEnc/include/tp_data.h
index 6e8218a..5269858 100644
--- a/libMpegTPEnc/include/tp_data.h
+++ b/libMpegTPEnc/include/tp_data.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/include/tpenc_lib.h b/libMpegTPEnc/include/tpenc_lib.h
index a06e7a7..2833e82 100644
--- a/libMpegTPEnc/include/tpenc_lib.h
+++ b/libMpegTPEnc/include/tpenc_lib.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_adif.cpp b/libMpegTPEnc/src/tpenc_adif.cpp
index 06bd30b..b48a32e 100644
--- a/libMpegTPEnc/src/tpenc_adif.cpp
+++ b/libMpegTPEnc/src/tpenc_adif.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_adif.h b/libMpegTPEnc/src/tpenc_adif.h
index 0921712..d590354 100644
--- a/libMpegTPEnc/src/tpenc_adif.h
+++ b/libMpegTPEnc/src/tpenc_adif.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_adts.cpp b/libMpegTPEnc/src/tpenc_adts.cpp
index 39460f0..f4f3178 100644
--- a/libMpegTPEnc/src/tpenc_adts.cpp
+++ b/libMpegTPEnc/src/tpenc_adts.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_adts.h b/libMpegTPEnc/src/tpenc_adts.h
index 9123f1e..c12c7c7 100644
--- a/libMpegTPEnc/src/tpenc_adts.h
+++ b/libMpegTPEnc/src/tpenc_adts.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_asc.cpp b/libMpegTPEnc/src/tpenc_asc.cpp
index 6200c14..bc4302e 100644
--- a/libMpegTPEnc/src/tpenc_asc.cpp
+++ b/libMpegTPEnc/src/tpenc_asc.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
@@ -127,8 +127,7 @@ typedef struct {
*
* The number of channel element parameter describes the kind of consecutively elements.
* E.g. MODE_1_2_2_2_1 means:
- * - First 2 elements (SCE,CPE) are front channel elements.
- * - Following element (CPE) is a side channel element.
+ * - First 3 elements (SCE,CPE,CPE) are front channel elements.
* - Next element (CPE) is a back channel element.
* - Last element (LFE) is a lfe channel element.
*/
@@ -140,7 +139,8 @@ static const CHANNEL_CONFIGURATION pceConfigTab[] =
{ MODE_1_2_1, { 2, 0, 1, 0, { ID_SCE, ID_CPE, ID_SCE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
{ MODE_1_2_2, { 2, 0, 1, 0, { ID_SCE, ID_CPE, ID_CPE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
{ MODE_1_2_2_1, { 2, 0, 1, 1, { ID_SCE, ID_CPE, ID_CPE, ID_LFE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
- { MODE_1_2_2_2_1, { 2, 1, 1, 1, { ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_NONE, ID_NONE, ID_NONE } } },
+ { MODE_1_2_2_2_1, { 3, 0, 1, 1, { ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_NONE, ID_NONE, ID_NONE } } },
+
{ MODE_1_1, { 2, 0, 0, 0, { ID_SCE, ID_SCE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
{ MODE_1_1_1_1, { 2, 2, 0, 0, { ID_SCE, ID_SCE, ID_SCE, ID_SCE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
@@ -151,7 +151,11 @@ static const CHANNEL_CONFIGURATION pceConfigTab[] =
{ MODE_2_2_2, { 1, 1, 1, 0, { ID_CPE, ID_CPE, ID_CPE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
{ MODE_2_2_2_2, { 4, 0, 0, 0, { ID_CPE, ID_CPE, ID_CPE, ID_CPE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
- { MODE_2_1, { 1, 0, 1, 0, { ID_CPE, ID_SCE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } }
+ { MODE_2_1, { 1, 0, 1, 0, { ID_CPE, ID_SCE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE } } },
+
+ { MODE_7_1_REAR_SURROUND, { 2, 0, 2, 1, { ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_NONE, ID_NONE, ID_NONE } } },
+ { MODE_7_1_FRONT_CENTER, { 3, 0, 1, 1, { ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_NONE, ID_NONE, ID_NONE } } },
+
};
@@ -255,7 +259,7 @@ int transportEnc_writePCE(HANDLE_FDK_BITSTREAM hBs,
if ( matrixMixdownA!=0 && ((channelMode==MODE_1_2_2)||(channelMode==MODE_1_2_2_1)) ) {
FDKwriteBits(hBs, 1, 1); /* Matrix mixdown present */
FDKwriteBits(hBs, (matrixMixdownA-1)&0x3, 2); /* matrix_mixdown_idx */
- FDKwriteBits(hBs, pseudoSurroundEnable&0x1, 1); /* pseudo_surround_enable */
+ FDKwriteBits(hBs, (pseudoSurroundEnable)?1:0, 1); /* pseudo_surround_enable */
}
else {
FDKwriteBits(hBs, 0, 1); /* Matrix mixdown not present */
@@ -379,7 +383,7 @@ int transportEnc_writeGASpecificConfig(
/* Write PCE if channel config is not 1-7 */
if (getChannelConfig(config->channelMode) == 0) {
- transportEnc_writePCE(asc, config->channelMode, config->samplingRate, 0, 1, 0, 0, alignAnchor);
+ transportEnc_writePCE(asc, config->channelMode, config->samplingRate, 0, 1, config->matrixMixdownA, (config->flags&CC_PSEUDO_SURROUND)?1:0, alignAnchor);
}
if (extFlg) {
if (aot == AOT_ER_BSAC) {
@@ -474,7 +478,7 @@ int transportEnc_writeASC (
break;
}
- if (config->extAOT == AOT_SBR || config->extAOT == AOT_PS)
+ if (config->sbrSignaling==SIG_EXPLICIT_HIERARCHICAL && config->sbrPresent)
writeAot(asc, config->extAOT);
else
writeAot(asc, config->aot);
@@ -492,7 +496,7 @@ int transportEnc_writeASC (
FDKwriteBits( asc, getChannelConfig(config->channelMode), 4 );
- if (config->extAOT == AOT_SBR || config->extAOT == AOT_PS) {
+ if (config->sbrSignaling==SIG_EXPLICIT_HIERARCHICAL && config->sbrPresent) {
writeSampleRate(asc, config->extSamplingRate);
writeAot(asc, config->aot);
}
@@ -545,6 +549,26 @@ int transportEnc_writeASC (
break;
}
+ /* backward compatible explicit signaling of extension AOT */
+ if (config->sbrSignaling==SIG_EXPLICIT_BW_COMPATIBLE)
+ {
+ TP_ASC_EXTENSION_ID ascExtId = ASCEXT_UNKOWN;
+
+ if (config->sbrPresent) {
+ ascExtId=ASCEXT_SBR;
+ FDKwriteBits( asc, ascExtId, 11 );
+ writeAot(asc, config->extAOT);
+ FDKwriteBits( asc, 1, 1 ); /* sbrPresentFlag=1 */
+ writeSampleRate(asc, config->extSamplingRate);
+ if (config->psPresent) {
+ ascExtId=ASCEXT_PS;
+ FDKwriteBits( asc, ascExtId, 11 );
+ FDKwriteBits( asc, 1, 1 ); /* psPresentFlag=1 */
+ }
+ }
+
+ }
+
/* Make sure all bits are sync'ed */
FDKsyncCache( asc );
diff --git a/libMpegTPEnc/src/tpenc_asc.h b/libMpegTPEnc/src/tpenc_asc.h
index 990f74f..47fe7a1 100644
--- a/libMpegTPEnc/src/tpenc_asc.h
+++ b/libMpegTPEnc/src/tpenc_asc.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_latm.cpp b/libMpegTPEnc/src/tpenc_latm.cpp
index 54fd717..58e51ef 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 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_latm.h b/libMpegTPEnc/src/tpenc_latm.h
index fd95a60..34eea58 100644
--- a/libMpegTPEnc/src/tpenc_latm.h
+++ b/libMpegTPEnc/src/tpenc_latm.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
diff --git a/libMpegTPEnc/src/tpenc_lib.cpp b/libMpegTPEnc/src/tpenc_lib.cpp
index 4f3177d..d0a2fec 100644
--- a/libMpegTPEnc/src/tpenc_lib.cpp
+++ b/libMpegTPEnc/src/tpenc_lib.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
@@ -150,12 +150,18 @@ C_ALLOC_MEM(Ram_TransportEncoder, TRANSPORTENC, 1)
TRANSPORTENC_ERROR transportEnc_Open( HANDLE_TRANSPORTENC *phTpEnc )
{
- HANDLE_TRANSPORTENC hTpEnc = GetRam_TransportEncoder(0);
+ HANDLE_TRANSPORTENC hTpEnc;
- if ( hTpEnc == NULL ) {
+ if ( phTpEnc == NULL ){
return TRANSPORTENC_INVALID_PARAMETER;
}
+ hTpEnc = GetRam_TransportEncoder(0);
+
+ if ( hTpEnc == NULL ) {
+ return TRANSPORTENC_NO_MEM;
+ }
+
*phTpEnc = hTpEnc;
return TRANSPORTENC_OK;
}
@@ -417,7 +423,7 @@ TRANSPORTENC_ERROR transportEnc_WriteAccessUnit(
}
/* Write PCE as first raw_data_block element */
- transportEnc_writePCE(&hTp->bitStream, hTp->config.channelMode, hTp->config.samplingRate, 0, 1, hTp->config.matrixMixdownA, hTp->config.flags & CC_PSEUDO_SURROUND, alignAnchor);
+ transportEnc_writePCE(&hTp->bitStream, hTp->config.channelMode, hTp->config.samplingRate, 0, 1, hTp->config.matrixMixdownA, (hTp->config.flags&CC_PSEUDO_SURROUND)?1:0, alignAnchor);
if ( (hTp->transportFmt==TT_MP4_ADTS) && !hTp->writer.adts.protection_absent) {
adtsWrite_CrcEndReg(&hTp->writer.adts, &hTp->bitStream, crcIndex);
diff --git a/libMpegTPEnc/src/version b/libMpegTPEnc/src/version
index 5b9a425..2803347 100644
--- a/libMpegTPEnc/src/version
+++ b/libMpegTPEnc/src/version
@@ -1,8 +1,8 @@
/* library info */
#define TP_LIB_VL0 2
-#define TP_LIB_VL1 2
-#define TP_LIB_VL2 1
+#define TP_LIB_VL1 3
+#define TP_LIB_VL2 3
#define TP_LIB_TITLE "MPEG Transport"
#define TP_LIB_BUILD_DATE __DATE__
#define TP_LIB_BUILD_TIME __TIME__