Home | History | Annotate | Download | only in inc
      1 /*
      2  * Copyright (C) 2011 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 /**
     17 *************************************************************************
     18  * @file   M4_Common.h
     19  * @brief  Common data structure between shells
     20  * @note
     21 *************************************************************************
     22 */
     23 #ifndef __M4_COMMON_H__
     24 #define __M4_COMMON_H__
     25 
     26 #include "M4OSA_Types.h"
     27 
     28 /**
     29  ************************************************************************
     30  * structure    _parameterSet
     31  * @brief        This structure defines the structure of parameters for the avc
     32  *               decoder specific info
     33  * @note
     34  ************************************************************************
     35 */
     36 typedef struct _parameterSet
     37 {
     38     M4OSA_UInt16 m_length;                /* Number of items*/
     39     M4OSA_UInt8* m_pParameterSetUnit;   /* Array of items*/
     40 } ParameterSet ;
     41 
     42 /**
     43  ************************************************************************
     44  * structure    _avcSpecificInfo
     45  * @brief        This structure defines the structure of specific info for the avc decoder
     46  * @note
     47  ************************************************************************
     48 */
     49 typedef struct _avcSpecificInfo
     50 {
     51     M4OSA_UInt8        m_nalUnitLength;                /* length in bytes of the NALUnitLength
     52                                                             field in a AVC sample */
     53     M4OSA_UInt8        m_numOfSequenceParameterSets;   /* Number of sequence parameter sets*/
     54     M4OSA_UInt8        m_numOfPictureParameterSets;    /* Number of picture parameter sets*/
     55     ParameterSet    *m_pSequenceParameterSet;        /* Sequence parameter sets array*/
     56     ParameterSet    *m_pPictureParameterSet;        /* Picture parameter sets array*/
     57 } AvcSpecificInfo ;
     58 
     59 /**
     60  ************************************************************************
     61  * structure    M4_SynthesisAudioInfo
     62  * @brief        This structure contains specific pointers used for synthesis audio format
     63  ************************************************************************
     64 */
     65 typedef struct _synthesisAudioInfo
     66 {
     67     M4OSA_Void*        m_pInputBuf;
     68     M4OSA_Void*        m_pInputInfo;
     69     M4OSA_UInt16    m_uiNbSubFramePerStep;
     70     M4OSA_UInt32    m_uiUsedBytes;
     71 } M4_SynthesisAudioInfo;
     72 
     73 
     74 /*
     75  ************************************************************************
     76  * enum     M4_AACDownsamplingMode
     77  * @brief   This enum states modes for Down sampling
     78  ************************************************************************
     79 */
     80 typedef enum
     81 {
     82     AAC_kDS_OFF    = 0,        /**< No Down sampling */
     83     AAC_kDS_BY_2   = 1,        /**< Down sampling by 2
     84                                  Profile = AAC :
     85                                             output sampling rate = aac_samp_freq/2
     86                                  Profile = HE_AAC and input is AAC:
     87                                             Output sampling rate = aac_samp_freq.(No downsamping).
     88                                  Profile = HE_AAC and input is HE_AAC:
     89                                             Output sampling rate = aac_samp_freq (Downsampling
     90                                             occurs in SBR tool).
     91                                  case profile = HE_AAC_v2 :
     92                                             Not Supported */
     93     AAC_kDS_BY_3   = 2,        /**< Down sampling by 3  - only for AAC profile */
     94     AAC_kDS_BY_4   = 3,        /**< Down sampling by 4  - only for AAC profile */
     95     AAC_kDS_BY_8   = 4        /**< Down sampling by 8  - only for AAC profile */
     96 
     97 } M4_AACDownsamplingMode;
     98 
     99 
    100 /*
    101  ************************************************************************
    102  * enum     M4_AACOutputMode
    103  * @brief   This enum defines the output mode
    104  ************************************************************************
    105 */
    106 typedef enum
    107 {
    108     AAC_kMono      = 0,    /**< Output is Mono  */
    109     AAC_kStereo    = 1     /**< Output is Stereo */
    110 } M4_AACOutputMode;
    111 
    112 
    113 /*
    114  ************************************************************************
    115  * enum     M4_AACDecProfile
    116  * @brief   This enum defines the AAC decoder profile
    117  ************************************************************************
    118 */
    119 typedef enum
    120 {
    121     AAC_kAAC       = 0,        /**< AAC profile (only AAC LC object are supported) */
    122     AAC_kHE_AAC    = 1,        /**< HE AAC or AAC+ profile (SBR in LP Mode)  */
    123     AAC_kHE_AAC_v2 = 2        /**< HE AAC v2 or Enhanced AAC+ profile (SBR Tool in HQ Mode) */
    124 } M4_AACDecProfile;
    125 
    126 
    127 /**
    128  ************************************************************************
    129  * structure    M4_AacDecoderConfig
    130  * @brief        This structure defines specific settings according to
    131  *                the user requirements
    132  ************************************************************************
    133 */
    134 typedef struct
    135 {
    136     M4_AACDecProfile        m_AACDecoderProfile;
    137     M4_AACDownsamplingMode    m_DownSamplingMode;
    138     M4_AACOutputMode        m_OutputMode;
    139 
    140 } M4_AacDecoderConfig;
    141 
    142 
    143 /**
    144  ************************************************************************
    145  * structure M4READER_AudioSbrUserdata
    146  * @brief    This structure defines the user's data needed to decode the
    147  *            AACplus stream
    148  * @note    The field m_pFirstAU is used in case of local files    and
    149  *            the field m_bIsSbrEnabled is used in streaming case.
    150  ************************************************************************
    151 */
    152 typedef struct
    153 {
    154   M4OSA_Void*            m_pFirstAU;                /**< The first AU from where SBR data are
    155                                                          extracted (local file case)*/
    156   M4OSA_Bool            m_bIsSbrEnabled;        /**< A boolean that indicates if the stream is
    157                                                     AACplus (streaming case)*/
    158   M4_AacDecoderConfig*    m_pAacDecoderUserConfig;/**< Decoder specific user setting */
    159 
    160 } M4READER_AudioSbrUserdata;
    161 
    162 #endif /* __M4_COMMON_H__*/
    163 
    164