LD8KConstants.L_SUBFRP1];   /* H0 output signal             */
	    int sig_ltp_ptr;
	    FloatPointer parcor0 = new FloatPointer();

	    /* Compute weighted LPC coefficients */
	    LpcFunc.weight_az(coeff, coeffs, LD8KConstants.GAMMA1_PST, LD8KConstants.M, apond1, 0);
	    LpcFunc.weight_az(coeff, coeffs, LD8KConstants.GAMMA2_PST, LD8KConstants.M, apond2, 0);

	    /* Compute A(gamma2) residual */
	    Filter.residu(apond2, 0, signal_ptr, signals, res2, res2_ptr, LD8KConstants.L_SUBFR);

	    /* Harmonic filtering */
	    sig_ltp_ptr = 1;//sig_ltp + 1;
	    pst_ltp(t0, res2, res2_ptr, sig_ltp, sig_ltp_ptr, vo);

	    /* Save last output of 1/A(gamma1)  */
	    /* (from preceding subframe)        */
	    sig_ltp[0] = mem_stp[ptr_mem_stp];

	    /* Control short term pst filter gain and compute parcor0   */
	    calc_st_filt(apond2, 0, apond1, 0, parcor0, sig_ltp, sig_ltp_ptr);

	    /* 1/A(gamma1) filtering, mem_stp is updated */
	    Filter.syn_filt(apond1, 0, sig_ltp, sig_ltp_ptr, sig_ltp, sig_ltp_ptr, LD8KConstants.L_SUBFR, mem_stp, 0, 1);

	    /* (1 + mu z-1) tilt filtering */
	    filt_mu(sig_ltp, 0, sig_out, outs, parcor0.value);

	    /* gain control */
	    scale_st(signal_ptr, signals, sig_out, outs, gain_prec);

	    /**** Update for next frame */
	    Util.copy(res2,LD8KConstants.L_SUBFR, res2, 0, LD8KConstants.MEM_RES2);

	    return;
	}

	/*----------------------------------------------------------------------------
	 *  pst_ltp - harmonic postfilter
	 *----------------------------------------------------------------------------
	 */
	public void pst_ltp(
	 int t0,                /* input : pitch delay given by coder */
	 float []ptr_sig_in, int ins,     /* input : postfilter input filter (residu2) */
	 float []ptr_sig_pst0, int psts,   /* output: harmonic postfilter output */
	 IntegerPointer vo                /* output: voicing decision 0 = uv,  > 0 delay */
	)
	{

	/**** Declare variables                                 */
	    IntegerPointer ltpdel = new IntegerPointer(0), phase = new IntegerPointer(0);
	    FloatPointer num_gltp = new FloatPointer((float)0), den_gltp = new FloatPointer((float)0);
	    FloatPointer num2_gltp = new FloatPointer((float)0), den2_gltp = new FloatPointer((float)0);
	    float gain_plt;
	    float y_up[] = new float[LD8KConstants.SIZ_Y_UP];
	    int ptr_y_up;
	    float[] ptr_y_up_array;
	    IntegerPointer off_yup = new IntegerPointer();

	    /* Sub optimal delay search */
	    search_del(t0, ptr_sig_in, ins, ltpdel, phase, num_gltp, den_gltp,
	                        y_up, off_yup);
	    vo.value = ltpdel.value;

	    //HACK:FIXME
	    if(num_gltp.value == (float)0.)  {
	        Util.copy(ptr_sig_in, ins, ptr_sig_pst0, psts, LD8KConstants.L_SUBFR);
	    }
	    else {

	        if(phase.value == 0) {
	            ptr_y_up = ins - ltpdel.value;//ptr_sig_in
	            ptr_y_up_array = ptr_sig_in;
	        }

	        else {
	            /* Filtering with long filter */
	            compute_ltp_l(ptr_sig_in, ins, ltpdel.value, phase.value, ptr_sig_pst0, psts,
	            		num2_gltp, den2_gltp);

	            if(select_ltp(num_gltp.value, den_gltp.value, num2_gltp.value, den2_gltp.value) == 1) {

	                /* select short filter */
	                ptr_y_up = 0 + ((phase.value-1) * LD8KConstants.L_SUBFRP1 + off_yup.value);
	                ptr_y_up_array = y_up;
	            }
	            else {
	                /* select long filter */
	                num_gltp = num2_gltp;
	                den_gltp = den2_gltp;
	                ptr_y_up = psts;
	                ptr_y_up_array = ptr_sig_pst0;
	            }
	        }

	        if(num_gltp.value > den_gltp.value) {
	            /* beta bounded to 1 */
	            gain_plt = LD8KConstants.MIN_GPLT;
	        }
	        else {
	            gain_plt = den_gltp.value / (den_gltp.value + LD8KConstants.GAMMA_G * num_gltp.value);
	        }

	        /** filtering by H0(z) (harmonic filter) **/
	        filt_plt(ptr_sig_in, ins, ptr_y_up_array, ptr_y_up, ptr_sig_pst0, psts, gain_plt);

	    }

	    return;
	}

	/*----------------------------------------------------------------------------
	 *  search_del: computes best (shortest) integer LTP delay + fine search
	 *----------------------------------------------------------------------------
	 */
	static void search_del(
	 int t0,                /* input : pitch delay given by coder */
	 float []ptr_sig_in, int ins,     /* input : input signal (with delay line) */
	 IntegerPointer ltpdel,           /* output: delay = *ltpdel - *phase / f_up */
	 IntegerPointer phase,            /* output: phase */
	 FloatPointer num_gltp,       /* output: numerator of LTP gain */
	 FloatPointer den_gltp,       /* output: denominator of LTP gain */
	 float []y_up,           /*       : */
	 IntegerPointer off_yup           /*       : */
	)
	{

	    /* pointers on tables of constants */
	    int ptr_h;

	    /* Variables and local arrays */
	    float tab_den0[] = new float[LD8KConstants.F_UP_PST-1], tab_den1[] = new float[LD8KConstants.F_UP_PST-1];
	    int ptr_den0, ptr_den1;
	    int ptr_sig_past, ptr_sig_past0;
	    int ptr1;

	    int i, n, ioff, i_max;
	    float ener, num, numsq, den0, den1;
	    float den_int, num_int;
	    float den_max, num_max, numsq_max;
	    int phi_max;
	    int lambda, phi;
	    float temp0, temp1;
	    int ptr_y_up;

	    /*****************************************/
	    /* Compute current signal energy         */
	    /*****************************************/

	    ener = (float)0.;
	    for(i=0; i<LD8KConstants.L_SUBFR; i++) {
	        ener += ptr_sig_in[i+ins] * ptr_sig_in[i+ins];
	    }
	    if(ener < (float)0.1) {
	        num_gltp.value = (float)0.;
	        den_gltp.value = (float)1.;
	        ltpdel.value = 0;
	        phase.value = 0;
	        return;
	    }

	    /*************************************/
	    /* Selects best of 3 integer delays  */
	    /* Maximum of 3 numerators around t0 */
	    /* coder LTP delay                   */
	    /*************************************/

	    lambda = t0-1;

	    ptr_sig_past = 0 - lambda; // ptr_sig_in

	    num_int = (float)-1.0e30;

	   /* initialization used only to suppress Microsoft Visual C++ warnings */
	    i_