From 5a9d42c18d2669798910fa2dbf4df61473d58c9d Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 25 Jul 2014 12:54:02 +0200 Subject: Revert "Write DSE at start of AU" This reverts commit 05e6de86461b4ab0c55880db0c83d7a7bd6c5bc1 which broke audio decoding for PURE One Elite receivers, but fixed slideshow and DLS decoding on PURE Sensia receivers. Slides and DLS are now not working on PURE Sensia, but at least audio is working again. --- libAACenc/src/bitenc.cpp | 64 +++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/libAACenc/src/bitenc.cpp b/libAACenc/src/bitenc.cpp index c7f698a..6f2c151 100644 --- a/libAACenc/src/bitenc.cpp +++ b/libAACenc/src/bitenc.cpp @@ -1302,41 +1302,6 @@ AAC_ENCODER_ERROR FDKaacEnc_WriteBitstream(HANDLE_TRANSPORTENC hTpEnc, frameBits = bitMarkUp = alignAnchor; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// Block moved in order to write DSE at the beginning of the bit stream - Sergio Sagliocco (CSP) - - /* Add fill data / stuffing bits */ - n = qcOut->nExtensions; - -// if (!(syntaxFlags & AC_DAB)) { - qcOut->extension[n].type = EXT_FILL_DATA; - qcOut->extension[n].nPayloadBits = qcOut->totFillBits; - qcOut->nExtensions++; -// } else { -// doByteAlign = 0; -// } - if (syntaxFlags & AC_DAB) - doByteAlign = 0; - - /* Write global extension payload and fill data */ - for (n = 0; (n < qcOut->nExtensions) && (n < (2+2)); n++) - { - //fprintf(stderr,"SERGIO FDKaacEnc_WriteBitstream: call FDKaacEnc_writeExtensionData - 3 (%d)\n",n); - - FDKaacEnc_writeExtensionData( hTpEnc, - &qcOut->extension[n], - 0, - alignAnchor, - syntaxFlags, - aot, - epConfig ); - - /* For EXT_FIL or EXT_FILL_DATA we could do an additional sanity check here */ - } - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /* Channel element loop */ for (i=0; inElements; i++) { @@ -1397,7 +1362,7 @@ AAC_ENCODER_ERROR FDKaacEnc_WriteBitstream(HANDLE_TRANSPORTENC hTpEnc, if ( (syntaxFlags & AC_ER) && !(syntaxFlags & AC_DRM) ) { - UCHAR channelElementExtensionWritten[(6)][(1)]; /* 0: extension not touched, 1: extension already written */ + UCHAR channelElementExtensionWritten[(8)][(1)]; /* 0: extension not touched, 1: extension already written */ FDKmemclear(channelElementExtensionWritten, sizeof(channelElementExtensionWritten)); @@ -1464,6 +1429,33 @@ AAC_ENCODER_ERROR FDKaacEnc_WriteBitstream(HANDLE_TRANSPORTENC hTpEnc, } /* AC_DRM */ + /* Add fill data / stuffing bits */ + n = qcOut->nExtensions; + +// if (!(syntaxFlags & AC_DAB)) { + qcOut->extension[n].type = EXT_FILL_DATA; + qcOut->extension[n].nPayloadBits = qcOut->totFillBits; + qcOut->nExtensions++; +// } else { +// doByteAlign = 0; +// } + if (syntaxFlags & AC_DAB) + doByteAlign = 0; + + /* Write global extension payload and fill data */ + for (n = 0; (n < qcOut->nExtensions) && (n < (2+2)); n++) + { + FDKaacEnc_writeExtensionData( hTpEnc, + &qcOut->extension[n], + 0, + alignAnchor, + syntaxFlags, + aot, + epConfig ); + + /* For EXT_FIL or EXT_FILL_DATA we could do an additional sanity check here */ + } + if (!(syntaxFlags & (AC_SCALABLE|AC_ER|AC_DAB))) { FDKwriteBits(hBs, ID_END, EL_ID_BITS); } -- cgit v1.2.3