RetroArch
Classes | Macros | Typedefs | Functions | Variables
bitreader.c File Reference
#include <retro_miscellaneous.h>
#include <stdlib.h>
#include <string.h>
#include "include/private/bitmath.h"
#include "include/private/bitreader.h"
#include "include/private/crc.h"
#include "include/private/macros.h"
#include "include/FLAC/assert.h"
#include "include/share/compat.h"
#include "include/share/endswap.h"
Include dependency graph for bitreader.c:

Classes

struct  FLAC__BitReader
 

Macros

#define FLAC__BYTES_PER_WORD   4 /* sizeof brword */
 
#define FLAC__BITS_PER_WORD   32
 
#define FLAC__WORD_ALL_ONES   ((FLAC__uint32)0xffffffff)
 
#define SWAP_BE_WORD_TO_HOST(x)   ENDSWAP_32(x)
 
#define COUNT_ZERO_MSBS(word)   FLAC__clz_uint32(word)
 
#define COUNT_ZERO_MSBS2(word)   FLAC__clz2_uint32(word)
 

Typedefs

typedef FLAC__uint32 brword
 

Functions

static INLINE void crc16_update_word_ (FLAC__BitReader *br, brword 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

◆ COUNT_ZERO_MSBS

#define COUNT_ZERO_MSBS (   word)    FLAC__clz_uint32(word)

◆ COUNT_ZERO_MSBS2

#define COUNT_ZERO_MSBS2 (   word)    FLAC__clz2_uint32(word)

◆ FLAC__BITS_PER_WORD

#define FLAC__BITS_PER_WORD   32

◆ FLAC__BYTES_PER_WORD

#define FLAC__BYTES_PER_WORD   4 /* sizeof brword */

◆ FLAC__WORD_ALL_ONES

#define FLAC__WORD_ALL_ONES   ((FLAC__uint32)0xffffffff)

◆ SWAP_BE_WORD_TO_HOST

#define SWAP_BE_WORD_TO_HOST (   x)    ENDSWAP_32(x)

Typedef Documentation

◆ brword

Function Documentation

◆ bitreader_read_from_client_()

static FLAC__bool bitreader_read_from_client_ ( FLAC__BitReader br)
static
Here is the caller graph for this function:

◆ crc16_update_word_()

static INLINE void crc16_update_word_ ( FLAC__BitReader br,
brword  word 
)
static
Here is the caller graph for this function:

◆ FLAC__bitreader_bits_left_for_byte_alignment()

unsigned FLAC__bitreader_bits_left_for_byte_alignment ( const FLAC__BitReader br)
Here is the caller graph for this function:

◆ FLAC__bitreader_clear()

FLAC__bool FLAC__bitreader_clear ( FLAC__BitReader br)
Here is the caller graph for this function:

◆ FLAC__bitreader_delete()

void FLAC__bitreader_delete ( FLAC__BitReader br)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_dump()

void FLAC__bitreader_dump ( const FLAC__BitReader br,
FILE out 
)

◆ FLAC__bitreader_free()

void FLAC__bitreader_free ( FLAC__BitReader br)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_get_input_bits_unconsumed()

unsigned FLAC__bitreader_get_input_bits_unconsumed ( const FLAC__BitReader br)
Here is the caller graph for this function:

◆ FLAC__bitreader_get_read_crc16()

FLAC__uint16 FLAC__bitreader_get_read_crc16 ( FLAC__BitReader br)
Here is the caller graph for this function:

◆ FLAC__bitreader_init()

FLAC__bool FLAC__bitreader_init ( FLAC__BitReader br,
FLAC__BitReaderReadCallback  rcb,
void cd 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_is_consumed_byte_aligned()

FLAC__bool FLAC__bitreader_is_consumed_byte_aligned ( const FLAC__BitReader br)
Here is the caller graph for this function:

◆ FLAC__bitreader_new()

FLAC__BitReader* FLAC__bitreader_new ( void  )
Here is the caller graph for this function:

◆ 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 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_raw_int32()

FLAC__bool FLAC__bitreader_read_raw_int32 ( FLAC__BitReader br,
FLAC__int32 val,
unsigned  bits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_raw_uint32()

FLAC__bool FLAC__bitreader_read_raw_uint32 ( FLAC__BitReader br,
FLAC__uint32 val,
unsigned  bits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_raw_uint64()

FLAC__bool FLAC__bitreader_read_raw_uint64 ( FLAC__BitReader br,
FLAC__uint64 val,
unsigned  bits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_rice_signed()

FLAC__bool FLAC__bitreader_read_rice_signed ( FLAC__BitReader br,
int *  val,
unsigned  parameter 
)
Here is the call graph for this function:

◆ FLAC__bitreader_read_rice_signed_block()

FLAC__bool FLAC__bitreader_read_rice_signed_block ( FLAC__BitReader br,
int  vals[],
unsigned  nvals,
unsigned  parameter 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_uint32_little_endian()

FLAC__bool FLAC__bitreader_read_uint32_little_endian ( FLAC__BitReader br,
FLAC__uint32 val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_unary_unsigned()

FLAC__bool FLAC__bitreader_read_unary_unsigned ( FLAC__BitReader br,
unsigned *  val 
)
Here is the caller graph for this function:

◆ FLAC__bitreader_read_utf8_uint32()

FLAC__bool FLAC__bitreader_read_utf8_uint32 ( FLAC__BitReader br,
FLAC__uint32 val,
FLAC__byte raw,
unsigned *  rawlen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_read_utf8_uint64()

FLAC__bool FLAC__bitreader_read_utf8_uint64 ( FLAC__BitReader br,
FLAC__uint64 val,
FLAC__byte raw,
unsigned *  rawlen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_reset_read_crc16()

void FLAC__bitreader_reset_read_crc16 ( FLAC__BitReader br,
FLAC__uint16  seed 
)
Here is the caller graph for this function:

◆ FLAC__bitreader_skip_bits_no_crc()

FLAC__bool FLAC__bitreader_skip_bits_no_crc ( FLAC__BitReader br,
unsigned  bits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLAC__bitreader_skip_byte_block_aligned_no_crc()

FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc ( FLAC__BitReader br,
unsigned  nvals 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FLAC__BITREADER_DEFAULT_CAPACITY

const unsigned FLAC__BITREADER_DEFAULT_CAPACITY = 65536u / FLAC__BITS_PER_WORD
static