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 Scaling of spectral data 00028 00029 Ref: 00030 4.6.2 00031 */ 00032 00033 #ifndef _MLO_SCALE_FACTOR_H_ 00034 #define _MLO_SCALE_FACTOR_H_ 00035 00036 00037 00038 /*---------------------------------------------------------------------- 00039 | Includes 00040 +---------------------------------------------------------------------*/ 00041 00042 #include "MloBitStream.h" 00043 #include "MloDefs.h" 00044 #include "MloIcsInfo.h" 00045 #include "MloResults.h" 00046 #include "MloSectionData.h" 00047 #include "MloTypes.h" 00048 00049 00050 00051 /*---------------------------------------------------------------------- 00052 | Constants 00053 +---------------------------------------------------------------------*/ 00054 00055 00056 00057 #define MLO_ERROR_SCALE_FACTOR_RANGE (MLO_ERROR_BASE_SCALE_FACTOR-0) 00058 00059 /* Scale Factor value for 0 dB */ 00060 enum { MLO_SCALE_FACTOR_UNITY_GAIN = 100 }; 00061 enum { MLO_SCALE_FACTOR_MIN_VAL = 0 }; 00062 enum { MLO_SCALE_FACTOR_MAX_VAL = 255 }; 00063 00064 00065 00066 /*---------------------------------------------------------------------- 00067 | Types 00068 +---------------------------------------------------------------------*/ 00069 00070 00071 00072 typedef struct MLO_ScaleFactor 00073 { 00074 /* For noise/intensity: array directly contains final 00075 noise_nrg/is_position values. */ 00076 MLO_UInt16 scale_factors [MLO_DEFS_MAX_NBR_WIN_GRP] [MLO_DEFS_MAX_NUM_SWB]; 00077 } MLO_ScaleFactor; 00078 00079 00080 00081 /*---------------------------------------------------------------------- 00082 | Function prototypes 00083 +---------------------------------------------------------------------*/ 00084 00085 00086 00087 #ifdef __cplusplus 00088 extern "C" { 00089 #endif /* __cplusplus */ 00090 00091 00092 00093 MLO_Result MLO_ScaleFactor_Decode (MLO_ScaleFactor *sf_ptr, const MLO_IcsInfo *ics_ptr, const MLO_SectionData *sec_ptr, MLO_BitStream *bit_ptr, int global_gain); 00094 void MLO_ScaleFactor_ScaleCoefficients (const MLO_ScaleFactor *sf_ptr, const MLO_IcsInfo *ics_ptr, MLO_Float coef_ptr []); 00095 MLO_Float MLO_ScaleFactor_ComputeGain (int sf); 00096 00097 00098 00099 #ifdef __cplusplus 00100 } 00101 #endif /* __cplusplus */ 00102 00103 00104 00105 #endif /* _MLO_SCALE_FACTOR_H_ */