TurboPFor: TurboPFor decode

This commit is contained in:
x
2018-03-13 13:35:53 +01:00
parent 3a000a3f38
commit 5fa1f91ade

6
vp4d.c Normal file → Executable file
View File

@ -329,11 +329,11 @@ ALWAYS_INLINE unsigned char *TEMPLATE2(_P4DEC, USIZE)(unsigned char *__restrict
#else
{ unsigned k = 0;
uint_t *op,*p;
for(op=out,i = 0; i < p4dn; i++,op += 64) {
for(op=out,i = 0; i < p4dn; i++,op += 64) { unsigned long long u = bb[i];
#if 1 // faster
while(bb[i]) { unsigned x = ctz64(bb[i]); op[x] += ex[k++]<<b; bb[i] ^= (1ull<<x); }
while(u) op[ctz64(u)] += ex[k++]<<b, u &= u-1;
#else
unsigned long long u = bb[i]; p = op;
p = op;
#define OP(_i_) p[_i_] += ex[k++]<<b;
while(u) {
unsigned x = ctz64(u); u >>= x; p+=x;