MloIcsInfo.h

00001 /*
00002 Individual Channel Stream information
00003 
00004 Ref:
00005 4.4.2.1, Table 4.6
00006 4.5.2.3
00007 */
00008 
00009 #ifndef _MLO_ICS_INFO_H_
00010 #define _MLO_ICS_INFO_H_
00011 
00012 
00013 
00014 /*----------------------------------------------------------------------
00015 |       Includes
00016 +---------------------------------------------------------------------*/
00017 
00018 
00019 
00020 #include "MloSamplingFreq.h"
00021 #include "MloBitStream.h"
00022 #include "MloDefs.h"
00023 #include "MloFloat.h"
00024 #include "MloTypes.h"
00025 
00026 
00027 
00028 /*----------------------------------------------------------------------
00029 |       Constants
00030 +---------------------------------------------------------------------*/
00031 
00032 
00033 
00034 #define  MLO_ERROR_LTP_IN_LC        (MLO_ERROR_BASE_ICS_INFO-0)
00035 #define  MLO_ERROR_UNSUPPORTED_SFI  (MLO_ERROR_BASE_ICS_INFO-1)
00036 
00037 
00038 
00039 /*----------------------------------------------------------------------
00040 |       Types
00041 +---------------------------------------------------------------------*/
00042 
00043 
00044 
00045 /* 4.5.4, Table 4.109 */
00046 typedef enum MLO_IcsInfo_WinSeq
00047 {
00048    MLO_ICS_INFO_WIN_ONLY_LONG_SEQUENCE = 0,
00049    MLO_ICS_INFO_WIN_LONG_START_SEQUENCE,
00050    MLO_ICS_INFO_WIN_EIGHT_SHORT_SEQUENCE,
00051    MLO_ICS_INFO_WIN_LONG_STOP_SEQUENCE
00052 }  MLO_IcsInfo_WinSeq;
00053 
00054 
00055 
00056 /* 4.6.11.3.2 */
00057 typedef enum MLO_IcsInfo_WindowShape
00058 {
00059    MLO_ICS_INFO_WINDOW_SHAPE_SINE = 0,
00060    MLO_ICS_INFO_WINDOW_SHAPE_KAISER,
00061 
00062    MLO_ICS_INFO_WINDOW_SHAPE_NBR_ELT
00063 }  MLO_IcsInfo_WindowShape;
00064 
00065 /* Shape information for previous and current frame */
00066 typedef enum MLO_IcsInfo_WSIndex
00067 {
00068    MLO_IcsInfo_WSIndex_PREV = 0,
00069    MLO_IcsInfo_WSIndex_CUR,
00070 
00071    MLO_IcsInfo_WSIndex_NBR_ELT
00072 }  MLO_IcsInfo_WSIndex;
00073 
00074 
00075 
00076 /* 4.4.2.1, Table 4.6 */
00077 typedef struct MLO_IcsInfo
00078 {
00079    MLO_SamplingFreq_Index
00080                   fs_index;
00081 
00082    /* Read data */
00083    MLO_IcsInfo_WinSeq
00084                   window_sequence;
00085    MLO_IcsInfo_WindowShape
00086                   window_shape [MLO_IcsInfo_WSIndex_NBR_ELT];
00087    int            max_sfb;
00088    int            scale_factor_grouping;
00089 
00090    /* Calculated data: window grouping info */
00091    int            num_windows;
00092    int            num_window_groups;
00093    int            num_swb;             /* Max: 51 */
00094    MLO_UInt8      window_group_length [MLO_DEFS_MAX_NBR_WIN_GRP];
00095    MLO_UInt16     swb_offset [MLO_DEFS_MAX_NUM_SWB + 1]; /* Array size: maximum size from the swb_offset tables */
00096    MLO_UInt16     sect_sfb_offset [MLO_DEFS_MAX_NBR_WIN_GRP] [MLO_DEFS_MAX_NUM_SWB + 1];
00097 
00098 }  MLO_IcsInfo;
00099 
00100 
00101 
00102 /*----------------------------------------------------------------------
00103 |       Function prototypes
00104 +---------------------------------------------------------------------*/
00105 
00106 
00107 
00108 #ifdef __cplusplus
00109 extern "C" {
00110 #endif /* __cplusplus */
00111 
00112 
00113 
00114 void  MLO_IcsInfo_ClearBuffers (MLO_IcsInfo *ics_ptr);
00115 
00116 MLO_Result  MLO_IcsInfo_Decode (MLO_IcsInfo *ics_ptr, MLO_BitStream *bit_ptr, MLO_SamplingFreq_Index fs_index);
00117 
00118 void  MLO_IcsInfo_DeinterleaveCoefficients (const MLO_IcsInfo *ics_ptr, MLO_Float coef_ptr []);
00119 
00120 
00121 
00122 #ifdef __cplusplus
00123 }
00124 #endif /* __cplusplus */
00125 
00126 
00127 
00128 #endif /* _MLO_ICS_INFO_H_ */