From a5813f742e594f84cea84c2e60afdca4b48190d1 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 6 Mar 2018 23:17:35 +0100 Subject: [PATCH] Re-add the WIP AAC parser So it is considered when refactoring. --- CMakeLists.txt | 8 ++++---- aac/aaccodebook.cpp | 2 +- aac/aaccodebook.h | 10 ++++++---- aac/aacframe.cpp | 7 ++++--- aac/aacframe.h | 18 ++++++++++-------- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index badba23..329cfba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ set(HEADER_FILES mp4/mp4tagfield.h mp4/mp4track.h mp4/mpeg4descriptor.h -# aac/aaccodebook.h -# aac/aacframe.h + aac/aaccodebook.h + aac/aacframe.h abstractattachment.h abstractchapter.h abstractcontainer.h @@ -84,8 +84,8 @@ set(SRC_FILES mp4/mp4tagfield.cpp mp4/mp4track.cpp mp4/mpeg4descriptor.cpp -# aac/aaccodebook.cpp -# aac/aacframe.cpp + aac/aaccodebook.cpp + aac/aacframe.cpp abstractattachment.cpp abstractchapter.cpp abstractcontainer.cpp diff --git a/aac/aaccodebook.cpp b/aac/aaccodebook.cpp index 3715ada..653f049 100644 --- a/aac/aaccodebook.cpp +++ b/aac/aaccodebook.cpp @@ -1,6 +1,6 @@ #include "./aaccodebook.h" -namespace Media { +namespace TagParser { const AacHcb *const aacHcbTable[] = { 0, aacHcb1Step1, aacHcb2Step1, 0, aacHcb4Step1, 0, aacHcb6Step1, 0, aacHcb8Step1, 0, aacHcb10Step1, aacHcb11Step1 diff --git a/aac/aaccodebook.h b/aac/aaccodebook.h index b51bc71..055e7ab 100644 --- a/aac/aaccodebook.h +++ b/aac/aaccodebook.h @@ -1,10 +1,12 @@ -#ifndef AACCODEBOOK_H -#define AACCODEBOOK_H +#ifndef TAG_PARSER_AACCODEBOOK_H +#define TAG_PARSER_AACCODEBOOK_H + +// NOTE: The AAC parser is still WIP. It does not work yet and its API/ABI may change even in patch releases. #include #include -namespace Media { +namespace TagParser { struct LIB_EXPORT AacHcb { @@ -82,4 +84,4 @@ extern const sbyte tHuffmanNoiseBal30dB[24][2]; } -#endif // AACCODEBOOK_H +#endif // TAG_PARSER_AACCODEBOOK_H diff --git a/aac/aacframe.cpp b/aac/aacframe.cpp index fa83581..a78581d 100644 --- a/aac/aacframe.cpp +++ b/aac/aacframe.cpp @@ -21,7 +21,7 @@ using namespace IoUtilities; * in the rest of the library. */ -namespace Media { +namespace TagParser { /*! * \cond @@ -1334,7 +1334,8 @@ shared_ptr AacFrameElementParser::makeSbrInfo(byte sbrElement, bool void AacFrameElementParser::parseSbrExtensionData(byte sbrElement, uint16 count, bool crcFlag) { - uint16 alignBitCount = 0; + VAR_UNUSED(count); + //uint16 alignBitCount = 0; std::shared_ptr &sbr = m_sbrElements[sbrElement]; if(m_psResetFlag) { sbr->psResetFlag = m_psResetFlag; @@ -1663,7 +1664,7 @@ void AacFrameElementParser::calculateWindowGroupingInfo(AacIcsInfo &ics) } ics.swbOffset[ics.swbCount] = ics.maxSwbOffset = m_frameLength / 8; for(byte i = 0; i < ics.windowCount - 1; ++i) { - if(!ics.scaleFactorGrouping & (1 << (6 - i))) { + if(!(ics.scaleFactorGrouping & (1 << (6 - i)))) { ics.windowGroupLengths[ics.windowGroupCount] = 1; ++ics.windowGroupCount; } else { diff --git a/aac/aacframe.h b/aac/aacframe.h index 60eb69b..58d2fc3 100644 --- a/aac/aacframe.h +++ b/aac/aacframe.h @@ -1,11 +1,13 @@ -#ifndef AACFRAME_H -#define AACFRAME_H +#ifndef TAG_PARSER_AACFRAME_H +#define TAG_PARSER_AACFRAME_H + +// NOTE: The AAC parser is still WIP. It does not work yet and its API/ABI may change even in patch releases. #include #include -namespace Media { +namespace TagParser { class AdtsFrame; @@ -513,8 +515,8 @@ private: AacDrcInfo m_drc; AacProgramConfig m_pce; byte m_sbrPresentFlag; - byte m_forceUpSampling; - byte m_downSampledSbr; + //byte m_forceUpSampling; + //byte m_downSampledSbr; std::shared_ptr m_sbrElements[aacMaxSyntaxElements]; byte m_psUsed[aacMaxSyntaxElements]; byte m_psUsedGlobal; @@ -541,8 +543,8 @@ inline AacFrameElementParser::AacFrameElementParser(byte audioObjectId, byte sam //m_channel(0), //m_pairedChannel(0), m_sbrPresentFlag(0), - m_forceUpSampling(0), - m_downSampledSbr(0), + //m_forceUpSampling(0), + //m_downSampledSbr(0), m_sbrElements{0}, m_psUsed{0}, m_psUsedGlobal(0), @@ -562,4 +564,4 @@ constexpr int16 AacFrameElementParser::huffmanCodebook(byte i) } -#endif // AACFRAME_H +#endif // TAG_PARSER_AACFRAME_H