libavcodec/put_bits.h File Reference

bitstream writer API More...

#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  PutBitContext

Functions

static void init_put_bits (PutBitContext *s, uint8_t *buffer, int buffer_size)
 Initializes the PutBitContext s.
static int put_bits_count (PutBitContext *s)
 Returns the total number of bits written to the bitstream.
static void flush_put_bits (PutBitContext *s)
 Pads the end of the output stream with zeros.
void align_put_bits (PutBitContext *s)
 Pads the bitstream with zeros up to the next byte boundary.
void ff_put_string (PutBitContext *pb, const char *string, int terminate_string)
 Puts the string string in the bitstream.
void ff_copy_bits (PutBitContext *pb, const uint8_t *src, int length)
 Copies the content of src to the bitstream.
static void put_bits (PutBitContext *s, int n, unsigned int value)
 Writes up to 31 bits into a bitstream.
static void put_sbits (PutBitContext *pb, int n, int32_t value)
static void av_unused put_bits32 (PutBitContext *s, uint32_t value)
 Writes exactly 32 bits into a bitstream.
static uint8_t * put_bits_ptr (PutBitContext *s)
 Returns the pointer to the byte where the bitstream writer will put the next bit.
static void skip_put_bytes (PutBitContext *s, int n)
 Skips the given number of bytes.
static void skip_put_bits (PutBitContext *s, int n)
 Skips the given number of bits.
static void set_put_bits_buffer_size (PutBitContext *s, int size)
 Changes the end of the buffer.


Detailed Description

bitstream writer API

Definition in file put_bits.h.


Function Documentation

void align_put_bits ( PutBitContext s  ) 

void ff_copy_bits ( PutBitContext pb,
const uint8_t *  src,
int  length 
)

Copies the content of src to the bitstream.

Parameters:
length the number of bits of src to copy

Definition at line 61 of file bitstream.c.

Referenced by copy_bits(), encode_thread(), ff_mpeg4_merge_partitions(), merge_context_after_encode(), save_bits(), and svq1_encode_plane().

void ff_put_string ( PutBitContext pb,
const char *  string,
int  terminate_string 
)

Puts the string string in the bitstream.

Parameters:
terminate_string 0-terminates the written string if value is 1

Definition at line 51 of file bitstream.c.

Referenced by jpeg_put_comments(), and mpeg4_encode_vol_header().

static void flush_put_bits ( PutBitContext s  )  [inline, static]

static void init_put_bits ( PutBitContext s,
uint8_t *  buffer,
int  buffer_size 
) [inline, static]

static void put_bits ( PutBitContext s,
int  n,
unsigned int  value 
) [inline, static]

Writes up to 31 bits into a bitstream.

Use put_bits32 to write 32 bits.

Definition at line 149 of file put_bits.h.

