Index: mppenc/branches/r2d/src/mppdec.h
===================================================================
--- mppenc/branches/r2d/src/mppdec.h	(revision 67)
+++ mppenc/branches/r2d/src/mppdec.h	(revision 71)
@@ -1013,5 +1013,4 @@
 // huffsv7.c
 void       Init_Huffman_Decoder_SV7   ( void );
-void       Init_Huffman_Encoder_SV7   ( void );
 
 // huffsv46.c
Index: mppenc/branches/r2d/src/mppenc.c
===================================================================
--- mppenc/branches/r2d/src/mppenc.c	(revision 67)
+++ mppenc/branches/r2d/src/mppenc.c	(revision 71)
@@ -683,5 +683,4 @@
                 memcpy ( errorL [Band], errorL[Band] + 36, MAX_NS_ORDER * sizeof (**errorL) );
             }
-        } else {
         }
 
@@ -694,5 +693,4 @@
                 memcpy ( errorR [Band], errorR [Band] + 36, MAX_NS_ORDER * sizeof (**errorL) );
             }
-        } else {
         }
     }
@@ -1035,5 +1033,5 @@
 			if ( 2 != sscanf ( argv[k], "%f,%f", &(m->KBD1), &(m->KBD2) ))
                 { stderr_printf ( "%s: missing two arguments", arg ); return -1; }
-            Init_FFT ();
+            Init_FFT (m);
         }
         else if ( 0 == strcmp ( arg, "fadein") ) {                                      // FadeInTime
@@ -1592,12 +1590,14 @@
 
     // initialize tables which must be initialized once and only once
+
+	m.SCF_Index_L = (int*) SCF_Index_L;
+	m.SCF_Index_R = (int*) SCF_Index_R;
+
 #ifdef FAST_MATH
     Init_FastMath ();                           // check if something has to be done for each file !!
 #endif
     Init_SV7 ();
+	Init_Skalenfaktoren ();
 	Init_Psychoakustik (&m);
-	SetQualityParams (&m, 5.0);
-    Init_Psychoakustiktabellen (&m);
-	Init_Skalenfaktoren ();
 	Init_FPU ();
 	Init_ANS ();
@@ -1746,4 +1746,5 @@
     WriteHeader_SV7 ( &e, m.Max_Band, MainQual, m.MS_Channelmode > 0, LastValidFrame, LastValidSamples, PNS > 0 ? 0x17 : 0x07, m.SampleFreq );
 
+
     // initialize timer
     ShowProgress (&m, 0, SamplesInWAVE, e.BufferedBits );
@@ -1849,9 +1850,4 @@
         memmove ( Main.S, Main.S + BLOCK, CENTER * sizeof(float) );
 
-		if ( AllSamplesRead + BLOCK > SamplesInWAVE )
-		{
-			int n = 0;
-		}
-
         // read samples
         CurrentRead     = Read_WAV_Samples ( &Wave, (int)minf(BLOCK, SamplesInWAVE - AllSamplesRead), &Main, CENTER, ScalingFactorl, ScalingFactorr, &Silence );
Index: mppenc/branches/r2d/src/mppenc.h
===================================================================
--- mppenc/branches/r2d/src/mppenc.h	(revision 67)
+++ mppenc/branches/r2d/src/mppenc.h	(revision 71)
@@ -57,21 +57,4 @@
 } wave_t;
 
-// ans.c
-// extern unsigned int  NS_Order;                          // global Flag for Noise Shaping
-// extern unsigned int  NS_Order_L [32];
-// extern unsigned int  NS_Order_R [32];                   // order of the Adaptive Noiseshaping (0: off, 1...5: on)
-// extern float         FIR_L     [32] [MAX_NS_ORDER];
-// extern float         FIR_R     [32] [MAX_NS_ORDER];     // contains FIR-Filter for NoiseShaping
-// extern float         ANSspec_L [MAX_ANS_LINES];
-// extern float         ANSspec_R [MAX_ANS_LINES];         // L/R-masking threshold for ANS
-// extern float         ANSspec_M [MAX_ANS_LINES];
-// extern float         ANSspec_S [MAX_ANS_LINES];         // M/S-masking threshold for ANS
-
-
-// extern Uint32_t      Buffer [BUFFER_FULL];      // buffer for bitstream file (128 KB)
-// extern Uint32_t      dword;                     // 32 bit-Word for Bitstream-I/O
-// extern unsigned int  Zaehler;                   // position counter for processed bitstream word (32 bit)
-// extern UintMax_t     BufferedBits;              // counter for the number of written bits in the bitstream
-
 // FIXME : put in lib header
 void  FlushBitstream    ( FILE* fp, const mpc_uint32_t* buffer, size_t words32bit );
@@ -81,6 +64,5 @@
 void  GetBitstreamPos   ( mpc_encoder_t*, BitstreamPos* const pos );
 
-// cvd.c
-int    CVD2048 ( PsyModel*, const float*, int* );
+void   Init_FFT      ( PsyModel* );
 
 
@@ -91,9 +73,4 @@
 extern const float  tabsqrt_ex [];
 extern const float  tabsqrt_m  [] [2];
-
-
-// fft4g.c
-void   rdft                ( const int, float*, int*, float* );
-void   Generate_FFT_Tables ( const int, int*, float* );
 
 // FIXME : put in lib header
@@ -111,16 +88,4 @@
 void   Analyse_Init ( float Left, float Right, SubbandFloatTyp* out, const int MaxBand );
 void   Klemm ( void );
-
-// psy_tab.c
-extern float        fftLtq   [512];             // threshold in quiet (FFT)
-extern float        partLtq  [PART_LONG];       // threshold in quiet (Partitions)
-extern float        invLtq   [PART_LONG];       // inverse threshold in quiet (Partitions, long)
-extern float        Loudness [PART_LONG];       // weighting factors for calculation of loudness
-extern float        MinVal   [PART_LONG];       // minimum quality that's adapted to the model, minval for long
-extern float        SPRD     [PART_LONG] [PART_LONG]; // tabulated spreading function
-extern float        O_MAX;
-extern float        O_MIN;
-extern float        FAC1;
-extern float        FAC2;     // constants to calculate the used offset
 
 extern const float  Butfly    [7];              // Antialiasing to calculate the subband powers
