MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / bits_get

Function bits_get

libhb/stream.c:2593–2620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2591}
2592
2593static inline unsigned int bits_get(bitbuf_t *bb, int bits)
2594{
2595 unsigned int val;
2596 int left = 32 - (bb->pos & 31);
2597
2598 if (bits < left)
2599 {
2600 val = (bb->val >> (left - bits)) & bitmask[bits];
2601 bb->pos += bits;
2602 }
2603 else
2604 {
2605 val = (bb->val & bitmask[left]) << (bits - left);
2606 bb->pos += left;
2607 bits -= left;
2608
2609 int pos = bb->pos >> 3;
2610 bb->val = ((uint32_t)bb->buf[pos] << 24) | (bb->buf[pos + 1] << 16) | (bb->buf[pos + 2] << 8) | bb->buf[pos + 3];
2611
2612 if (bits > 0)
2613 {
2614 val |= (bb->val >> (32 - bits)) & bitmask[bits];
2615 bb->pos += bits;
2616 }
2617 }
2618
2619 return val;
2620}
2621
2622static inline int bits_skip(bitbuf_t *bb, int bits)
2623{

Callers 10

bits_skipFunction · 0.85
decode_program_mapFunction · 0.85
decode_PATFunction · 0.85
parse_pes_timestampFunction · 0.85
parse_pes_headerFunction · 0.85
parse_pack_headerFunction · 0.85
hb_parse_psFunction · 0.85
decode_ps_mapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected