hvirtual/toolame-02l/bitstream.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include "common.h"
#include "mem.h"
#include "bitstream.h"

Include dependency graph for bitstream.c:

Go to the source code of this file.

Defines

#define BUFSIZE   4096

Functions

int refill_buffer (Bit_stream_struc *bs)
void empty_buffer (Bit_stream_struc *bs, int minimum)
void open_bit_stream_w (Bit_stream_struc *bs, char *bs_filenam, int size)
void close_bit_stream_w (Bit_stream_struc *bs)
void alloc_buffer (Bit_stream_struc *bs, int size)
void desalloc_buffer (Bit_stream_struc *bs)
void back_track_buffer (Bit_stream_struc *bs, int N)
void put1bit (Bit_stream_struc *bs, int bit)
INLINE void putbits (Bit_stream_struc *bs, unsigned int val, int N)
void byte_ali_putbits (Bit_stream_struc *bs, unsigned int val, int N)
unsigned long sstell (Bit_stream_struc *bs)
int end_bs (Bit_stream_struc *bs)
unsigned long hsstell ()
void hputbuf (unsigned int val, int N)

Variables

int minimum = MINIMUM
int putmask [9] = { 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff }
int clearmask [9] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x0 }
int mask [8] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }
static unsigned long offset
static unsigned long totbit = 0
static unsigned int buf [BUFSIZE]


Define Documentation

#define BUFSIZE   4096

Definition at line 261 of file bitstream.c.


Function Documentation

void alloc_buffer ( Bit_stream_struc bs,
int  size 
)

Definition at line 147 of file bitstream.c.

References bit_stream_struc::buf, bit_stream_struc::buf_size, and mem_alloc().

Referenced by open_bit_stream_w().

Here is the call graph for this function:

void back_track_buffer ( Bit_stream_struc bs,
int  N 
)

void byte_ali_putbits ( Bit_stream_struc bs,
unsigned int  val,
int  N 
)

Definition at line 227 of file bitstream.c.

References fprintf, MAX_LENGTH, putbits(), and sstell().

Here is the call graph for this function:

void close_bit_stream_w ( Bit_stream_struc bs  ) 

Definition at line 138 of file bitstream.c.

References bit_stream_struc::buf_byte_idx, desalloc_buffer(), empty_buffer(), fclose(), bit_stream_struc::pt, and putbits().

Referenced by toolame().

Here is the call graph for this function:

void desalloc_buffer ( Bit_stream_struc bs  ) 

Definition at line 155 of file bitstream.c.

References bit_stream_struc::buf.

Referenced by close_bit_stream_w().

void empty_buffer ( Bit_stream_struc bs,
int  minimum 
)

Definition at line 103 of file bitstream.c.

References bit_stream_struc::buf, bit_stream_struc::buf_bit_idx, bit_stream_struc::buf_byte_idx, bit_stream_struc::buf_size, fwrite(), and bit_stream_struc::pt.

Referenced by close_bit_stream_w(), put1bit(), and putbits().

Here is the call graph for this function:

int end_bs ( Bit_stream_struc bs  ) 

Definition at line 250 of file bitstream.c.

References bit_stream_struc::eobs.

void hputbuf ( unsigned int  val,
int  N 
)

Definition at line 275 of file bitstream.c.

References buf, BUFSIZE, fprintf, and offset.

unsigned long hsstell ( void   ) 

Definition at line 266 of file bitstream.c.

References totbit.

void open_bit_stream_w ( Bit_stream_struc bs,
char *  bs_filenam,
int  size 
)

void put1bit ( Bit_stream_struc bs,
int  bit 
)

Definition at line 185 of file bitstream.c.

References bit_stream_struc::buf, bit_stream_struc::buf_bit_idx, bit_stream_struc::buf_byte_idx, empty_buffer(), minimum, and bit_stream_struc::totbit.

Referenced by encode_info(), toolame(), and write_header().

Here is the call graph for this function:

INLINE void putbits ( Bit_stream_struc bs,
unsigned int  val,
int  N 
)

Definition at line 201 of file bitstream.c.

References bit_stream_struc::buf, bit_stream_struc::buf_bit_idx, bit_stream_struc::buf_byte_idx, empty_buffer(), MIN, minimum, putmask, and bit_stream_struc::totbit.

Here is the call graph for this function:

int refill_buffer ( Bit_stream_struc bs  ) 

unsigned long sstell ( Bit_stream_struc bs  ) 

Definition at line 242 of file bitstream.c.

References bit_stream_struc::totbit.

Referenced by byte_ali_putbits(), and toolame().


Variable Documentation

unsigned int buf[BUFSIZE] [static]

int clearmask[9] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x0 }

Definition at line 161 of file bitstream.c.

Referenced by back_track_buffer().

int mask[8] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }

Definition at line 182 of file bitstream.c.

int minimum = MINIMUM

Definition at line 43 of file bitstream.c.

unsigned long offset [static]

Definition at line 262 of file bitstream.c.

int putmask[9] = { 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff }

Definition at line 160 of file bitstream.c.

Referenced by putbits().

unsigned long totbit = 0 [static]

Definition at line 262 of file bitstream.c.

Referenced by hsstell().


Generated on Mon Apr 28 13:58:49 2008 for Cinelerra by  doxygen 1.5.5