ref: bc469b8e443c6c5aebe27229af30bc789a359d57
parent: 4e018b22bb1594daccb29cd6e92cca11809111d2
author: Jean-Marc Valin <[email protected]>
date: Fri Jun 14 20:42:38 EDT 2013
Splits cwrsi() inner loop in two to avoid the min/max and some load chains
--- a/celt/cwrs.c
+++ b/celt/cwrs.c
@@ -473,7 +473,13 @@
_i-=p&s;
/*Count how many pulses were placed in this dimension.*/
k0=_k;
- for(p=CELT_PVQ_U(_n,_k);p>_i;p=CELT_PVQ_U(_n,_k))_k--;
+ p=CELT_PVQ_U(_n,_k);
+ if(_k>_n){
+ const opus_uint32 *row;
+ row=CELT_PVQ_U_ROW[_n];
+ for(;p>_i&&_k>_n;p=row[_k])_k--;
+ }
+ for(;p>_i;p=CELT_PVQ_U_ROW[_k][_n])_k--;
_i-=p;
*_y++=(k0-_k+s)^s;
}