Advanced Audio Coding Decoder
Library
MPEG-2 and MPEG-4
AAC Low-Complexity (AAC-LC),
High-Efficiency AAC v2 (HE-AAC v2),
AAC Low-Delay (AAC-LD), and
AAC Enhanced Low-Delay (AAC-ELD)
decoder
Fraunhofer Institut Integrierte Schaltungen IIS,
Fraunhofer Institute for Integrated Circuits IIS
http://www.iis.fraunhofer.de/amm
Disclaimer
Information in this document is subject to change without notice. Companies, names, and data used in examples
herein are fictitious unless otherwise noted. Product and corporate names may be trademarks or registered trademarks
of other companies. They are used for explanation only, with no intent to infringe. All rights reserved. No part
of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including
photocopying and microfilm, without permission in writing from the publisher.
Revision 2.4.7 , September 27, 2012
Contents
1 Introduction 1
1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Decoder Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Library Usage 3
2.1 API Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Calling Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Buffer System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Decoder audio output 7
3.1 Obtaining channel mapping information . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Changing the audio output format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Channel mapping examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3.1 Stereo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.2 Surround 5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.3 ARIB coding mode 2/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Command-line Usage 11
4.1 Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1.1 Mandatory Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1.2 Optional Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Class Index 13
5.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 File Index 15
6.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7 Class Documentation 17
7.1 CStreamInfo Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ii CONTENTS
7.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.1.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.1 aacSampleRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.2 aacSamplesPerFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.3 aot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.4 bitRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.5 channelConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.6 epConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.7 extAot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.8 extSamplingRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.9 flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.10 frameSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1.2.11 numBadAccessUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.12 numBadBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.13 numChannels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.14 numLostAccessUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.15 numTotalAccessUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.16 numTotalBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.17 pChannelIndices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.18 pChannelType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.19 profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.1.2.20 sampleRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8 File Documentation 21
8.1 aacdecoder_lib.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2 Define Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2.1 AACDEC_CLRHIST . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2.2 AACDEC_CONCEAL . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2.3 AACDEC_FLUSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2.4 AACDEC_INTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2.5 IS_DECODE_ERROR . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.1.2.6 IS_INIT_ERROR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.1.2.7 IS_OUTPUT_VALID . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.1.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.1.3.1 HANDLE_AACDECODER . . . . . . . . . . . . . . . . . . . . . . . 26
8.1.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 26
CONTENTS iii
8.1.4.1 AAC_DECODER_ERROR . . . . . . . . . . . . . . . . . . . . . . . . 26
8.1.4.2 AACDEC_PARAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.1.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.1.5.1 aacDecoder_AncDataGet . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.1.5.2 aacDecoder_AncDataInit . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.1.5.3 aacDecoder_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.1.5.4 aacDecoder_ConfigRaw . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.1.5.5 aacDecoder_DecodeFrame . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.5.6 aacDecoder_Fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.5.7 aacDecoder_GetFreeBytes . . . . . . . . . . . . . . . . . . . . . . . . 31
8.1.5.8 aacDecoder_GetLibInfo . . . . . . . . . . . . . . . . . . . . . . . . . . 31
8.1.5.9 aacDecoder_GetStreamInfo . . . . . . . . . . . . . . . . . . . . . . . . 31
8.1.5.10 aacDecoder_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.1.5.11 aacDecoder_SetParam . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.2 main.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
8.2.2 Define Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.2.1 ANC_BUF_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.2.2 FILE_NAME_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.2.3 IN_BUF_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.2.4 N_FLUSH_FRAMES . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.2.5 NO_FILENAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.2.6 OUT_BUF_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.3.1 main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8.2.4 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.1 ancBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.2 ancFilename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.3 conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.4 conf_mem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.5 confSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.6 confString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.7 inBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.8 inBuffer_mem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.9 inputFilename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.2.4.10 outputFilename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36