TurboPFor: TurboPFor encode/decode c/c++ header

This commit is contained in:
x
2017-09-08 17:31:16 +02:00
parent 02903a5d23
commit 15f24a6047

2
vp4.h
View File

@ -271,7 +271,7 @@ static inline void p4ini(struct p4 *p4, unsigned char **pin, unsigned n, unsigne
unsigned num=0,j; unsigned num=0,j;
unsigned char *p; unsigned char *p;
++in; ++in;
p4->xmap = (uint64_t *)in; p4->xmap = (unsigned long long *)in;
for(j=0; j < n/64; j++) { p4->cum[j] = num; num += popcnt64(ctou64(in+j*8)); } for(j=0; j < n/64; j++) { p4->cum[j] = num; num += popcnt64(ctou64(in+j*8)); }
if(n & 0x3f) num += popcnt64(ctou64(in+j*8) & ((1ull<<(n&0x3f))-1) ); if(n & 0x3f) num += popcnt64(ctou64(in+j*8) & ((1ull<<(n&0x3f))-1) );
p4->ex = p = in + (n+7)/8; p4->ex = p = in + (n+7)/8;