LMMS
Loading...
Searching...
No Matches
bitreader.c File Reference
#include <stdlib.h>
#include <string.h>
#include "include/private/bitmath.h"
#include "include/private/bitreader.h"
#include "include/private/crc.h"
#include "../assert.h"
#include "../compat.h"
#include "../endswap.h"

Classes

struct  FLAC__BitReader

Macros

#define FLAC__BYTES_PER_WORD   4 /* sizeof uint32_t */
#define FLAC__BITS_PER_WORD   (8 * FLAC__BYTES_PER_WORD)
#define FLAC__WORD_ALL_ONES   ((FLAC__uint32)0xffffffff)
#define SWAP_BE_WORD_TO_HOST(x)

Functions

static void crc16_update_word_ (FLAC__BitReader *br, uint32_t word)
static FLAC__bool bitreader_read_from_client_ (FLAC__BitReader *br)
FLAC__BitReaderFLAC__bitreader_new (void)
void FLAC__bitreader_delete (FLAC__BitReader *br)
FLAC__bool FLAC__bitreader_init (FLAC__BitReader *br, FLAC__BitReaderReadCallback rcb, void *cd)
void FLAC__bitreader_free (FLAC__BitReader *br)
FLAC__bool FLAC__bitreader_clear (FLAC__BitReader *br)
void FLAC__bitreader_dump (const FLAC__BitReader *br, FILE *out)
void FLAC__bitreader_reset_read_crc16 (FLAC__BitReader *br, FLAC__uint16 seed)
FLAC__uint16 FLAC__bitreader_get_read_crc16 (FLAC__BitReader *br)
FLAC__bool FLAC__bitreader_is_consumed_byte_aligned (const FLAC__BitReader *br)
unsigned FLAC__bitreader_bits_left_for_byte_alignment (const FLAC__BitReader *br)
unsigned FLAC__bitreader_get_input_bits_unconsumed (const FLAC__BitReader *br)
FLAC__bool FLAC__bitreader_read_raw_uint32 (FLAC__BitReader *br, FLAC__uint32 *val, unsigned bits)
FLAC__bool FLAC__bitreader_read_raw_int32 (FLAC__BitReader *br, FLAC__int32 *val, unsigned bits)
FLAC__bool FLAC__bitreader_read_raw_uint64 (FLAC__BitReader *br, FLAC__uint64 *val, unsigned bits)
FLAC__bool FLAC__bitreader_read_uint32_little_endian (FLAC__BitReader *br, FLAC__uint32 *val)
FLAC__bool FLAC__bitreader_skip_bits_no_crc (FLAC__BitReader *br, unsigned bits)
FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc (FLAC__BitReader *br, unsigned nvals)
FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc (FLAC__BitReader *br, FLAC__byte *val, unsigned nvals)
FLAC__bool FLAC__bitreader_read_unary_unsigned (FLAC__BitReader *br, unsigned *val)
FLAC__bool FLAC__bitreader_read_rice_signed (FLAC__BitReader *br, int *val, unsigned parameter)
FLAC__bool FLAC__bitreader_read_rice_signed_block (FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter)
FLAC__bool FLAC__bitreader_read_utf8_uint32 (FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, unsigned *rawlen)
FLAC__bool FLAC__bitreader_read_utf8_uint64 (FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, unsigned *rawlen)

Variables

static const unsigned FLAC__BITREADER_DEFAULT_CAPACITY = 65536u / FLAC__BITS_PER_WORD

Macro Definition Documentation

◆ FLAC__BITS_PER_WORD

#define FLAC__BITS_PER_WORD   (8 * FLAC__BYTES_PER_WORD)

◆ FLAC__BYTES_PER_WORD

#define FLAC__BYTES_PER_WORD   4 /* sizeof uint32_t */

◆ FLAC__WORD_ALL_ONES

#define FLAC__WORD_ALL_ONES   ((FLAC__uint32)0xffffffff)

◆ SWAP_BE_WORD_TO_HOST

#define SWAP_BE_WORD_TO_HOST ( x)
Value:
unsigned x[BMAX+1]
Definition inflate.c:1586
#define ENDSWAP_32(x)
Definition endswap.h:64

Function Documentation

◆ bitreader_read_from_client_()

FLAC__bool bitreader_read_from_client_ ( FLAC__BitReader * br)
static

◆ crc16_update_word_()

void crc16_update_word_ ( FLAC__BitReader * br,
uint32_t word )
inlinestatic