Referenced by aac_adtstoasc_filter(), aac_encode_frame(), alac_encode_frame(), align_put_bits(), asv1_encode_block(), asv1_put_level(), asv2_encode_block(), asv2_put_bits(), asv2_put_level(), bit_copy(), copy_bits(), dca_convert_bitstream(), dnxhd_encode_block(), dnxhd_encode_dc(), dnxhd_encode_thread(), dv_encode_ac(), dv_encode_video_segment(), encode_bitstream(), encode_block(), encode_dc(), encode_exp_vlc(), encode_ext_header(), encode_frame(), encode_individual_channel(), encode_mb_skip_run(), encode_ms_info(), encode_picture_ls(), encode_pulses(), encode_scalar(), encode_scale_factors(), encode_superframe(), encode_window_bands_info(), ff_adts_decode_extradata(), ff_adts_write_frame_header(), ff_copy_bits(), ff_flv2_encode_ac_esc(), ff_flv_encode_picture_header(), ff_h261_encode_mb(), ff_h261_encode_picture_header(), ff_h263_encode_mba(), ff_h263_encode_motion(), ff_mjpeg_decode_frame(), ff_mjpeg_encode_dc(), ff_mjpeg_encode_picture_header(), ff_mjpeg_encode_stuffing(), ff_mpeg1_encode_slice_header(), ff_mpeg4_encode_video_packet_header(), ff_mpeg4_merge_partitions(), ff_mpeg4_stuffing(), ff_msmpeg4_encode_block(), ff_put_string(), ff_wmv2_encode_mb(), ff_wmv2_encode_picture_header(), ff_write_quant_matrix(), floor_encode(), gif_image_write_image(), h261_encode_block(), h261_encode_gob_header(), h261_encode_motion(), h263_encode_block(), h263_encode_gob_header(), h263_encode_mb(), h263_encode_picture_header(), h263p_encode_umotion(), h264_write_nal_unit(), jpeg_put_comments(), jpeg_table_header(), ls_encode_run(), ls_store_lse(), main(), mov_write_ac3_tag(), mpeg1_encode_block(), mpeg1_encode_mb_internal(), mpeg1_encode_motion(), mpeg1_encode_picture_header(), mpeg1_encode_sequence_header(), mpeg4_encode_block(), mpeg4_encode_dc(), mpeg4_encode_gop_header(), mpeg4_encode_mb(), mpeg4_encode_picture_header(), mpeg4_encode_visual_object_header(), mpeg4_encode_vol_header(), MPV_encode_picture(), msmpeg4_encode_dc(), output_audio_block(), output_frame_footer(), output_frame_header(), output_residual(), output_subframe_lpc(), output_subframes(), pnm_decode_frame(), put_audio_specific_config(), put_bits32(), put_bitstream_info(), put_cabac_bit(), put_codebook_header(), put_codeword(), put_floor_header(), put_header(), put_huffman_table(), put_ics_info(), put_main_header(), put_marker(), put_mb_modes(), put_pack_header(), put_qscale(), put_residue_header(), put_sbits(), put_swf_line_edge(), put_swf_matrix(), put_swf_rect(), put_system_header(), put_xsub_rle(), quantize_and_encode_band_cost(), rv10_encode_picture_header(), rv20_encode_picture_header(), save_bits(), set_te_golomb(), set_ue_golomb(), set_ur_golomb(), set_ur_golomb_jpegls(), svq1_encode_frame(), svq1_encode_plane(), svq1_write_header(), swf_write_header(), vorbis_encode_frame(), write_compressed_frame(), write_frame_header(), write_streaminfo(), and write_utf8().

static void av_unused put_bits32 ( PutBitContext s,
uint32_t  value 
) [static]

Writes exactly 32 bits into a bitstream.

Definition at line 275 of file put_bits.h.

Referenced by put_float(), put_main_header(), put_pack_header(), put_system_header(), and write_frame_header().

static int put_bits_count ( PutBitContext s  )  [inline, static]

static uint8_t* put_bits_ptr ( PutBitContext s  )  [inline, static]

static void put_sbits ( PutBitContext pb,
int  n,
int32_t  value 
) [inline, static]

static void set_put_bits_buffer_size ( PutBitContext s,
int  size 
) [inline, static]

Changes the end of the buffer.

Parameters:
size the new size in bytes of the buffer where to put bits

Definition at line 338 of file put_bits.h.

Referenced by ff_mpeg4_init_partitions(), and ff_mpeg4_merge_partitions().

static void skip_put_bits ( PutBitContext s,
int  n 
) [inline, static]

Skips the given number of bits.

Must only be used if the actual values in the bitstream do not matter. If n is 0 the behavior is undefined.

Definition at line 322 of file put_bits.h.

Referenced by ff_h263_encode_motion_vector(), and mpeg4_encode_blocks().

static void skip_put_bytes ( PutBitContext s,
int  n 
) [inline, static]

Skips the given number of bytes.

PutBitContext must be flushed & aligned to a byte boundary before calling this.

Definition at line 305 of file put_bits.h.

Referenced by escape_FF(), and ff_copy_bits().


Generated on Fri Oct 26 02:36:53 2012 for FFmpeg by  doxygen 1.5.8