Ignore:
Timestamp:
09/28/06 18:15:21 (16 years ago)
Author:
r2d
Message:

added a PsyModel struct, too much members in it. some will be removed later

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mppenc/branches/r2d/libmpcpsy/ans.c

    r59 r60  
    2828 */
    2929
    30 #include "mppenc.h"
     30#include "libmpcpsy.h"
     31
     32#include <math.h>
     33#include <string.h>
    3134
    3235
     
    3437static float  Cos_Tab    [16] [MAX_NS_ORDER + 1];
    3538static float  Sin_Tab    [16] [MAX_NS_ORDER + 1];
    36 unsigned int  NS_Order;                         // Maximum order for ANS
    37 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 NoiseShaping
    41 float         ANSspec_L  [MAX_ANS_LINES];
    42 float         ANSspec_R  [MAX_ANS_LINES];       // L/R-masking thresholds for ANS
    43 float         ANSspec_M  [MAX_ANS_LINES];
    44 float         ANSspec_S  [MAX_ANS_LINES];       // M/S-masking thresholds for ANS
    4539
    4640
     
    184178    const float*  tmp;
    185179
    186     ENTER(235);
    187180    for ( Band = 0; Band <= MaxBand  &&  maxANSOrder[Band]; Band++ ) {
    188181
     
    275268    }
    276269
    277     LEAVE(235);
    278270    return;
    279271}
     
    282274// perform ANS-analysis (calculation of FIR-filter and gain)
    283275void
    284 NS_Analyse ( const int             MaxBand,
     276NS_Analyse ( PsyModel* m,
     277                         const int             MaxBand,
    285278             const unsigned char*  MSflag,
    286279             const SMRTyp          smr,
    287280             const int*            Transient )
    288281{
    289     ENTER(10);
    290282
    291283    // for L or M, respectively
    292     memset ( FIR_L,      0, sizeof FIR_L      );         // reset FIR
    293     memset ( NS_Order_L, 0, sizeof NS_Order_L );         // reset Flags
    294     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 );
    295287
    296288    // 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
    302293    return;
    303294}
Note: See TracChangeset for help on using the changeset viewer.