bitstream.c File Reference

bitstream api. More...

Include dependency graph for bitstream.c:


Defines

#define DEBUGF   printf
#define GET_DATA(v, table, i, wrap, size)

Functions

void * ff_realloc_static (void *ptr, unsigned int size)
 Same as av_mallocz_static(), but does a realloc.
void align_put_bits (PutBitContext *s)
void ff_put_string (PutBitContext *pbc, char *s, int put_zero)
static int alloc_table (VLC *vlc, int size)
static int build_table (VLC *vlc, int table_nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, uint32_t code_prefix, int n_prefix)
int init_vlc (VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, int flags)

Variables

const uint8_t ff_sqrt_tab [128]
const uint8_t ff_log2_tab [256]

Detailed Description

bitstream api.


Define Documentation

#define DEBUGF   printf

Referenced by alloc_table().

#define GET_DATA ( v,
table,
i,
wrap,
size   ) 

Value:

{\
    const uint8_t *ptr = (const uint8_t *)table + i * wrap;\
    switch(size) {\
    case 1:\
        v = *(const uint8_t *)ptr;\
        break;\
    case 2:\
        v = *(const uint16_t *)ptr;\
        break;\
    default:\
        v = *(const uint32_t *)ptr;\
        break;\
    }\
}

Referenced by build_table().


Function Documentation

void align_put_bits ( PutBitContext s  ) 

References PutBitContext::bit_left, and put_bits().

Referenced by flush_put_bits().

static int alloc_table ( VLC vlc,
int  size 
) [static]

static int build_table ( VLC vlc,
int  table_nb_bits,
int  nb_codes,
const void *  bits,
int  bits_wrap,
int  bits_size,
const void *  codes,
int  codes_wrap,
int  codes_size,
uint32_t  code_prefix,
int  n_prefix 
) [static]

References alloc_table(), GET_DATA, i, index, INIT_VLC_LE, VLC::table, and VLC_TYPE.

Referenced by init_vlc().

void ff_put_string ( PutBitContext pbc,
char *  s,
int  put_zero 
)

References put_bits().

void* ff_realloc_static ( void *  ptr,
unsigned int  size 
)

Same as av_mallocz_static(), but does a realloc.

Parameters:
[in] ptr The block of memory to reallocate.
[in] size The requested size.
Returns:
Block of memory of requested size.
Deprecated:
. Code which uses ff_realloc_static is broken/missdesigned and should correctly use static arrays

int init_vlc ( VLC vlc,
int  nb_bits,
int  nb_codes,
const void *  bits,
int  bits_wrap,
int  bits_size,
const void *  codes,
int  codes_wrap,
int  codes_size,
int  flags 
)


Variable Documentation

const uint8_t ff_log2_tab[256]

Initial value:

{
        0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
        5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
}

Referenced by av_log2().

const uint8_t ff_sqrt_tab[128]

Initial value:

{
        0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
        5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
        9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
}


Generated on Tue May 25 08:05:14 2010 for VLC by  doxygen 1.5.6