foobar2000 SDK  2015-08-03
Data Structures | Functions
bitreader_helper Namespace Reference

Data Structures

class  bitreader
 
class  bitreader_fromfile
 
class  bitreader_limited
 

Functions

static size_t extract_bit (const t_uint8 *p_stream, size_t p_offset)
 
static t_size extract_bits (const t_uint8 *p_buffer, t_size p_base, t_size p_count)
 
static size_t extract_int (const t_uint8 *p_stream, size_t p_base, size_t p_width)
 

Function Documentation

static size_t bitreader_helper::extract_bit ( const t_uint8 p_stream,
size_t  p_offset 
)
inlinestatic

Definition at line 3 of file bitreader_helper.h.

3  {
4  return (p_stream[p_offset>>3] >> (7-(p_offset&7)))&1;
5  }
static t_size bitreader_helper::extract_bits ( const t_uint8 p_buffer,
t_size  p_base,
t_size  p_count 
)
inlinestatic

Definition at line 118 of file bitreader_helper.h.

118  {
119  return bitreader(p_buffer,p_base).read(p_count);
120 }
static size_t bitreader_helper::extract_int ( const t_uint8 p_stream,
size_t  p_base,
size_t  p_width 
)
inlinestatic

Definition at line 7 of file bitreader_helper.h.

7  {
8  size_t ret = 0;
9  size_t offset = p_base;
10  for(size_t bit=0;bit<p_width;bit++) {
11  ret <<= 1;
12  ret |= extract_bit(p_stream,offset++);
13  }
14  return ret;
15  }
static size_t extract_bit(const t_uint8 *p_stream, size_t p_offset)