1 static __inline__ u8 GetByte (ac3_byte_stream_t * p_byte_stream)
3 /* Are there some bytes left in the current buffer ? */
4 if (p_byte_stream->p_byte >= p_byte_stream->p_end) {
5 /* no, switch to next buffer */
6 ac3_byte_stream_next (p_byte_stream);
9 return *(p_byte_stream->p_byte++);
12 static __inline__ void NeedBits (ac3_bit_stream_t * p_bit_stream, int i_bits)
14 while (p_bit_stream->i_available < i_bits) {
15 p_bit_stream->buffer |=
16 ((u32)GetByte (&p_bit_stream->byte_stream)) << (24 - p_bit_stream->i_available);
17 p_bit_stream->i_available += 8;
21 static __inline__ void DumpBits (ac3_bit_stream_t * p_bit_stream, int i_bits)
23 p_bit_stream->buffer <<= i_bits;
24 p_bit_stream->i_available -= i_bits;
25 p_bit_stream->total_bits_read += i_bits;