zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bitwise.c File Reference
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <ogg/ogg.h>

Go to the source code of this file.

Macros

#define BUFFER_INCREMENT   256
 

Functions

void oggpack_adv (oggpack_buffer *b, int bits)
 
void oggpack_adv1 (oggpack_buffer *b)
 
long oggpack_bits (oggpack_buffer *b)
 
long oggpack_bytes (oggpack_buffer *b)
 
unsigned char * oggpack_get_buffer (oggpack_buffer *b)
 
long oggpack_look (oggpack_buffer *b, int bits)
 
long oggpack_look1 (oggpack_buffer *b)
 
long oggpack_read (oggpack_buffer *b, int bits)
 
long oggpack_read1 (oggpack_buffer *b)
 
void oggpack_readinit (oggpack_buffer *b, unsigned char *buf, int bytes)
 
void oggpack_reset (oggpack_buffer *b)
 
void oggpack_write (oggpack_buffer *b, unsigned long value, int bits)
 
void oggpack_writealign (oggpack_buffer *b)
 
int oggpack_writecheck (oggpack_buffer *b)
 
void oggpack_writeclear (oggpack_buffer *b)
 
void oggpack_writecopy (oggpack_buffer *b, void *source, long bits)
 
static void oggpack_writecopy_helper (oggpack_buffer *b, void *source, long bits, void(*w)(oggpack_buffer *, unsigned long, int), int msb)
 
void oggpack_writeinit (oggpack_buffer *b)
 
void oggpack_writetrunc (oggpack_buffer *b, long bits)
 
void oggpackB_adv (oggpack_buffer *b, int bits)
 
void oggpackB_adv1 (oggpack_buffer *b)
 
long oggpackB_bits (oggpack_buffer *b)
 
long oggpackB_bytes (oggpack_buffer *b)
 
unsigned char * oggpackB_get_buffer (oggpack_buffer *b)
 
long oggpackB_look (oggpack_buffer *b, int bits)
 
long oggpackB_look1 (oggpack_buffer *b)
 
long oggpackB_read (oggpack_buffer *b, int bits)
 
long oggpackB_read1 (oggpack_buffer *b)
 
void oggpackB_readinit (oggpack_buffer *b, unsigned char *buf, int bytes)
 
void oggpackB_reset (oggpack_buffer *b)
 
void oggpackB_write (oggpack_buffer *b, unsigned long value, int bits)
 
void oggpackB_writealign (oggpack_buffer *b)
 
int oggpackB_writecheck (oggpack_buffer *b)
 
void oggpackB_writeclear (oggpack_buffer *b)
 
void oggpackB_writecopy (oggpack_buffer *b, void *source, long bits)
 
void oggpackB_writeinit (oggpack_buffer *b)
 
void oggpackB_writetrunc (oggpack_buffer *b, long bits)
 

Variables

static const unsigned long mask []
 
static const unsigned int mask8B []
 

Macro Definition Documentation

#define BUFFER_INCREMENT   256

Function Documentation

void oggpack_adv ( oggpack_buffer b,
int  bits 
)
void oggpack_adv1 ( oggpack_buffer b)

Definition at line 358 of file bitwise.c.

References oggpack_buffer::endbit, oggpack_buffer::endbyte, and oggpack_buffer::ptr.

Referenced by oggpackB_adv1().

long oggpack_bits ( oggpack_buffer b)

Definition at line 503 of file bitwise.c.

References oggpack_buffer::endbit, and oggpack_buffer::endbyte.

Referenced by oggpackB_bits().

unsigned char* oggpack_get_buffer ( oggpack_buffer b)

Definition at line 515 of file bitwise.c.

References oggpack_buffer::buffer.

Referenced by oggpackB_get_buffer(), vorbis_analysis(), and vorbis_bitrate_flushpacket().

