Esempio n. 1
0
  private void vorbis_encode_global_psych_setup(float s, vorbis_info_psy_global[] in, float[] x) {

    int i;
    int is = new Float(s).intValue();
    float ds = s - is;
    codec_setup_info ci = vi.codec_setup;

    // memcpy(g,in+(int)x[is],sizeof(*g));
    ci.psy_g_param = new vorbis_info_psy_global(in[new Float(x[is]).intValue()]);
    vorbis_info_psy_global g = ci.psy_g_param;

    ds = x[is] * (1.0f - ds) + x[is + 1] * ds;

    is = new Float(ds).intValue();
    ds -= is;
    if (ds == 0 && is > 0) {
      is--;
      ds = 1.0f;
    }

    // interpolate the trigger threshholds
    for (i = 0; i < 4; i++) {
      g.preecho_thresh[i] =
          new Double(in[is].preecho_thresh[i] * (1. - ds) + in[is + 1].preecho_thresh[i] * ds)
              .floatValue();
      g.postecho_thresh[i] =
          new Double(in[is].postecho_thresh[i] * (1. - ds) + in[is + 1].postecho_thresh[i] * ds)
              .floatValue();
    }
    g.ampmax_att_per_sec = ci.hi.amplitude_track_dBpersec;
  }