/*************************************************************************/ /* */ /* LD-CELP G.728 */ /* */ /* Low-Delay Code Excitation Linear Prediction speech compression. */ /* */ /* Code edited by Michael Concannon. */ /* Based on code written by Alex Zatsman, Analog Devices 1993 */ /* */ /*************************************************************************/ #include "common.h" #include "prototyp.h" #include "fast.h" #include "data.h" /* Impulse Response Vector Calculator */ void iresp_vcalc(real COEFF_MEM sf_co[], real COEFF_MEM pwf_z_co[], real COEFF_MEM pwf_p_co[], real h[]) { static real temp[IDIM]; static real rc[IDIM]; real a0,a1,a2; int i,k; temp[0] = rc[0] = 1.0; for (k=1; k=1; i--) { temp[i] = temp[i-1]; rc[i] = rc[i-1]; a0 -= sf_co[i] * temp[i]; a1 += pwf_z_co[i] * temp[i]; a2 -= pwf_p_co[i] * rc[i]; } temp[0] = a0; rc[0] = a0+a1+a2; } for (k=0; k>3, gx = ix & 7; real gain = cb_gain[gx]; for(i=0; iB)X++ int cb_index (real pn[]) { real d, distm = BIG; int j, is=0, /* best shape index */ ig=0, /* best gain index */ idxg, /* current gain index */ ichan; /* resulting combined index */ real CBMEM *shape_ptr = (real CBMEM *) cb_shape; real *sher_ptr = shape_energy; real pcor, b0, b1, b2; real *pb=pn; real g2, gsq; register real cgm0 REG(r0) = cb_gain_mid_0, cgm1 REG(r1) = cb_gain_mid_1, x REG(r2), cgm2 = cb_gain_mid_2, energy REG(r4), y REG(r5), cor REG(r8) = 0, t REG(r12); register int minus5 REG(m0) = -5; for (j=0; j