Re-add the WIP AAC parser

So it is considered when refactoring.
This commit is contained in:
Martchus 2018-03-06 23:17:35 +01:00
parent 0e15c74103
commit a5813f742e
5 changed files with 25 additions and 20 deletions

View File

@ -10,8 +10,8 @@ set(HEADER_FILES
mp4/mp4tagfield.h mp4/mp4tagfield.h
mp4/mp4track.h mp4/mp4track.h
mp4/mpeg4descriptor.h mp4/mpeg4descriptor.h
# aac/aaccodebook.h aac/aaccodebook.h
# aac/aacframe.h aac/aacframe.h
abstractattachment.h abstractattachment.h
abstractchapter.h abstractchapter.h
abstractcontainer.h abstractcontainer.h
@ -84,8 +84,8 @@ set(SRC_FILES
mp4/mp4tagfield.cpp mp4/mp4tagfield.cpp
mp4/mp4track.cpp mp4/mp4track.cpp
mp4/mpeg4descriptor.cpp mp4/mpeg4descriptor.cpp
# aac/aaccodebook.cpp aac/aaccodebook.cpp
# aac/aacframe.cpp aac/aacframe.cpp
abstractattachment.cpp abstractattachment.cpp
abstractchapter.cpp abstractchapter.cpp
abstractcontainer.cpp abstractcontainer.cpp

View File

@ -1,6 +1,6 @@
#include "./aaccodebook.h" #include "./aaccodebook.h"
namespace Media { namespace TagParser {
const AacHcb *const aacHcbTable[] = { const AacHcb *const aacHcbTable[] = {
0, aacHcb1Step1, aacHcb2Step1, 0, aacHcb4Step1, 0, aacHcb6Step1, 0, aacHcb8Step1, 0, aacHcb10Step1, aacHcb11Step1 0, aacHcb1Step1, aacHcb2Step1, 0, aacHcb4Step1, 0, aacHcb6Step1, 0, aacHcb8Step1, 0, aacHcb10Step1, aacHcb11Step1

View File

@ -1,10 +1,12 @@
#ifndef AACCODEBOOK_H #ifndef TAG_PARSER_AACCODEBOOK_H
#define 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 <c++utilities/application/global.h> #include <c++utilities/application/global.h>
#include <c++utilities/conversion/types.h> #include <c++utilities/conversion/types.h>
namespace Media { namespace TagParser {
struct LIB_EXPORT AacHcb struct LIB_EXPORT AacHcb
{ {
@ -82,4 +84,4 @@ extern const sbyte tHuffmanNoiseBal30dB[24][2];
} }
#endif // AACCODEBOOK_H #endif // TAG_PARSER_AACCODEBOOK_H

View File

@ -21,7 +21,7 @@ using namespace IoUtilities;
* in the rest of the library. * in the rest of the library.
*/ */
namespace Media { namespace TagParser {
/*! /*!
* \cond * \cond
@ -1334,7 +1334,8 @@ shared_ptr<AacSbrInfo> AacFrameElementParser::makeSbrInfo(byte sbrElement, bool
void AacFrameElementParser::parseSbrExtensionData(byte sbrElement, uint16 count, bool crcFlag) void AacFrameElementParser::parseSbrExtensionData(byte sbrElement, uint16 count, bool crcFlag)
{ {
uint16 alignBitCount = 0; VAR_UNUSED(count);
//uint16 alignBitCount = 0;
std::shared_ptr<AacSbrInfo> &sbr = m_sbrElements[sbrElement]; std::shared_ptr<AacSbrInfo> &sbr = m_sbrElements[sbrElement];
if(m_psResetFlag) { if(m_psResetFlag) {
sbr->psResetFlag = m_psResetFlag; sbr->psResetFlag = m_psResetFlag;
@ -1663,7 +1664,7 @@ void AacFrameElementParser::calculateWindowGroupingInfo(AacIcsInfo &ics)
} }
ics.swbOffset[ics.swbCount] = ics.maxSwbOffset = m_frameLength / 8; ics.swbOffset[ics.swbCount] = ics.maxSwbOffset = m_frameLength / 8;
for(byte i = 0; i < ics.windowCount - 1; ++i) { 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.windowGroupLengths[ics.windowGroupCount] = 1;
++ics.windowGroupCount; ++ics.windowGroupCount;
} else { } else {

View File

@ -1,11 +1,13 @@
#ifndef AACFRAME_H #ifndef TAG_PARSER_AACFRAME_H
#define 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 <c++utilities/io/bitreader.h> #include <c++utilities/io/bitreader.h>
#include <memory> #include <memory>
namespace Media { namespace TagParser {
class AdtsFrame; class AdtsFrame;
@ -513,8 +515,8 @@ private:
AacDrcInfo m_drc; AacDrcInfo m_drc;
AacProgramConfig m_pce; AacProgramConfig m_pce;
byte m_sbrPresentFlag; byte m_sbrPresentFlag;
byte m_forceUpSampling; //byte m_forceUpSampling;
byte m_downSampledSbr; //byte m_downSampledSbr;
std::shared_ptr<AacSbrInfo> m_sbrElements[aacMaxSyntaxElements]; std::shared_ptr<AacSbrInfo> m_sbrElements[aacMaxSyntaxElements];
byte m_psUsed[aacMaxSyntaxElements]; byte m_psUsed[aacMaxSyntaxElements];
byte m_psUsedGlobal; byte m_psUsedGlobal;
@ -541,8 +543,8 @@ inline AacFrameElementParser::AacFrameElementParser(byte audioObjectId, byte sam
//m_channel(0), //m_channel(0),
//m_pairedChannel(0), //m_pairedChannel(0),
m_sbrPresentFlag(0), m_sbrPresentFlag(0),
m_forceUpSampling(0), //m_forceUpSampling(0),
m_downSampledSbr(0), //m_downSampledSbr(0),
m_sbrElements{0}, m_sbrElements{0},
m_psUsed{0}, m_psUsed{0},
m_psUsedGlobal(0), m_psUsedGlobal(0),
@ -562,4 +564,4 @@ constexpr int16 AacFrameElementParser::huffmanCodebook(byte i)
} }
#endif // AACFRAME_H #endif // TAG_PARSER_AACFRAME_H