Add oc_enc_tell to report an estimate of the number of bits used so far.
Remove the special case for 0 in EC_ILOG, as we never pass it 0 and this generates slightly better code. Update ec_enc_bits64 to split the encoded values along word boundaries... this should generate slightly better code, as well as fix a subtle bug (the proper bits were not being masked out of the low part). However, this will render previous streams that used this function undecodable (to my knowledge, no one is actually using it yet). git-svn-id: http://svn.xiph.org/trunk/ghost@14391 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
parent
45018cbfa2
commit
06390d082d
7 changed files with 81 additions and 16 deletions
|
@ -18,7 +18,7 @@ unsigned char *ec_byte_get_buffer(ec_byte_buffer *_b){
|
|||
|
||||
int ec_ilog(ec_uint32 _v){
|
||||
#if defined(EC_CLZ)
|
||||
return EC_CLZ0-EC_CLZ(_v)&-!!_v;
|
||||
return EC_CLZ0-EC_CLZ(_v);
|
||||
#else
|
||||
/*On a Pentium M, this branchless version tested as the fastest on
|
||||
1,000,000,000 random 32-bit integers, edging out a similar version with
|
||||
|
@ -45,7 +45,7 @@ int ec_ilog(ec_uint32 _v){
|
|||
|
||||
int ec_ilog64(ec_uint64 _v){
|
||||
#if defined(EC_CLZ64)
|
||||
return EC_CLZ64_0-EC_CLZ64(_v)&-!!_v;
|
||||
return EC_CLZ64_0-EC_CLZ64(_v);
|
||||
#else
|
||||
ec_uint32 v;
|
||||
int ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue