25 int n, l, max_ssqEn_n;
26 const float ssqEn_win[
NSUB_MAX-1]={(float)0.8,(
float)0.9,
27 (float)1.0,(
float)0.9,(float)0.8};
28 const float sampEn_win[5]={(float)1.0/(
float)6.0,
29 (float)2.0/(
float)6.0, (float)3.0/(
float)6.0,
30 (float)4.0/(
float)6.0, (float)5.0/(
float)6.0};
34 memset(fssqEn, 0,
NSUB_MAX*
sizeof(
float));
35 memset(bssqEn, 0,
NSUB_MAX*
sizeof(
float));
42 fssqEn[n] += sampEn_win[l] * (*pp) * (*pp);
45 for (l=5; l<
SUBL; l++) {
51 fssqEn[n] += (*pp) * (*pp);
57 for (n=1; n<iLBCenc_inst->
nsub-1; n++) {
60 fssqEn[n] += sampEn_win[l] * (*pp) * (*pp);
61 bssqEn[n] += (*pp) * (*pp);
64 for (l=5; l<
SUBL-5; l++) {
65 fssqEn[n] += (*pp) * (*pp);
66 bssqEn[n] += (*pp) * (*pp);
70 fssqEn[n] += (*pp) * (*pp);
71 bssqEn[n] += sampEn_win[
SUBL-l-1] * (*pp) * (*pp);
78 n=iLBCenc_inst->
nsub-1;
80 for (l=0; l<
SUBL-5; l++) {
81 bssqEn[n] += (*pp) * (*pp);
85 bssqEn[n] += sampEn_win[
SUBL-l-1] * (*pp) * (*pp);
92 if (iLBCenc_inst->
mode==20) l=1;
95 max_ssqEn=(fssqEn[0]+bssqEn[1])*ssqEn_win[l];
97 for (n=2; n<iLBCenc_inst->
nsub; n++) {
105 if ((fssqEn[n-1]+bssqEn[n])*ssqEn_win[l] > max_ssqEn) {
106 max_ssqEn=(fssqEn[n-1]+bssqEn[n]) *
int FrameClassify(iLBC_Enc_Inst_t *iLBCenc_inst, float *residual)