+ break;
+ }
+ for (j=0;j<N;j++)
+ {
+ /*previous target (we don't care what happened before*/
+ for (m=(i+1)*subvect_size;m<nsf;m++)
+ nt[j][m]=ot[best_ntarget[j]][m];
+
+ /* New code: update the rest of the target only if it's worth it */
+ for (m=0;m<subvect_size;m++)
+ {
+ spx_word16_t g;
+ int rind;
+ spx_word16_t sign=1;
+ rind = best_nind[j];
+ if (rind>=shape_cb_size)
+ {
+ sign=-1;
+ rind-=shape_cb_size;
+ }
+
+ q=subvect_size-m;
+#ifdef FIXED_POINT
+ g=sign*shape_cb[rind*subvect_size+m];
+#else
+ g=sign*0.03125*shape_cb[rind*subvect_size+m];
+#endif
+ target_update(nt[j]+subvect_size*(i+1), g, r+q, nsf-subvect_size*(i+1));
+ }
+
+ for (q=0;q<nb_subvect;q++)
+ nind[j][q]=oind[best_ntarget[j]][q];
+ nind[j][i]=best_nind[j];