Ignore:
Timestamp:
10/17/06 13:52:34 (18 years ago)
Author:
r2d
Message:
  • removed tools.c
File:
1 edited

Legend:

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

    r74 r76  
    124124void   Cepstrum2048  ( float* cep, const int );
    125125
     126void   Init_ANS   ( void );
     127
    126128// Resets Arrays
    127129void Init_Psychoakustik ( PsyModel* m)
     
    154156        Init_FFT (m);
    155157
     158        Init_ANS ();
     159
    156160        Init_Psychoakustiktabellen (m);
    157161
     
    304308    float         e1;
    305309
    306 
    307 #if 000000
    308     for ( n = 0; n < PART_LONG; n++ ) {
    309         k  = wh[n] - wl[n];
    310         e0 = *spec0++;
    311         e1 = *spec1++;
    312         while ( k-- ) {
    313             e0 += *spec0++;
    314             e1 += *spec1++;
    315         }
    316         *erg0++ = e0;
    317         *erg1++ = e1;
    318     }
    319 #else
    320310    n = 0;
    321311
     
    355345        *erg1++ = e1;
    356346    }
    357 
    358 #endif
    359 
    360     return;
    361347}
    362348
     
    377363    float         e1;
    378364
    379 
    380 #if 000000
    381     for ( n = 0; n < PART_LONG; n++ ) {
    382         e0 = *spec0++ * *cw0++;
    383         e1 = *spec1++ * *cw1++;
    384         k  = wh[n] - wl[n];
    385         while ( k-- ) {
    386             e0 += *spec0++ * *cw0++;
    387             e1 += *spec1++ * *cw1++;
    388         }
    389         *erg0++ = e0;
    390         *erg1++ = e1;
    391     }
    392 #else
    393365    n = 0;
    394366
     
    428400        *erg1++ = e1;
    429401    }
    430 #endif
    431 
    432     return;
    433402}
    434403
     
    824793    for ( n = 0; n < PART_LONG; n++ ) {
    825794        for ( k = wl[n]; k <= wh[n]; k++, thr0++, thr1++ ) {    // threshold in quiet (Partition)
    826 #if 0
    827             ltq   = AdaptedLTQ * fftLtq [k];
    828             *thr0 = maxf ( partThr0 [n], ltq );
    829             *thr1 = maxf ( partThr1 [n], ltq );
    830 #else
    831795            // Applies a much more gentle ATH rolloff + 6 dB more dynamic
    832796            ltq   = sqrt (ms * fftLtq [k]);
     
    835799            tmp   = sqrt (partThr1 [n]) + ltq;
    836800            *thr1 = tmp * tmp;
    837 #endif
    838801        }
    839802    }
     
    878841// output: masking threshold *thr in short partitions
    879842//         Energy of the last short block *preerg in short partitions
    880 #if 0
    881 static void
    882 CalcShortThreshold ( const float  erg [] [128],
    883                      const float  PreechoFac,
    884                      float*       thr,
    885                      float        preerg[2][PART_SHORT],
    886                      int*         transient )
    887 {
    888     const int*    lo     = wl_short; // lower FFT-index
    889     const int*    hi     = wh_short; // upper FFT-index
    890     const float*  iwidth = iw_short; // inverse partition-width
    891     int           k;
    892     int           n;
    893     int           m;
    894     float         tmp;
    895     float         enrg;
    896     float         th;
    897     const float*  ep;
    898 
    899     for ( k = 0; k < PART_SHORT; k++, lo++, hi++ ) {
    900         transient[k] = 0;
    901         th           = 1.e20f;
    902         for ( n = 0; n < 4; n++ ) {
    903             ep   = erg[n] + *lo;
    904             m    = *hi - *lo;
    905             enrg = *ep++;
    906             while (m--)
    907                 enrg += *ep++;
    908 
    909             // preecho prevention
    910             tmp     = enrg;
    911             if (preerg[0][k] < enrg)
    912                 enrg = preerg[0][k];
    913             preerg[0][k] = tmp;
    914 
    915             // is signal transient?
    916             if (tmp > TransDetect*enrg) transient[k] = 1;
    917 
    918             // assume short threshold = engr*PreechoFac
    919             th    = minf (th, enrg*PreechoFac);
    920         }
    921         thr[k] = th * *iwidth++;
    922     }
    923 
    924     return;
    925 }
    926 #else
    927843static void
    928844CalcShortThreshold ( PsyModel* m,
     
    972888    return;
    973889}
    974 
    975 #endif
    976890
    977891// input : previous simultaneous masking threshold *preThr,
Note: See TracChangeset for help on using the changeset viewer.