MloElementPce.h

00001 /*****************************************************************
00002 |
00003 |    Copyright 2004-2006 Axiomatic Systems LLC
00004 |
00005 |    This file is part of Melo (Melo AAC Decoder).
00006 |
00007 |    Unless you have obtained Melo under a difference license,
00008 |    this version of Melo is Melo|GPL.
00009 |    Melo|GPL is free software; you can redistribute it and/or modify
00010 |    it under the terms of the GNU General Public License as published by
00011 |    the Free Software Foundation; either version 2, or (at your option)
00012 |    any later version.
00013 |
00014 |    Melo|GPL is distributed in the hope that it will be useful,
00015 |    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 |    GNU General Public License for more details.
00018 |
00019 |    You should have received a copy of the GNU General Public License
00020 |    along with Melo|GPL; see the file COPYING.  If not, write to the
00021 |    Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
00022 |    02111-1307, USA.
00023 |
00024  ****************************************************************/
00025 
00026 /*
00027 Program Config Element
00028 
00029 One of the Syntactic Elements contained in the raw data blocks.
00030 
00031 Ref:
00032 4.4.1.1, Table 4.2
00033 4.5.2.1
00034 */
00035 
00036 #ifndef _MLO_ELEMENT_PCE_H_
00037 #define _MLO_ELEMENT_PCE_H_
00038 
00039 
00040 
00041 /*----------------------------------------------------------------------
00042 |       Includes
00043 +---------------------------------------------------------------------*/
00044 
00045 
00046 
00047 #include "MloSamplingFreq.h"
00048 #include "MloBitStream.h"
00049 #include "MloFrame.h"
00050 #include "MloTypes.h"
00051 
00052 
00053 
00054 /*----------------------------------------------------------------------
00055 |       Types
00056 +---------------------------------------------------------------------*/
00057 
00058 
00059 
00060 typedef enum MLO_ElementPce_MaxNbr
00061 {
00062    MLO_ELEMENT_PCE_MAX_NBR_FRONT_CHN_ELT  = 1 << 4,
00063    MLO_ELEMENT_PCE_MAX_NBR_SIDE_CHN_ELT   = 1 << 4,
00064    MLO_ELEMENT_PCE_MAX_NBR_BACK_CHN_ELT   = 1 << 4,
00065    MLO_ELEMENT_PCE_MAX_NBR_LFE_CHN_ELT    = 1 << 2,
00066    MLO_ELEMENT_PCE_MAX_NBR_ASSOC_DATA_ELT = 1 << 3,
00067    MLO_ELEMENT_PCE_MAX_NBR_VALID_CC_ELT   = 1 << 4
00068 }  MLO_ElementPce_MaxNbr;
00069 
00070 
00071 
00072 typedef struct MLO_ElementPce_TaggedElt
00073 {
00074    MLO_Boolean    is_cpe_flag;
00075    int            tag;
00076 }  MLO_ElementPce_TaggedElt;
00077 
00078 
00079 
00080 typedef struct MLO_ElementPce_Cce
00081 {
00082    MLO_Boolean    is_ind_sw_flag;
00083    int            tag;
00084 }  MLO_ElementPce_Cce;
00085 
00086 
00087 
00088 /* 4.4.1.1, Table 4.2 */
00089 typedef struct MLO_ElementPce
00090 {
00091    int            element_instance_tag;
00092    MLO_AacProfile object_type;
00093    MLO_SamplingFreq_Index
00094                   sampling_frequency_index;
00095    int            num_front_channel_elements;
00096    int            num_side_channel_elements;
00097    int            num_back_channel_elements;
00098    int            num_lfe_channel_elements;
00099    int            num_assoc_data_elements;
00100    int            num_valid_cc_elements;
00101    MLO_Boolean    mono_mixdown_present;
00102    int            mono_mixdown_element_number;
00103    MLO_Boolean    stereo_mixdown_present;
00104    int            stereo_mixdown_element_number;
00105    MLO_Boolean    matrix_mixdown_idx_present;
00106    int            matrix_mixdown_idx ;
00107    MLO_Boolean    pseudo_surround_enable;
00108    MLO_ElementPce_TaggedElt
00109                   front_element_arr [MLO_ELEMENT_PCE_MAX_NBR_FRONT_CHN_ELT];
00110    MLO_ElementPce_TaggedElt
00111                   side_element_arr [MLO_ELEMENT_PCE_MAX_NBR_SIDE_CHN_ELT];
00112    MLO_ElementPce_TaggedElt
00113                   back_element_arr [MLO_ELEMENT_PCE_MAX_NBR_BACK_CHN_ELT];
00114    int            lfe_element_tag_arr [MLO_ELEMENT_PCE_MAX_NBR_LFE_CHN_ELT];
00115    int            assoc_data_element_tag_arr [MLO_ELEMENT_PCE_MAX_NBR_ASSOC_DATA_ELT];
00116    MLO_ElementPce_Cce
00117                   cc_element_arr [MLO_ELEMENT_PCE_MAX_NBR_VALID_CC_ELT];
00118 }  MLO_ElementPce;
00119 
00120 
00121 
00122 /*----------------------------------------------------------------------
00123 |       Function prototypes
00124 +---------------------------------------------------------------------*/
00125 
00126 
00127 
00128 #ifdef __cplusplus
00129 extern "C" {
00130 #endif /* __cplusplus */
00131 
00132 
00133 
00134 MLO_Result  MLO_ElementPce_Decode (MLO_ElementPce *pce_ptr, MLO_BitStream *bit_ptr);
00135 
00136 
00137 
00138 #ifdef __cplusplus
00139 }
00140 #endif /* __cplusplus */
00141 
00142 
00143 
00144 #endif /* _MLO_ELEMENT_PCE_H_ */