本文整理汇总了C++中BitArray::ReadFromRepeat方法的典型用法代码示例。如果您正苦于以下问题:C++ BitArray::ReadFromRepeat方法的具体用法?C++ BitArray::ReadFromRepeat怎么用?C++ BitArray::ReadFromRepeat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitArray
的用法示例。
在下文中一共展示了BitArray::ReadFromRepeat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
bool _VIDEO_AVC::Init(const uint8_t *pSPS, uint32_t spsLength, const uint8_t *pPPS,
uint32_t ppsLength) {
Clear();
if ((spsLength <= 0)
|| (spsLength > 65535)
|| (ppsLength <= 0)
|| (ppsLength > 65535)) {
FATAL("Invalid SPS/PPS lengths");
return false;
}
_spsLength = (uint16_t) spsLength;
_pSPS = new uint8_t[_spsLength];
memcpy(_pSPS, pSPS, _spsLength);
_ppsLength = (uint16_t) ppsLength;
_pPPS = new uint8_t[_ppsLength];
memcpy(_pPPS, pPPS, _ppsLength);
_rate = 90000;
BitArray spsBa;
//remove emulation_prevention_three_byte
for (uint16_t i = 1; i < _spsLength; i++) {
if (((i + 2)<(_spsLength - 1))
&& (_pSPS[i + 0] == 0)
&& (_pSPS[i + 1] == 0)
&& (_pSPS[i + 2] == 3)) {
spsBa.ReadFromRepeat(0, 2);
i += 2;
} else {
spsBa.ReadFromRepeat(_pSPS[i], 1);
}
}
if (!ReadSPS(spsBa, _SPSInfo)) {
WARN("Unable to parse SPS");
} else {
_SPSInfo.Compact();
_width = ((uint32_t) _SPSInfo["pic_width_in_mbs_minus1"] + 1)*16;
_height = ((uint32_t) _SPSInfo["pic_height_in_map_units_minus1"] + 1)*16;
// FINEST("_width: %u (%u); _height: %u (%u)",
// _width, (uint32_t) _SPSInfo["pic_width_in_mbs_minus1"],
// _height, (uint32_t) _SPSInfo["pic_height_in_map_units_minus1"]);
}
BitArray ppsBa;
//remove emulation_prevention_three_byte
for (uint16_t i = 1; i < _ppsLength; i++) {
if (((i + 2)<(_ppsLength - 1))
&& (_pPPS[i + 0] == 0)
&& (_pPPS[i + 1] == 0)
&& (_pPPS[i + 2] == 3)) {
ppsBa.ReadFromRepeat(0, 2);
i += 2;
} else {
ppsBa.ReadFromRepeat(_pPPS[i], 1);
}
}
if (!ReadPPS(ppsBa, _PPSInfo)) {
WARN("Unable to read PPS info");
}
return true;
}