Changeset 60 for mppenc/branches/r2d/libmpcpsy/ans.c
- Timestamp:
- 09/28/06 18:15:21 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mppenc/branches/r2d/libmpcpsy/ans.c
r59 r60 28 28 */ 29 29 30 #include "mppenc.h" 30 #include "libmpcpsy.h" 31 32 #include <math.h> 33 #include <string.h> 31 34 32 35 … … 34 37 static float Cos_Tab [16] [MAX_NS_ORDER + 1]; 35 38 static float Sin_Tab [16] [MAX_NS_ORDER + 1]; 36 unsigned int NS_Order; // Maximum order for ANS37 unsigned int NS_Order_L [32];38 unsigned int NS_Order_R [32]; // frame-wise order of the Noiseshaping (0: off, 1...5: on)39 float FIR_L [32] [MAX_NS_ORDER];40 float FIR_R [32] [MAX_NS_ORDER]; // contains FIR-Filter for NoiseShaping41 float ANSspec_L [MAX_ANS_LINES];42 float ANSspec_R [MAX_ANS_LINES]; // L/R-masking thresholds for ANS43 float ANSspec_M [MAX_ANS_LINES];44 float ANSspec_S [MAX_ANS_LINES]; // M/S-masking thresholds for ANS45 39 46 40 … … 184 178 const float* tmp; 185 179 186 ENTER(235);187 180 for ( Band = 0; Band <= MaxBand && maxANSOrder[Band]; Band++ ) { 188 181 … … 275 268 } 276 269 277 LEAVE(235);278 270 return; 279 271 } … … 282 274 // perform ANS-analysis (calculation of FIR-filter and gain) 283 275 void 284 NS_Analyse ( const int MaxBand, 276 NS_Analyse ( PsyModel* m, 277 const int MaxBand, 285 278 const unsigned char* MSflag, 286 279 const SMRTyp smr, 287 280 const int* Transient ) 288 281 { 289 ENTER(10);290 282 291 283 // for L or M, respectively 292 memset ( FIR_L, 0, sizeofFIR_L ); // reset FIR293 memset ( NS_Order_L, 0, sizeofNS_Order_L ); // reset Flags294 FindOptimalANS ( MaxBand, MSflag, ANSspec_L, ANSspec_M, NS_Order_L, SNR_comp_L, FIR_L, smr.L, smr.M,SCF_Index_L, Transient );284 memset ( m->FIR_L, 0, sizeof m->FIR_L ); // reset FIR 285 memset ( m->NS_Order_L, 0, sizeof m->NS_Order_L ); // reset Flags 286 FindOptimalANS ( MaxBand, MSflag, m->ANSspec_L, m->ANSspec_M, m->NS_Order_L, m->SNR_comp_L, m->FIR_L, smr.L, smr.M, m->SCF_Index_L, Transient ); 295 287 296 288 // for R or S, respectively 297 memset ( FIR_R, 0, sizeof FIR_R ); // reset FIR 298 memset ( NS_Order_R, 0, sizeof NS_Order_R ); // reset Flags 299 FindOptimalANS ( MaxBand, MSflag, ANSspec_R, ANSspec_S, NS_Order_R, SNR_comp_R, FIR_R, smr.R, smr.S, SCF_Index_R, Transient ); 300 301 LEAVE(10); 289 memset ( m->FIR_R, 0, sizeof m->FIR_R ); // reset FIR 290 memset ( m->NS_Order_R, 0, sizeof m->NS_Order_R ); // reset Flags 291 FindOptimalANS ( MaxBand, MSflag, m->ANSspec_R, m->ANSspec_S, m->NS_Order_R, m->SNR_comp_R, m->FIR_R, smr.R, smr.S, m->SCF_Index_R, Transient ); 292 302 293 return; 303 294 }
Note: See TracChangeset
for help on using the changeset viewer.