long oggpack_look ( oggpack_buffer b,
int  bits 
)
long oggpack_look1 ( oggpack_buffer b)
long oggpack_read1 ( oggpack_buffer b)
void oggpack_writealign ( oggpack_buffer b)

Definition at line 168 of file bitwise.c.

References oggpack_buffer::endbit, and oggpack_write().

int oggpack_writecheck ( oggpack_buffer b)

Definition at line 51 of file bitwise.c.

References oggpack_buffer::ptr, and oggpack_buffer::storage.

Referenced by oggpackB_writecheck().

void oggpack_writecopy ( oggpack_buffer b,
void source,
long  bits 
)

Definition at line 227 of file bitwise.c.

References oggpack_write(), and oggpack_writecopy_helper().

static void oggpack_writecopy_helper ( oggpack_buffer b,
void source,
long  bits,
void(*)(oggpack_buffer *, unsigned long, int w,
int  msb 
)
static
void oggpack_writetrunc ( oggpack_buffer b,
long  bits 
)
void oggpackB_adv ( oggpack_buffer b,
int  bits 
)

Definition at line 354 of file bitwise.c.

References oggpack_adv().

void oggpackB_adv1 ( oggpack_buffer b)

Definition at line 366 of file bitwise.c.

References oggpack_adv1().

long oggpackB_bits ( oggpack_buffer b)

Definition at line 511 of file bitwise.c.

References oggpack_bits().

long oggpackB_bytes ( oggpack_buffer b)

Definition at line 507 of file bitwise.c.

References oggpack_bytes().

unsigned char* oggpackB_get_buffer ( oggpack_buffer b)

Definition at line 519 of file bitwise.c.

References oggpack_get_buffer().

long oggpackB_look ( oggpack_buffer b,
int  bits 
)
long oggpackB_look1 ( oggpack_buffer b)
long oggpackB_read ( oggpack_buffer b,
int  bits 
)
long oggpackB_read1 ( oggpack_buffer b)
void oggpackB_readinit ( oggpack_buffer b,
unsigned char *  buf,
int  bytes 
)

Definition at line 261 of file bitwise.c.

References oggpack_readinit().

void oggpackB_reset ( oggpack_buffer b)

Definition at line 242 of file bitwise.c.

References oggpack_reset().

void oggpackB_writealign ( oggpack_buffer b)

Definition at line 174 of file bitwise.c.

References oggpack_buffer::endbit, and oggpackB_write().

int oggpackB_writecheck ( oggpack_buffer b)

Definition at line 56 of file bitwise.c.

References oggpack_writecheck().

void oggpackB_writeclear ( oggpack_buffer b)

Definition at line 251 of file bitwise.c.

References oggpack_writeclear().

void oggpackB_writecopy ( oggpack_buffer b,
void source,
long  bits 
)

Definition at line 231 of file bitwise.c.

References oggpack_writecopy_helper(), and oggpackB_write().

void oggpackB_writeinit ( oggpack_buffer b)

Definition at line 47 of file bitwise.c.

References oggpack_writeinit().

void oggpackB_writetrunc ( oggpack_buffer b,
long  bits 
)

Variable Documentation

const unsigned long mask[]
static
Initial value:
=
{0x00000000,0x00000001,0x00000003,0x00000007,0x0000000f,
0x0000001f,0x0000003f,0x0000007f,0x000000ff,0x000001ff,
0x000003ff,0x000007ff,0x00000fff,0x00001fff,0x00003fff,
0x00007fff,0x0000ffff,0x0001ffff,0x0003ffff,0x0007ffff,
0x000fffff,0x001fffff,0x003fffff,0x007fffff,0x00ffffff,
0x01ffffff,0x03ffffff,0x07ffffff,0x0fffffff,0x1fffffff,
0x3fffffff,0x7fffffff,0xffffffff }

Definition at line 28 of file bitwise.c.

const unsigned int mask8B[]
static
Initial value:
=
{0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff}

Definition at line 37 of file bitwise.c.

Referenced by oggpackB_writetrunc().