MCPcopy Create free account
hub / github.com/Tencent/libpag / VP8LInitBitReader

Function VP8LInitBitReader

src/codec/utils/WebpDecoder.cpp:284–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start, size_t length) {
285 size_t i;
286 vp8l_val_t value = 0;
287 assert(br != nullptr);
288 assert(start != nullptr);
289 assert(length < 0xfffffff8u); // can't happen with a RIFF chunk.
290
291 br->len_ = length;
292 br->val_ = 0;
293 br->bit_pos_ = 0;
294 br->eos_ = 0;
295
296 if (length > sizeof(br->val_)) {
297 length = sizeof(br->val_);
298 }
299 for (i = 0; i < length; ++i) {
300 value |= (vp8l_val_t)start[i] << (8 * i);
301 }
302 br->val_ = value;
303 br->pos_ = length;
304 br->buf_ = start;
305}
306
307static WEBP_INLINE uint32_t VP8LPrefetchBits(VP8LBitReader* const br) {
308 return (uint32_t)(br->val_ >> (br->bit_pos_ & (VP8L_LBITS - 1)));

Callers 1

VP8LGetInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected