zenilib: zenilib/jni/external/libogg/src/bitwise.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
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

Definition at line 26 of file bitwise.c.

Referenced by oggpack_write(), oggpack_writecopy_helper(), oggpack_writeinit(), and oggpackB_write().

## Function Documentation

void oggpack_adv | ( | oggpack_buffer * | b,
|  | int | bits
| ) |  |

Definition at line 338 of file bitwise.c.

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

Referenced by decode_packed_entry_number(), and oggpackB_adv().

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().

long oggpack_bytes | ( | oggpack_buffer * | b | ) |

Definition at line 499 of file bitwise.c.

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

Referenced by _vorbis_unpack_comment(), oggpackB_bytes(), vorbis_analysis(), vorbis_analysis_headerout(), vorbis_bitrate_addblock(), vorbis_bitrate_flushpacket(), vorbis_commentheader_out(), and vorbis_staticbook_unpack().

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
| ) |  |

Definition at line 266 of file bitwise.c.

References bits, oggpack_buffer::endbit, oggpack_buffer::endbyte, m, oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

Referenced by decode_packed_entry_number().

long oggpack_look1 | ( | oggpack_buffer * | b | ) |

Definition at line 328 of file bitwise.c.

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

long oggpack_read | ( | oggpack_buffer * | b,
|  | int | bits
| ) |  |

Definition at line 371 of file bitwise.c.

References bits, oggpack_buffer::endbit, oggpack_buffer::endbyte, m, NULL, oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

Referenced by _v_readstring(), _vorbis_unpack_books(), _vorbis_unpack_comment(), _vorbis_unpack_info(), floor0_inverse1(), floor0_unpack(), floor1_inverse1(), floor1_unpack(), mapping0_unpack(), res0_unpack(), vorbis_packet_blocksize(), vorbis_staticbook_unpack(), vorbis_synthesis(), vorbis_synthesis_headerin(), vorbis_synthesis_idheader(), and vorbis_synthesis_trackonly().

long oggpack_read1 | ( | oggpack_buffer * | b | ) |

Definition at line 457 of file bitwise.c.

References oggpack_buffer::endbit, oggpack_buffer::endbyte, NULL, oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

void oggpack_readinit | ( | oggpack_buffer * | b,
|  | unsigned char * | buf,
|  | int | bytes
| ) |  |

Definition at line 255 of file bitwise.c.

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

Referenced by oggpackB_readinit(), vorbis_packet_blocksize(), vorbis_synthesis(), vorbis_synthesis_headerin(), vorbis_synthesis_idheader(), and vorbis_synthesis_trackonly().

void oggpack_reset | ( | oggpack_buffer * | b | ) |

Definition at line 235 of file bitwise.c.

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

Referenced by oggpackB_reset(), vorbis_analysis(), and vorbis_analysis_headerout().

void oggpack_write | ( | oggpack_buffer * | b,
|  | unsigned long | value,
|  | int | bits
| ) |  |

Definition at line 83 of file bitwise.c.

References _ogg_realloc, bits, oggpack_buffer::buffer, BUFFER_INCREMENT, oggpack_buffer::endbit, oggpack_buffer::endbyte, oggpack_writeclear(), oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

Referenced by _v_writestring(), _vorbis_pack_books(), _vorbis_pack_comment(), _vorbis_pack_info(), floor1_encode(), floor1_pack(), mapping0_forward(), mapping0_pack(), oggpack_writealign(), oggpack_writecopy(), res0_pack(), vorbis_bitrate_addblock(), vorbis_book_encode(), and vorbis_staticbook_pack().

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_writeclear | ( | oggpack_buffer * | b | ) |

Definition at line 246 of file bitwise.c.

References _ogg_free, oggpack_buffer::buffer, and memset.

Referenced by oggpack_write(), oggpack_writecopy_helper(), oggpackB_write(), oggpackB_writeclear(), vorbis_analysis_headerout(), and vorbis_block_clear().

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

Definition at line 180 of file bitwise.c.

References _ogg_realloc, oggpack_buffer::buffer, BUFFER_INCREMENT, oggpack_buffer::endbit, oggpack_buffer::endbyte, i, memmove, oggpack_writeclear(), oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

Referenced by oggpack_writecopy(), and oggpackB_writecopy().

void oggpack_writeinit | ( | oggpack_buffer * | b | ) |

Definition at line 40 of file bitwise.c.

References _ogg_malloc, oggpack_buffer::buffer, BUFFER_INCREMENT, memset, oggpack_buffer::ptr, and oggpack_buffer::storage.

Referenced by oggpackB_writeinit(), vorbis_analysis_headerout(), vorbis_block_init(), and vorbis_commentheader_out().

void oggpack_writetrunc | ( | oggpack_buffer * | b,
|  | long | bits
| ) |  |

Definition at line 60 of file bitwise.c.

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

Referenced by vorbis_bitrate_addblock().

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
| ) |  |

Definition at line 298 of file bitwise.c.

References bits, oggpack_buffer::endbit, oggpack_buffer::endbyte, oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

long oggpackB_look1 | ( | oggpack_buffer * | b | ) |

Definition at line 333 of file bitwise.c.

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

long oggpackB_read | ( | oggpack_buffer * | b,
|  | int | bits
| ) |  |

Definition at line 415 of file bitwise.c.

References bits, oggpack_buffer::endbit, oggpack_buffer::endbyte, NULL, oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

long oggpackB_read1 | ( | oggpack_buffer * | b | ) |

Definition at line 478 of file bitwise.c.

References oggpack_buffer::endbit, oggpack_buffer::endbyte, NULL, oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

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_write | ( | oggpack_buffer * | b,
|  | unsigned long | value,
|  | int | bits
| ) |  |

Definition at line 126 of file bitwise.c.

References _ogg_realloc, bits, oggpack_buffer::buffer, BUFFER_INCREMENT, oggpack_buffer::endbit, oggpack_buffer::endbyte, oggpack_writeclear(), oggpack_buffer::ptr, ret, and oggpack_buffer::storage.

Referenced by oggpackB_writealign(), and oggpackB_writecopy().

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
| ) |  |

Definition at line 71 of file bitwise.c.

References bits, oggpack_buffer::buffer, oggpack_buffer::endbit, oggpack_buffer::endbyte, mask8B, and oggpack_buffer::ptr.

## 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().