本文整理汇总了C++中BitStream::readBits方法的典型用法代码示例。如果您正苦于以下问题:C++ BitStream::readBits方法的具体用法?C++ BitStream::readBits怎么用?C++ BitStream::readBits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitStream
的用法示例。
在下文中一共展示了BitStream::readBits方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseBox
void CodingConstraintsBox::parseBox(BitStream& bitstr)
{
parseFullBoxHeader(bitstr);
mAllRefPicsIntra = bitstr.readBits(1);
mIntraPredUsed = bitstr.readBits(1);
mMaxRefPicUsed = bitstr.readBits(4);
bitstr.readBits(26); // discard reserved int(26)
}
示例2: decode
int Golomb::decode(uint m, int *value, BitStream& bs){
int q = 0, r, v;
int nbits = (int) floor(log2(m)) + 1;
int err;
uint32_t bit;
do {
if ((err=bs.readBit(&bit)) != 0)
return err;
if (bit == 0)
break;
q++;
} while(true);
if ((err = bs.readBits(nbits, &bit)) != 0)
return err;
r = (int) bit;
v = q * m + r;
if (v % 2 == 0)
*value = v/2;
else
*value = -(v+1)/2;
return 0;
}
示例3: rbucDecodeCPUOneLevel
void rbucDecodeCPUOneLevel(BitStream& bitStream, const std::vector<Symbol16>& lengths, std::vector<Symbol16>& symbols, uint symbolCount, uint branchFactor)
{
for(uint i = 0; i < symbolCount; i++) {
uint length = lengths[i / branchFactor];
uint symbol = 0;
bitStream.readBits(symbol, length);
symbols.push_back(symbol);
}
}