MloTns.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 Temporal Noise Shaping (TNS)
00028 
00029 Ref:
00030 4.4.2.7, Table 4.48
00031 4.6.9
00032 */
00033 
00034 #ifndef _MLO_TNS_H_
00035 #define _MLO_TNS_H_
00036 
00037 
00038 
00039 /*----------------------------------------------------------------------
00040 |       Includes
00041 +---------------------------------------------------------------------*/
00042 
00043 
00044 
00045 #include "MloBitStream.h"
00046 #include "MloDefs.h"
00047 #include "MloIcsInfo.h"
00048 #include "MloTypes.h"
00049 
00050 
00051 
00052 /*----------------------------------------------------------------------
00053 |       Constants
00054 +---------------------------------------------------------------------*/
00055 
00056 
00057 
00058 /* 4.6.9.4, Table 4.137 */
00059 enum {   MLO_TNS_MAX_ORDER = 12   };
00060 
00061 /* 4.4.2.7, Table 4.48 */
00062 enum {   MLO_TNS_MAX_COEF_RES = 4   };
00063 
00064 
00065 
00066 /*----------------------------------------------------------------------
00067 |       Types
00068 +---------------------------------------------------------------------*/
00069 
00070 
00071 
00072 /* Forward declaration */
00073 struct MLO_IndivChnStream;
00074 
00075 
00076 
00077 typedef struct MLO_Tns_Filter
00078 {
00079    MLO_UInt8      length;
00080    MLO_UInt8      order;
00081    MLO_UInt8      direction;
00082    MLO_UInt8      compress;
00083    MLO_UInt8      coef [MLO_TNS_MAX_ORDER];
00084 } MLO_Tns_Filter;
00085 
00086 
00087 
00088 /* For a single window */
00089 typedef struct MLO_Tns_Window
00090 {
00091    int            n_filt;
00092    int            coef_res;
00093    MLO_Tns_Filter filter [4];
00094 }  MLO_Tns_Window;
00095 
00096 
00097 
00098 typedef struct MLO_Tns
00099 {
00100    MLO_Tns_Window win_arr [MLO_DEFS_MAX_NBR_WINDOWS];   /* [win] */
00101 }  MLO_Tns;
00102 
00103 
00104 
00105 /*----------------------------------------------------------------------
00106 |       Function prototypes
00107 +---------------------------------------------------------------------*/
00108 
00109 
00110 
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif /* __cplusplus */
00114 
00115 
00116 
00117 void  MLO_Tns_Decode (MLO_Tns *tns_ptr, const MLO_IcsInfo *ics_info_ptr, MLO_BitStream *bit_ptr);
00118 void  MLO_Tns_Process (struct MLO_IndivChnStream *ics_ptr);
00119 
00120 
00121 
00122 #ifdef __cplusplus
00123 }
00124 #endif /* __cplusplus */
00125 
00126 
00127 
00128 #endif /* _MLO_TNS_H_ */