MloIndivChnStream.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 Individual Channel Stream
00028 
00029 Ref:
00030 4.4.2.7, Table 4.44
00031 4.5.2.3
00032 */
00033 
00034 #ifndef _MLO_INDIV_CHN_STREAM_H_
00035 #define _MLO_INDIV_CHN_STREAM_H_
00036 
00037 
00038 
00039 /*----------------------------------------------------------------------
00040 |       Includes
00041 +---------------------------------------------------------------------*/
00042 
00043 
00044 
00045 #include "MloSamplingFreq.h"
00046 #include "MloBitStream.h"
00047 #include "MloDefs.h"
00048 #include "MloFloat.h"
00049 #include "MloIcsInfo.h"
00050 #include "MloScaleFactor.h"
00051 #include "MloSectionData.h"
00052 #include "MloTns.h"
00053 #include "MloTypes.h"
00054 
00055 
00056 
00057 /*----------------------------------------------------------------------
00058 |       Constants
00059 +---------------------------------------------------------------------*/
00060 
00061 
00062 
00063 #define  MLO_ERROR_GC_IN_LC            (MLO_ERROR_BASE_INDIV_CHN_STREAM-0)
00064 #define  MLO_ERROR_PULSE_SFB_RANGE     (MLO_ERROR_BASE_INDIV_CHN_STREAM-1)
00065 #define  MLO_ERROR_TOO_MANY_PULSES     (MLO_ERROR_BASE_INDIV_CHN_STREAM-2)
00066 
00067 
00068 
00069 /*----------------------------------------------------------------------
00070 |       Types
00071 +---------------------------------------------------------------------*/
00072 
00073 
00074 
00075 typedef struct MLO_IndivChnStream_Pulse
00076 {
00077    MLO_UInt8      offset;
00078    MLO_UInt8      amp;
00079 }  MLO_IndivChnStream_Pulse;
00080 
00081 
00082 
00083 typedef struct MLO_IndivChnStream
00084 {
00085    int            global_gain;
00086    MLO_IcsInfo    ics_info;
00087    MLO_Boolean    pulse_data_present_flag;
00088    MLO_Boolean    tns_data_present_flag;
00089 
00090    /* Section data */
00091    MLO_SectionData
00092                   section_data;
00093 
00094    /* Scale factors */
00095    MLO_ScaleFactor
00096                   sf_data;
00097 
00098    /* Pulse */
00099    int            number_pulse;
00100    int            pulse_start_sfb;
00101    MLO_IndivChnStream_Pulse
00102                   pulse [4];
00103 
00104    /* Temporal Noise Shapping */
00105    MLO_Tns        tns;
00106 
00107    /* Spectral coefficients */
00108    MLO_Int16      data [MLO_DEFS_FRAME_LEN_LONG];
00109    /* sfb/win are interleaved until the end of the decoding and inverse quantisation part. */
00110    MLO_Float      coef_arr [MLO_DEFS_FRAME_LEN_LONG];    /* Hosts spectral coefficients during the spectral processing, and time samples after filterbank processing */
00111    MLO_Float      prev_frame [MLO_DEFS_FRAME_LEN_LONG];  /* Samples of the previous frame */
00112 
00113 }  MLO_IndivChnStream;
00114 
00115 
00116 
00117 /*----------------------------------------------------------------------
00118 |       Function prototypes
00119 +---------------------------------------------------------------------*/
00120 
00121 
00122 
00123 #ifdef __cplusplus
00124 extern "C" {
00125 #endif /* __cplusplus */
00126 
00127 
00128 
00129 void  MLO_IndivChnStream_ClearBuffers (MLO_IndivChnStream *ics_ptr);
00130 MLO_Result  MLO_IndivChnStream_Decode (MLO_IndivChnStream *ics_ptr, MLO_BitStream *bit_ptr, MLO_Boolean common_win_flag, MLO_Boolean scale_flag, MLO_SamplingFreq_Index fs_index);
00131 
00132 
00133 
00134 #ifdef __cplusplus
00135 }
00136 #endif /* __cplusplus */
00137 
00138 
00139 
00140 #endif /* _MLO_INDIV_CHN_STREAM_H_ */