bit.h File Reference

Definition of the mad_bit_ptr structure and methods, used in various low-level routines. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mad_bitptr

Defines

#define mad_bit_finish(bitptr)
 nothing
#define mad_bit_bitsleft(bitptr)   ((bitptr)->left)

Functions

void mad_bit_init (struct mad_bitptr *, unsigned char const *)
 Initializes bit pointer struct.
unsigned int mad_bit_length (struct mad_bitptr const *, struct mad_bitptr const *)
 Returns number of bits between start and end points.
unsigned char const * mad_bit_nextbyte (struct mad_bitptr const *)
 Returns pointer to next unprocessed byte.
void mad_bit_skip (struct mad_bitptr *, unsigned int)
 Advances bit pointer.
unsigned long mad_bit_read (struct mad_bitptr *, unsigned int)
 Reads an arbitrary number of bits and return their UIMSBF value.
void mad_bit_write (struct mad_bitptr *, unsigned int, unsigned long)
unsigned short mad_bit_crc (struct mad_bitptr, unsigned int, unsigned short)
 Computes CRC-check word.


Detailed Description

Definition of the mad_bit_ptr structure and methods, used in various low-level routines.

Definition in file bit.h.


Define Documentation

#define mad_bit_bitsleft ( bitptr   )     ((bitptr)->left)

Definition at line 42 of file bit.h.

Referenced by III_huffdecode().

#define mad_bit_finish ( bitptr   ) 

nothing

Definition at line 37 of file bit.h.

Referenced by mad_frame_decode(), mad_layer_III(), and mad_stream_finish().


Function Documentation

unsigned short mad_bit_crc ( struct  mad_bitptr,
unsigned  int,
unsigned  short 
)

Computes CRC-check word.

Definition at line 194 of file bit.c.

References CRC_POLY, crc_table, and mad_bit_read().

Referenced by decode_header(), mad_layer_I(), mad_layer_II(), and mad_layer_III().

Here is the call graph for this function:

void mad_bit_init ( struct mad_bitptr ,
unsigned char const *   
)

Initializes bit pointer struct.

Definition at line 91 of file bit.c.

References mad_bitptr::byte, mad_bitptr::cache, CHAR_BIT, and mad_bitptr::left.

Referenced by mad_frame_decode(), mad_header_decode(), mad_layer_III(), mad_stream_buffer(), mad_stream_init(), and mad_stream_sync().

unsigned int mad_bit_length ( struct mad_bitptr const *  ,
struct mad_bitptr const *   
)

Returns number of bits between start and end points.

Definition at line 101 of file bit.c.

References mad_bitptr::byte, CHAR_BIT, and mad_bitptr::left.

Referenced by III_scalefactors(), III_scalefactors_lsf(), mad_frame_decode(), and mad_layer_II().

unsigned char const* mad_bit_nextbyte ( struct mad_bitptr const *   ) 

Returns pointer to next unprocessed byte.

Definition at line 111 of file bit.c.

References mad_bitptr::byte, CHAR_BIT, and mad_bitptr::left.

Referenced by free_bitrate(), mad_header_decode(), mad_layer_III(), and mad_stream_sync().

unsigned long mad_bit_read ( struct mad_bitptr ,
unsigned  int 
)

Reads an arbitrary number of bits and return their UIMSBF value.

Definition at line 136 of file bit.c.

References mad_bitptr::byte, mad_bitptr::cache, CHAR_BIT, and mad_bitptr::left.

Referenced by decode_header(), I_sample(), II_samples(), III_huffdecode(), III_scalefactors(), III_scalefactors_lsf(), III_sideinfo(), mad_bit_crc(), mad_layer_I(), mad_layer_II(), and mad_layer_III().

void mad_bit_skip ( struct mad_bitptr ,
unsigned  int 
)

Advances bit pointer.

Definition at line 119 of file bit.c.

References mad_bitptr::byte, mad_bitptr::cache, CHAR_BIT, and mad_bitptr::left.

Referenced by decode_header(), free_bitrate(), III_huffdecode(), and mad_layer_III().

void mad_bit_write ( struct mad_bitptr ,
unsigned  int,
unsigned  long 
)


Generated on Tue Jun 10 12:14:17 2008 for libmad by  doxygen 1.5.5