protected synchronized void imdct(final float[] frq, final float[] window, final int[] pcm) {// ,
                                                                                                 // float[]
                                                                                                 // out){

        float[] in = frq;// , out=buf;
        if (_x.length < n / 2) {
            _x = new float[n / 2];
        }
        if (_w.length < n / 2) {
            _w = new float[n / 2];
        }
        final float[] x = _x;
        final float[] w = _w;
        int n2 = n >> 1;
        int n4 = n >> 2;
        int n8 = n >> 3;

        if (equalizer != null) {
            for (int i = 0; i < n; i++) {
                frq[i] *= equalizer[i];
            }
        }

        // rotate + step 1
        {
            int inO = -1;
            int xO = 0;
            int A = n2;

            int i;
            for (i = 0; i < n8; i++) {
                dtmp1 = in[inO += 2];
                dtmp2 = in[inO += 2];
                dtmp3 = trig[--A];
                dtmp4 = trig[--A];
                x[xO++] = -dtmp2 * dtmp3 - dtmp1 * dtmp4;
                x[xO++] = dtmp1 * dtmp3 - dtmp2 * dtmp4;
                // A-=2;
                // x[xO++]=-in[inO+2]*trig[A+1] - in[inO]*trig[A];
                // x[xO++]= in[inO]*trig[A+1] - in[inO+2]*trig[A];
                // inO+=4;
            }

            inO = n2;// -4;

            for (i = 0; i < n8; i++) {
                dtmp1 = in[inO -= 2];
                dtmp2 = in[inO -= 2];
                dtmp3 = trig[--A];
                dtmp4 = trig[--A];
                x[xO++] = dtmp2 * dtmp3 + dtmp1 * dtmp4;
                x[xO++] = dtmp2 * dtmp4 - dtmp1 * dtmp3;
                // A-=2;
                // x[xO++]=in[inO]*trig[A+1] + in[inO+2]*trig[A];
                // x[xO++]=in[inO]*trig[A] - in[inO+2]*trig[A+1];
                // inO-=4;
            }
        }

        float[] xxx = kernel(x, w, n, n2, n4, n8);
        int xx = 0;

        // step 8

        {
            int B = n2;
            int o1 = n4, o2 = o1 - 1;
            int o3 = n4 + n2, o4 = o3 - 1;

            for (int i = 0; i < n4; i++) {
                dtmp1 = xxx[xx++];
                dtmp2 = xxx[xx++];
                dtmp3 = trig[B++];
                dtmp4 = trig[B++];

                float temp1 = (dtmp1 * dtmp4 - dtmp2 * dtmp3);
                float temp2 = -(dtmp1 * dtmp3 + dtmp2 * dtmp4);

                /*
                 * float temp1= (xxx[xx] * trig[B+1] - xxx[xx+1] *
                 * trig[B]);//*32767F; float temp2=-(xxx[xx] * trig[B] +
                 * xxx[xx+1] * trig[B+1]);//*32767F;
                 */

                // if(temp1>32767F) temp1=32767F;
                // if(temp1<-32768F) temp1=-32768F;
                // if(temp2>32767F) temp2=32767F;
                // if(temp2<-32768F) temp2=-32768F;

                pcm[o1] = (int) (-temp1 * window[o1]);
                pcm[o2] = (int) (temp1 * window[o2]);
                pcm[o3] = (int) (temp2 * window[o3]);
                pcm[o4] = (int) (temp2 * window[o4]);

                o1++;
                o2--;
                o3++;
                o4--;
                // xx+=2;
                // B+=2;
            }
        }
    }