int best_pitch=0; float err, best_err=-1;
int best_pitch = 0; float err; float best_err=-1;
  public final int quant(float[] target, float[] sw, int sws, float[] ak, float[] awk1, float[] awk2,                         float[] exc, int es, int start, int end, float pitch_coef, int p,                          int nsf, Bits bits, float[] exc2, int e2s, float[] r, int complexity)  {    int i,j;    int[] cdbk_index = new int[1];    int pitch=0, best_gain_index=0;    float[] best_exc;    int best_pitch=0;    float err, best_err=-1;    int N;    int[] nbest;    float[] gains;    N=complexity;    if (N>10)      N=10;    nbest=new int[N];    gains = new float[N];    if (N==0 || end<start) {      bits.pack(0, pitch_bits);      bits.pack(0, gain_bits);      for (i=0;i<nsf;i++)        exc[es+i]=0;      return start;    }        best_exc=new float[nsf];        if (N>end-start+1)      N=end-start+1;    open_loop_nbest_pitch(sw, sws, start, end, nsf, nbest, gains, N);    for (i=0;i<N;i++) {      pitch=nbest[i];      for (j=0;j<nsf;j++)        exc[es+j]=0;      err=pitch_gain_search_3tap(target, ak, awk1, awk2, exc, es, pitch, p, nsf,                                 bits, exc2, e2s, r, cdbk_index);      if (err<best_err || best_err<0) {        for (j=0;j<nsf;j++)          best_exc[j]=exc[es+j];        best_err=err;        best_pitch=pitch;        best_gain_index=cdbk_index[0];      }    }        bits.pack(best_pitch-start, pitch_bits);    bits.pack(best_gain_index, gain_bits);    for (i=0;i<nsf;i++)      exc[es+i]=best_exc[i];    return pitch;  }