2 #define IZ_BITCODER_H 1 11 #if defined(__LP64__) || defined(__L64__) 12 typedef unsigned long U64;
13 typedef unsigned int U32;
14 #elif defined(__LLP64__) || defined(__LL64__) || defined(_WIN64) 15 typedef unsigned long long U64;
16 typedef unsigned int U32;
17 #elif defined(__MMX__) 20 typedef unsigned int U32;
23 typedef unsigned long long U64;
24 typedef unsigned int U32;
27 template<
typename Code = U32>
62 template<
typename Code = U32>
74 void begin(
const unsigned char *ptr) {
75 p = (
const Code *) ptr;
77 bitcache = _mm_cvtsi32_si64(fetchCode());
97 unsigned int peekBits(
unsigned int count)
const {
126 const unsigned char *
end() {
130 return (
const unsigned char *) (p - (
len >=
CodeBits));
137 template<
typename Code = U32>
163 storeCode(_mm_cvtsi64_si32(_mm_srli_si64(
bitcache,
len)));
194 return (
unsigned char *) p;
void skipBits(unsigned int count)
const unsigned char * end()
void begin(const unsigned char *ptr)
void writeBits(unsigned int bits, unsigned int count)
void storeCode(Code code)
void begin(unsigned char *ptr)
unsigned int readBits(unsigned int count)
unsigned int peekBits(unsigned int count) const
static unsigned int bitMask(unsigned int bitCount)
unsigned int cachedLength() const