src/main/java/net/sourceforge/jaad/aac/sbr/DCT.java
private static void fft_dif(float[] Real, float[] Imag) {
		float w_real, w_imag; // For faster access
		float point1_real, point1_imag, point2_real, point2_imag; // For faster access
		int j, i, i2, w_index; // Counters

		// First 2 stages of 32 point FFT decimation in frequency
		// 4*16*2=64*2=128 multiplications
		// 6*16*2=96*2=192 additions
		// Stage 1 of 32 point FFT decimation in frequency
		for(i = 0; i<16; i++) {
			point1_real = Real[i];
			point1_imag = Imag[i];
			i2 = i+16;
			point2_real = Real[i2];
			point2_imag = Imag[i2];

			w_real = w_array_real[i];
			w_imag = w_array_imag[i];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = ((point1_real*w_real)-(point1_imag*w_imag));
			Imag[i2] = ((point1_real*w_imag)+(point1_imag*w_real));
		}
		// Stage 2 of 32 point FFT decimation in frequency
		for(j = 0, w_index = 0; j<8; j++, w_index += 2) {
			w_real = w_array_real[w_index];
			w_imag = w_array_imag[w_index];

			i = j;
			point1_real = Real[i];
			point1_imag = Imag[i];
			i2 = i+8;
			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = ((point1_real*w_real)-(point1_imag*w_imag));
			Imag[i2] = ((point1_real*w_imag)+(point1_imag*w_real));

			i = j+16;
			point1_real = Real[i];
			point1_imag = Imag[i];
			i2 = i+8;
			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = ((point1_real*w_real)-(point1_imag*w_imag));
			Imag[i2] = ((point1_real*w_imag)+(point1_imag*w_real));
		}

		// Stage 3 of 32 point FFT decimation in frequency
		// 2*4*2=16 multiplications
		// 4*4*2+6*4*2=10*8=80 additions
		for(i = 0; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// out[i1] = point1 + point2
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// out[i2] = point1 - point2
			Real[i2] = point1_real-point2_real;
			Imag[i2] = point1_imag-point2_imag;
		}
		w_real = w_array_real[4]; // = sqrt(2)/2
		// w_imag = -w_real; // = w_array_imag[4]; // = -sqrt(2)/2
		for(i = 1; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = (point1_real+point1_imag)*w_real;
			Imag[i2] = (point1_imag-point1_real)*w_real;
		}
		for(i = 2; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// x[i] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * (-i)
			Real[i2] = point1_imag-point2_imag;
			Imag[i2] = point2_real-point1_real;
		}
		w_real = w_array_real[12]; // = -sqrt(2)/2
		// w_imag = w_real; // = w_array_imag[12]; // = -sqrt(2)/2
		for(i = 3; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = (point1_real-point1_imag)*w_real;
			Imag[i2] = (point1_real+point1_imag)*w_real;
		}

		// Stage 4 of 32 point FFT decimation in frequency (no multiplications)
		// 16*4=64 additions
		for(i = 0; i<n; i += 4) {
			i2 = i+2;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = x[i] - x[i2]
			Real[i2] = point1_real-point2_real;
			Imag[i2] = point1_imag-point2_imag;
		}
		for(i = 1; i<n; i += 4) {
			i2 = i+2;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// x[i] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * (-i)
			Real[i2] = point1_imag-point2_imag;
			Imag[i2] = point2_real-point1_real;
		}

		// Stage 5 of 32 point FFT decimation in frequency (no multiplications)
		// 16*4=64 additions
		for(i = 0; i<n; i += 2) {
			i2 = i+1;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// out[i1] = point1 + point2
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// out[i2] = point1 - point2
			Real[i2] = point1_real-point2_real;
			Imag[i2] = point1_imag-point2_imag;
		}

		//FFTReorder(Real, Imag);
	}
private static void fft_dif(float[] Real, float[] Imag) {
		float w_real, w_imag; // For faster access
		float point1_real, point1_imag, point2_real, point2_imag; // For faster access
		int j, i, i2, w_index; // Counters

		// First 2 stages of 32 point FFT decimation in frequency
		// 4*16*2=64*2=128 multiplications
		// 6*16*2=96*2=192 additions
		// Stage 1 of 32 point FFT decimation in frequency
		for(i = 0; i<16; i++) {
			point1_real = Real[i];
			point1_imag = Imag[i];
			i2 = i+16;
			point2_real = Real[i2];
			point2_imag = Imag[i2];

			w_real = w_array_real[i];
			w_imag = w_array_imag[i];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = ((point1_real*w_real)-(point1_imag*w_imag));
			Imag[i2] = ((point1_real*w_imag)+(point1_imag*w_real));
		}
		// Stage 2 of 32 point FFT decimation in frequency
		for(j = 0, w_index = 0; j<8; j++, w_index += 2) {
			w_real = w_array_real[w_index];
			w_imag = w_array_imag[w_index];

			i = j;
			point1_real = Real[i];
			point1_imag = Imag[i];
			i2 = i+8;
			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = ((point1_real*w_real)-(point1_imag*w_imag));
			Imag[i2] = ((point1_real*w_imag)+(point1_imag*w_real));

			i = j+16;
			point1_real = Real[i];
			point1_imag = Imag[i];
			i2 = i+8;
			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = ((point1_real*w_real)-(point1_imag*w_imag));
			Imag[i2] = ((point1_real*w_imag)+(point1_imag*w_real));
		}

		// Stage 3 of 32 point FFT decimation in frequency
		// 2*4*2=16 multiplications
		// 4*4*2+6*4*2=10*8=80 additions
		for(i = 0; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// out[i1] = point1 + point2
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// out[i2] = point1 - point2
			Real[i2] = point1_real-point2_real;
			Imag[i2] = point1_imag-point2_imag;
		}
		w_real = w_array_real[4]; // = sqrt(2)/2
		// w_imag = -w_real; // = w_array_imag[4]; // = -sqrt(2)/2
		for(i = 1; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = (point1_real+point1_imag)*w_real;
			Imag[i2] = (point1_imag-point1_real)*w_real;
		}
		for(i = 2; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// x[i] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * (-i)
			Real[i2] = point1_imag-point2_imag;
			Imag[i2] = point2_real-point1_real;
		}
		w_real = w_array_real[12]; // = -sqrt(2)/2
		// w_imag = w_real; // = w_array_imag[12]; // = -sqrt(2)/2
		for(i = 3; i<n; i += 8) {
			i2 = i+4;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// temp1 = x[i] - x[i2]
			point1_real -= point2_real;
			point1_imag -= point2_imag;

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * w
			Real[i2] = (point1_real-point1_imag)*w_real;
			Imag[i2] = (point1_real+point1_imag)*w_real;
		}

		// Stage 4 of 32 point FFT decimation in frequency (no multiplications)
		// 16*4=64 additions
		for(i = 0; i<n; i += 4) {
			i2 = i+2;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// x[i1] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = x[i] - x[i2]
			Real[i2] = point1_real-point2_real;
			Imag[i2] = point1_imag-point2_imag;
		}
		for(i = 1; i<n; i += 4) {
			i2 = i+2;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// x[i] = x[i] + x[i2]
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// x[i2] = (x[i] - x[i2]) * (-i)
			Real[i2] = point1_imag-point2_imag;
			Imag[i2] = point2_real-point1_real;
		}

		// Stage 5 of 32 point FFT decimation in frequency (no multiplications)
		// 16*4=64 additions
		for(i = 0; i<n; i += 2) {
			i2 = i+1;
			point1_real = Real[i];
			point1_imag = Imag[i];

			point2_real = Real[i2];
			point2_imag = Imag[i2];

			// out[i1] = point1 + point2
			Real[i] += point2_real;
			Imag[i] += point2_imag;

			// out[i2] = point1 - point2
			Real[i2] = point1_real-point2_real;
			Imag[i2] = point1_imag-point2_imag;
		}

		//FFTReorder(Real, Imag);
	}
6*16*2+10*8+4*16*2=192+80+128=400 additions