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

Function ShiftBytes

src/codec/utils/WebpDecoder.cpp:322–332  ·  view source on GitHub ↗

If not at EOS, reload up to VP8L_LBITS byte-by-byte

Source from the content-addressed store, hash-verified

320
321// If not at EOS, reload up to VP8L_LBITS byte-by-byte
322static void ShiftBytes(VP8LBitReader* const br) {
323 while (br->bit_pos_ >= 8 && br->pos_ < br->len_) {
324 br->val_ >>= 8;
325 br->val_ |= ((vp8l_val_t)br->buf_[br->pos_]) << (VP8L_LBITS - 8);
326 ++br->pos_;
327 br->bit_pos_ -= 8;
328 }
329 if (VP8LIsEndOfStream(br)) {
330 VP8LSetEndOfStream(br);
331 }
332}
333
334uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) {
335 assert(n_bits >= 0);

Callers 1

VP8LReadBitsFunction · 0.85

Calls 2

VP8LIsEndOfStreamFunction · 0.85
VP8LSetEndOfStreamFunction · 0.85

Tested by

no test coverage detected