Ignore:
Timestamp:
09/28/06 18:15:21 (18 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/src/mppenc.h

    r46 r60  
    3636#define X_MEM            1152
    3737
    38 // ans.c
    39 #define MAX_NS_ORDER        6                   // maximum order of the Adaptive Noise Shaping Filter (IIR)
    40 #define MAX_ANS_BANDS      16
    41 #define MAX_ANS_LINES    (32 * MAX_ANS_BANDS)   // maximum number of noiseshaped FFT-lines
    42 ///////// 16 * MAX_ANS_BANDS not sufficient? //////////////////
    43 #define MS2SPAT1             0.5f
    44 #define MS2SPAT2             0.25f
    45 #define MS2SPAT3             0.125f
    46 #define MS2SPAT4             0.0625f
    47 
    4838// bitstream.c
    4939#define BUFFER_ALMOST_FULL  8192
    5040#define BUFFER_FULL         (BUFFER_ALMOST_FULL + 4352)         // 34490 bit/frame  1320.3 kbps
    5141
    52 // cvd.c
    53 #define MAX_CVD_LINE      300                   // maximum FFT-Index for CVD
    54 #define CVD_UNPRED          0.040f              // unpredictability (cw) for CVD-detected bins, e33 (04)
    55 #define MIN_ANALYZED_IDX   12                   // maximum base-frequency = 44100/MIN_ANALYZED_IDX ^^^^^^
    56 #define MED_ANALYZED_IDX   50                   // maximum base-frequency = 44100/MED_ANALYZED_IDX ^^^^^^
    57 #define MAX_ANALYZED_IDX  900                   // minimum base-frequency = 44100/MAX_ANALYZED_IDX  (816 for Amnesia)
    58 
    59 // mppenc.h
    60 #define CENTER            448                   // offset for centering current data in Main-array
    61 #define BLOCK            1152                   // blocksize
    62 #define ANABUFFER    (BLOCK + CENTER)           // size of PCM-data array for analysis
    63 
    64 // psy.c
    65 #define SHORTFFT_OFFSET   168                   // fft-offset for short FFT's
    66 #define PREFAC_LONG        10                   // preecho-factor for long partitions
    67 
    68 // psy_tab.h
    69 #define PART_LONG          57                   // number of partitions for long
    70 #define PART_SHORT     (PART_LONG / 3)          // number of partitions for short
    71 #define MAX_SPL            20                   // maximum assumed Sound Pressure Level
    72 
    7342// quant.h
    7443#define SCFfac              0.832980664785f     // = SCF[n-1]/SCF[n]
    7544
    7645// wave_in.h
    77 
    78 
    79 // fast but maybe more inaccurate, use if you need speed
    80 #if defined(__GNUC__) && !defined(__APPLE__)
    81 #  define SIN(x)      sinf ((float)(x))
    82 #  define COS(x)      cosf ((float)(x))
    83 #  define ATAN2(x,y)  atan2f ((float)(x), (float)(y))
    84 #  define SQRT(x)     sqrtf ((float)(x))
    85 #  define LOG(x)      logf ((float)(x))
    86 #  define LOG10(x)    log10f ((float)(x))
    87 #  define POW(x,y)    expf (logf(x) * (y))
    88 #  define POW10(x)    expf (M_LN10 * (x))
    89 #  define FLOOR(x)    floorf ((float)(x))
    90 #  define IFLOOR(x)   (int) floorf ((float)(x))
    91 #  define FABS(x)     fabsf ((float)(x))
    92 #else
    93 # define SIN(x)      (float) sin (x)
    94 # define COS(x)      (float) cos (x)
    95 # define ATAN2(x,y)  (float) atan2 (x, y)
    96 # define SQRT(x)     (float) sqrt (x)
    97 # define LOG(x)      (float) log (x)
    98 # define LOG10(x)    (float) log10 (x)
    99 # define POW(x,y)    (float) pow (x,y)
    100 # define POW10(x)    (float) pow (10., (x))
    101 # define FLOOR(x)    (float) floor (x)
    102 # define IFLOOR(x)   (int)   floor (x)
    103 # define FABS(x)     (float) fabs (x)
    104 #endif
    105 
    106 #define SQRTF(x)      SQRT (x)
    107 #ifdef FAST_MATH
    108 # define TABSTEP      64
    109 # define COSF(x)      my_cos ((float)(x))
    110 # define ATAN2F(x,y)  my_atan2 ((float)(x), (float)(y))
    111 # define IFLOORF(x)   my_ifloor ((float)(x))
    112 #else
    113 # undef  TABSTEP
    114 # define COSF(x)      COS (x)
    115 # define ATAN2F(x,y)  ATAN2 (x,y)
    116 # define IFLOORF(x)   IFLOOR (x)
    117 #endif
    118 
    119 typedef struct {
    120     float  L [ANABUFFER];
    121     float  R [ANABUFFER];
    122     float  M [ANABUFFER];
    123     float  S [ANABUFFER];
    124 } PCMDataTyp;
    125 
    126 typedef struct {
    127     float  L [36];
    128     float  R [36];
    129 } SubbandFloatTyp;
    13046
    13147typedef struct {
     
    13349    unsigned int  R [36];
    13450} SubbandQuantTyp;
    135 
    136 typedef struct {
    137     float  L [32];
    138     float  R [32];
    139     float  M [32];
    140     float  S [32];
    141 } SMRTyp;
    14251
    14352typedef struct {
     
    207116void   rdft                ( const int, float*, int*, float* );
    208117void   Generate_FFT_Tables ( const int, int*, float* );
    209 
    210 
    211 // fft_routines.c
    212 void   Init_FFT      ( void );
    213 void   PowSpec256    ( const float*, float* );
    214 void   PowSpec1024   ( const float*, float* );
    215 void   PowSpec2048   ( const float*, float* );
    216 void   PolarSpec1024 ( const float*, float*, float* );
    217 void   Cepstrum2048  ( float* cep, const int );
    218118
    219119
Note: See TracChangeset for help on using the changeset viewer.