#include "global.h"
#include "bit.h"
Go to the source code of this file.
Defines | |
#define | CHAR_BIT 8 |
#define | CRC_POLY 0x8005 |
Functions | |
void | mad_bit_init (struct mad_bitptr *bitptr, unsigned char const *byte) |
Initializes bit pointer struct. | |
unsigned int | mad_bit_length (struct mad_bitptr const *begin, struct mad_bitptr const *end) |
Returns number of bits between start and end points. | |
unsigned char const * | mad_bit_nextbyte (struct mad_bitptr const *bitptr) |
Returns pointer to next unprocessed byte. | |
void | mad_bit_skip (struct mad_bitptr *bitptr, unsigned int len) |
Advances bit pointer. | |
unsigned long | mad_bit_read (struct mad_bitptr *bitptr, unsigned int len) |
Reads an arbitrary number of bits and return their UIMSBF value. | |
unsigned short | mad_bit_crc (struct mad_bitptr bitptr, unsigned int len, unsigned short init) |
Computes CRC-check word. | |
Variables | |
static unsigned short const | crc_table [256] |
This is the lookup table for computing the CRC-check word. |
Definition in file bit.c.
#define CHAR_BIT 8 |
Definition at line 35 of file bit.c.
Referenced by III_huffdecode(), III_requantize(), mad_bit_init(), mad_bit_length(), mad_bit_nextbyte(), mad_bit_read(), mad_bit_skip(), and mad_layer_III().
#define CRC_POLY 0x8005 |
unsigned short mad_bit_crc | ( | struct mad_bitptr | bitptr, | |
unsigned int | len, | |||
unsigned short | init | |||
) |
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().
void mad_bit_init | ( | struct mad_bitptr * | bitptr, | |
unsigned char const * | byte | |||
) |
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 * | begin, | |
struct mad_bitptr const * | end | |||
) |
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 * | bitptr | ) |
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 * | bitptr, | |
unsigned int | len | |||
) |
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 * | bitptr, | |
unsigned int | len | |||
) |
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().
unsigned short const crc_table[256] [static] |
This is the lookup table for computing the CRC-check word.
As described in section 2.4.3.1 and depicted in Figure A.9 of ISO/IEC 11172-3, the generator polynomial is:
G(X) = X^16 + X^15 + X^2 + 1
Definition at line 48 of file bit.c.
Referenced by mad_bit_crc().