videoeditorengine/mp3aacManipLib/inc/AACAPI.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef _MP3AACMANIPLIB_H_
       
    22 #define _MP3AACMANIPLIB_H_
       
    23 
       
    24 #include "tool.h"
       
    25 #include "sbr_codec.h"
       
    26 
       
    27 /*
       
    28   Purpose:     AAC decoder core.
       
    29   Explanation: - 
       
    30 
       
    31     Implemented in aacaud.cpp
       
    32 */
       
    33 
       
    34 class CAACAudDec : public CBase
       
    35 {
       
    36     
       
    37 public:
       
    38     
       
    39     static CAACAudDec* NewL(int16 aNumCh, int16 aNumCCh);
       
    40     ~CAACAudDec();
       
    41     
       
    42     void GetFIL(TBitStream *bs, uint32 prevEleID);
       
    43     int32 extension_payload(TBitStream *bs, int32 cnt, uint32 prevEleID);
       
    44     
       
    45     int16 numCh;
       
    46     int16 numCCh;
       
    47     int16 numOutCh;
       
    48     int16 samplesPerFrame;
       
    49     
       
    50     CToolInfo **tool;
       
    51     CMC_Info* mc_info;
       
    52     CCInfo **ccInfo;
       
    53     CWindowInfo **winInfo;
       
    54     
       
    55     /*-- Huffman tables. --*/
       
    56     Huffman_DecInfo **huf;
       
    57     Huffman_DecSfInfo *sf_huf;
       
    58     
       
    59     SbrBitStream *sbrStream;
       
    60     SBR_Decoder *sbrDecInfo;
       
    61     
       
    62 private:
       
    63     void ConstructL(int16 aNumCh, int16 aNumCCh);
       
    64     CAACAudDec();
       
    65     
       
    66     TInt windowAmount;
       
    67     
       
    68 };
       
    69 
       
    70 /*
       
    71 *    Methods for AAC gain manipulation -------------->
       
    72 */
       
    73 
       
    74 /*-- Closes AAC decoder handle. --*/
       
    75 IMPORT_C CAACAudDec *
       
    76 DeleteAACAudDec(CAACAudDec *aac);
       
    77 
       
    78 /*-- Creates AAC decoder handle. --*/
       
    79 IMPORT_C void
       
    80 CreateAACAudDecL(CAACAudDec*& aDecHandle, int16 numCh, int16 numCCh);
       
    81 
       
    82 
       
    83 /*-- Creates (e)AAC+ decoder handle. --*/
       
    84 IMPORT_C uint8
       
    85 CreateAACPlusAudDecL(CAACAudDec *aDecHandle, int16 sampleRateIdx, uint8 isStereo, uint8 isDualMono);
       
    86 
       
    87 
       
    88 /*-- Initializes AAC decoder handle. --*/
       
    89 IMPORT_C void
       
    90 InitAACAudDec(CAACAudDec *aac, int16 profile, int16 sampleRateIdx, uint8 is960);
       
    91 
       
    92 /*-- Resets AAC decoder handle. --*/
       
    93 IMPORT_C void
       
    94 ResetAACAudDec(CAACAudDec *aac);
       
    95 
       
    96 /*-- Counts AAC frame length (and parses the frame at same cost). --*/
       
    97 IMPORT_C int16
       
    98 CountAACChunkLength(TBitStream *bs, CAACAudDec *aac, int16 *bytesInFrame);
       
    99 
       
   100 /*-- Stores global gain values. --*/
       
   101 IMPORT_C void
       
   102 SetAACGlobalGains(TBitStream* bs,
       
   103                   uint8 numGains, uint8 *globalGain, uint32 *globalGainPos);
       
   104 
       
   105 
       
   106 IMPORT_C void
       
   107 SetAACPlusGlobalGains(TBitStream* bs, TBitStream* bsOut, CAACAudDec *aac, int16 gainChangeValue,
       
   108                   uint8 numGains, uint8 *globalGain, uint32 *globalGainPos);
       
   109 
       
   110 
       
   111 /*-- Extracts global gain values. --*/
       
   112 IMPORT_C uint8
       
   113 GetAACGlobalGains(TBitStream* bs, CAACAudDec *aac, uint8 nBufs, uint8 *globalGain, uint32 *globalGainPos);
       
   114 
       
   115 /**
       
   116  *
       
   117  * Retrieves decoder specific information for the
       
   118  * specified AAC encoder configuration. This information should be
       
   119  * placed in the MP4/3GP header to describe the encoder
       
   120  * parameters for the AAC decoder at the receiving end.
       
   121  *
       
   122  * @param aacInfo     Handle to AAC configuration information
       
   123  * @param pBuf        Pointer to decoder specific information buffer
       
   124  * @param nBytesInBuf Size of 'pBuf'
       
   125  *
       
   126  * @return          Number of bytes in 'pBuf'
       
   127  */
       
   128 IMPORT_C int16
       
   129 AACGetMP4ConfigInfo(int32 sampleRate, uint8 profile, uint8 nChannels, int16 frameLen,
       
   130                     uint8 *pBuf, uint8 nBytesInBuf);
       
   131 
       
   132 
       
   133 /*-- Checks whether parametric stereo enabled in the AAC bitstream. --*/
       
   134 IMPORT_C uint8
       
   135 IsAACParametricStereoEnabled(CAACAudDec *aac);
       
   136 
       
   137 
       
   138 
       
   139 /*-- Checks whether SBR enabled in the AAC bitstream. --*/
       
   140 IMPORT_C uint8
       
   141 IsAACSBREnabled(CAACAudDec *aac);
       
   142 
       
   143 
       
   144 /*
       
   145 * <-------    Methods for AAC gain manipulation
       
   146 */
       
   147 
       
   148 #endif