◆ FLAC__bitreader_bits_left_for_byte_alignment()

unsigned FLAC__bitreader_bits_left_for_byte_alignment ( const FLAC__BitReader * br)
inline

◆ FLAC__bitreader_clear()

FLAC__bool FLAC__bitreader_clear ( FLAC__BitReader * br)

◆ FLAC__bitreader_delete()

void FLAC__bitreader_delete ( FLAC__BitReader * br)

◆ FLAC__bitreader_dump()

void FLAC__bitreader_dump ( const FLAC__BitReader * br,
FILE * out )

◆ FLAC__bitreader_free()

void FLAC__bitreader_free ( FLAC__BitReader * br)

◆ FLAC__bitreader_get_input_bits_unconsumed()

unsigned FLAC__bitreader_get_input_bits_unconsumed ( const FLAC__BitReader * br)
inline

◆ FLAC__bitreader_get_read_crc16()

FLAC__uint16 FLAC__bitreader_get_read_crc16 ( FLAC__BitReader * br)

◆ FLAC__bitreader_init()

FLAC__bool FLAC__bitreader_init ( FLAC__BitReader * br,
FLAC__BitReaderReadCallback rcb,
void * cd )

◆ FLAC__bitreader_is_consumed_byte_aligned()

FLAC__bool FLAC__bitreader_is_consumed_byte_aligned ( const FLAC__BitReader * br)
inline

◆ FLAC__bitreader_new()

FLAC__BitReader * FLAC__bitreader_new ( void )

◆ FLAC__bitreader_read_byte_block_aligned_no_crc()

FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc ( FLAC__BitReader * br,
FLAC__byte * val,
unsigned nvals )

◆ FLAC__bitreader_read_raw_int32()

FLAC__bool FLAC__bitreader_read_raw_int32 ( FLAC__BitReader * br,
FLAC__int32 * val,
unsigned bits )

◆ FLAC__bitreader_read_raw_uint32()

FLAC__bool FLAC__bitreader_read_raw_uint32 ( FLAC__BitReader * br,
FLAC__uint32 * val,
unsigned bits )

◆ FLAC__bitreader_read_raw_uint64()

FLAC__bool FLAC__bitreader_read_raw_uint64 ( FLAC__BitReader * br,
FLAC__uint64 * val,
unsigned bits )

◆ FLAC__bitreader_read_rice_signed()

FLAC__bool FLAC__bitreader_read_rice_signed ( FLAC__BitReader * br,
int * val,
unsigned parameter )

◆ FLAC__bitreader_read_rice_signed_block()

FLAC__bool FLAC__bitreader_read_rice_signed_block ( FLAC__BitReader * br,
int vals[],
unsigned nvals,
unsigned parameter )

◆ FLAC__bitreader_read_uint32_little_endian()

FLAC__bool FLAC__bitreader_read_uint32_little_endian ( FLAC__BitReader * br,
FLAC__uint32 * val )
inline

◆ FLAC__bitreader_read_unary_unsigned()

FLAC__bool FLAC__bitreader_read_unary_unsigned ( FLAC__BitReader * br,
unsigned * val )

◆ FLAC__bitreader_read_utf8_uint32()

FLAC__bool FLAC__bitreader_read_utf8_uint32 ( FLAC__BitReader * br,
FLAC__uint32 * val,
FLAC__byte * raw,
unsigned * rawlen )

◆ FLAC__bitreader_read_utf8_uint64()

FLAC__bool FLAC__bitreader_read_utf8_uint64 ( FLAC__BitReader * br,
FLAC__uint64 * val,
FLAC__byte * raw,
unsigned * rawlen )

◆ FLAC__bitreader_reset_read_crc16()

void FLAC__bitreader_reset_read_crc16 ( FLAC__BitReader * br,
FLAC__uint16 seed )

◆ FLAC__bitreader_skip_bits_no_crc()

FLAC__bool FLAC__bitreader_skip_bits_no_crc ( FLAC__BitReader * br,
unsigned bits )

◆ FLAC__bitreader_skip_byte_block_aligned_no_crc()

FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc ( FLAC__BitReader * br,
unsigned nvals )

Variable Documentation

◆ FLAC__BITREADER_DEFAULT_CAPACITY

const unsigned FLAC__BITREADER_DEFAULT_CAPACITY = 65536u / FLAC__BITS_PER_WORD
static