Index: mppenc/branches/r2d/libmpcpsy/psy.c
===================================================================
--- mppenc/branches/r2d/libmpcpsy/psy.c	(revision 74)
+++ mppenc/branches/r2d/libmpcpsy/psy.c	(revision 76)
@@ -124,4 +124,6 @@
 void   Cepstrum2048  ( float* cep, const int );
 
+void   Init_ANS   ( void );
+
 // Resets Arrays
 void Init_Psychoakustik ( PsyModel* m)
@@ -154,4 +156,6 @@
 	Init_FFT (m);
 
+	Init_ANS ();
+
 	Init_Psychoakustiktabellen (m);
 
@@ -304,18 +308,4 @@
     float         e1;
 
-
-#if 000000
-    for ( n = 0; n < PART_LONG; n++ ) {
-        k  = wh[n] - wl[n];
-        e0 = *spec0++;
-        e1 = *spec1++;
-        while ( k-- ) {
-            e0 += *spec0++;
-            e1 += *spec1++;
-        }
-        *erg0++ = e0;
-        *erg1++ = e1;
-    }
-#else
     n = 0;
 
@@ -355,8 +345,4 @@
         *erg1++ = e1;
     }
-
-#endif
-
-    return;
 }
 
@@ -377,18 +363,4 @@
     float         e1;
 
-
-#if 000000
-    for ( n = 0; n < PART_LONG; n++ ) {
-        e0 = *spec0++ * *cw0++;
-        e1 = *spec1++ * *cw1++;
-        k  = wh[n] - wl[n];
-        while ( k-- ) {
-            e0 += *spec0++ * *cw0++;
-            e1 += *spec1++ * *cw1++;
-        }
-        *erg0++ = e0;
-        *erg1++ = e1;
-    }
-#else
     n = 0;
 
@@ -428,7 +400,4 @@
         *erg1++ = e1;
     }
-#endif
-
-    return;
 }
 
@@ -824,9 +793,4 @@
     for ( n = 0; n < PART_LONG; n++ ) {
         for ( k = wl[n]; k <= wh[n]; k++, thr0++, thr1++ ) {    // threshold in quiet (Partition)
-#if 0
-            ltq   = AdaptedLTQ * fftLtq [k];
-            *thr0 = maxf ( partThr0 [n], ltq );
-            *thr1 = maxf ( partThr1 [n], ltq );
-#else
             // Applies a much more gentle ATH rolloff + 6 dB more dynamic
             ltq   = sqrt (ms * fftLtq [k]);
@@ -835,5 +799,4 @@
             tmp   = sqrt (partThr1 [n]) + ltq;
             *thr1 = tmp * tmp;
-#endif
         }
     }
@@ -878,51 +841,4 @@
 // output: masking threshold *thr in short partitions
 //         Energy of the last short block *preerg in short partitions
-#if 0
-static void
-CalcShortThreshold ( const float  erg [] [128],
-                     const float  PreechoFac,
-                     float*       thr,
-                     float        preerg[2][PART_SHORT],
-                     int*         transient )
-{
-    const int*    lo     = wl_short; // lower FFT-index
-    const int*    hi     = wh_short; // upper FFT-index
-    const float*  iwidth = iw_short; // inverse partition-width
-    int           k;
-    int           n;
-    int           m;
-    float         tmp;
-    float         enrg;
-    float         th;
-    const float*  ep;
-
-    for ( k = 0; k < PART_SHORT; k++, lo++, hi++ ) {
-        transient[k] = 0;
-        th           = 1.e20f;
-        for ( n = 0; n < 4; n++ ) {
-            ep   = erg[n] + *lo;
-            m    = *hi - *lo;
-            enrg = *ep++;
-            while (m--)
-                enrg += *ep++;
-
-            // preecho prevention
-            tmp     = enrg;
-            if (preerg[0][k] < enrg)
-                enrg = preerg[0][k];
-            preerg[0][k] = tmp;
-
-            // is signal transient?
-            if (tmp > TransDetect*enrg) transient[k] = 1;
-
-            // assume short threshold = engr*PreechoFac
-            th    = minf (th, enrg*PreechoFac);
-        }
-        thr[k] = th * *iwidth++;
-    }
-
-    return;
-}
-#else
 static void
 CalcShortThreshold ( PsyModel* m,
@@ -972,6 +888,4 @@
     return;
 }
-
-#endif
 
 // input : previous simultaneous masking threshold *preThr,
