#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"
#include "config.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) |
Initialize the PutBitContext s. | |
static int | put_bits_count (PutBitContext *s) |
static void | flush_put_bits (PutBitContext *s) |
Pad the end of the output stream with zeros. | |
void | align_put_bits (PutBitContext *s) |
Pad the bitstream with zeros up to the next byte boundary. | |
void | ff_put_string (PutBitContext *pb, const char *string, int terminate_string) |
Put the string string in the bitstream. | |
void | ff_copy_bits (PutBitContext *pb, const uint8_t *src, int length) |
Copy the content of src to the bitstream. | |
static void | put_bits (PutBitContext *s, int n, unsigned int value) |
Write 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) |
Write exactly 32 bits into a bitstream. | |
static uint8_t * | put_bits_ptr (PutBitContext *s) |
Return the pointer to the byte where the bitstream writer will put the next bit. | |
static void | skip_put_bytes (PutBitContext *s, int n) |
Skip the given number of bytes. | |
static void | skip_put_bits (PutBitContext *s, int n) |
Skip the given number of bits. | |
static void | set_put_bits_buffer_size (PutBitContext *s, int size) |
Change the end of the buffer. |
Definition in file put_bits.h.
void align_put_bits | ( | PutBitContext * | s | ) |
Pad the bitstream with zeros up to the next byte boundary.
Definition at line 44 of file bitstream.c.
Referenced by encode_block(), encode_frame(), encode_picture_ls(), ff_copy_pce_data(), ff_flv_encode_picture_header(), ff_h261_encode_picture_header(), flush_put_bits(), h263_encode_picture_header(), put_bitstream_info(), put_header(), rv10_encode_picture_header(), write_slice_end(), xsub_encode(), and xsub_encode_rle().
void ff_copy_bits | ( | PutBitContext * | pb, | |
const uint8_t * | src, | |||
int | length | |||
) |
Copy the content of src to the bitstream.
length | the number of bits of src to copy |
Definition at line 63 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 | |||
) |
Put the string string in the bitstream.
terminate_string | 0-terminates the written string if value is 1 |
Definition at line 53 of file bitstream.c.
Referenced by jpeg_put_comments(), and mpeg4_encode_vol_header().
static void flush_put_bits | ( | PutBitContext * | s | ) | [inline, static] |
Pad the end of the output stream with zeros.
Definition at line 97 of file put_bits.h.
Referenced by aac_adtstoasc_filter(), aac_encode_frame(), alac_encode_frame(), dca_convert_bitstream(), dnxhd_encode_thread(), dv_decode_video_segment(), dv_encode_video_segment(), encode_bitstream(), encode_block(), encode_ext_header(), encode_frame(), encode_init(), encode_picture_lossless(), encode_picture_ls(), encode_superframe(), encode_thread(), escape_FF(), ff_adts_decode_extradata(), ff_adts_write_frame_header(), ff_copy_bits(), ff_mjpeg_encode_picture_trailer(), ff_mjpeg_find_marker(), ff_mpeg4_merge_partitions(), gif_image_write_image(), jpeg_put_comments(), jpeg_table_header(), main(), merge_context_after_encode(), mov_write_ac3_tag(), MPV_encode_picture(), output_frame_end(), pnm_decode_frame(), put_audio_specific_config(), put_frame(), put_line(), put_main_header(), put_pack_header(), put_swf_matrix(), put_swf_rect(), put_system_header(), ra144_encode_frame(), save_bits(), svq1_encode_frame(), svq1_encode_plane(), swf_write_header(), vorbis_encode_frame(), wmavoice_decode_packet(), write_frame_footer(), write_frame_header(), write_header(), write_slice_end(), write_streaminfo(), and xsub_encode().
static void init_put_bits | ( | PutBitContext * | s, | |
uint8_t * | buffer, | |||
int | buffer_size | |||
) | [inline, static] |
Initialize the PutBitContext s.
buffer | the buffer where to put bits | |
buffer_size | the size in bytes of buffer |
Definition at line 61 of file put_bits.h.
Referenced by aac_adtstoasc_filter(), aac_encode_frame(), alac_encode_frame(), dca_convert_bitstream(), decode_init(), dnxhd_encode_thread(), dv_decode_video_segment(), dv_encode_video_segment(), encode_bitstream(), encode_block(), encode_ext_header(), encode_frame(), encode_init(), encode_picture_lossless(), encode_picture_ls(), encode_thread(), ff_adts_decode_extradata(), ff_adts_write_frame_header(), ff_init_cabac_encoder(), ff_lzw_encode_init(), ff_mjpeg_find_marker(), ff_mpeg4_init_partitions(), gif_image_write_image(), main(), mov_write_ac3_tag(), MPA_encode_frame(), MPV_encode_picture(), output_frame(), pnm_decode_frame(), put_audio_specific_config(), put_frame(), put_line(), put_main_header(), put_pack_header(), put_swf_matrix(), put_swf_rect(), put_system_header(), ra144_encode_frame(), save_bits(), svq1_encode_frame(), svq1_encode_plane(), swf_write_header(), vorbis_encode_frame(), wmavoice_decode_packet(), write_frame(), write_header(), write_streaminfo(), and xsub_encode().
static void put_bits | ( | PutBitContext * | s, | |
int | n, | |||
unsigned int | value | |||
) | [inline, static] |
Write up to 31 bits into a bitstream.
Use put_bits32 to write 32 bits.
Definition at line 151 of file put_bits.h.
static void av_unused put_bits32 | ( | PutBitContext * | s, | |
uint32_t | value | |||
) | [static] |
Write exactly 32 bits into a bitstream.
Definition at line 277 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] |
Definition at line 85 of file put_bits.h.
Referenced by aac_encode_frame(), alac_encode_frame(), copy_bits(), dca_convert_bitstream(), dnxhd_encode_thread(), dv_decode_video_segment(), dv_encode_video_segment(), encode_bgr_bitstream(), encode_block(), encode_frame(), encode_init(), encode_mb(), encode_mb_hq(), encode_picture(), encode_picture_lossless(), encode_picture_ls(), encode_superframe(), encode_thread(), escape_FF(), ff_copy_bits(), ff_copy_pce_data(), ff_mjpeg_encode_stuffing(), ff_mpeg4_merge_partitions(), ff_mpeg4_stuffing(), get_bits_diff(), merge_context_after_encode(), mpeg1_encode_picture_header(), MPV_encode_picture(), output_frame_end(), put_bits_left(), put_bitstream_info(), put_frame(), put_main_header(), save_bits(), skip_put_bytes(), svq1_encode_frame(), svq1_encode_plane(), vorbis_encode_frame(), write_frame(), write_frame_footer(), write_frame_header(), writtenBytes(), xsub_encode(), and xsub_encode_rle().
static uint8_t* put_bits_ptr | ( | PutBitContext * | s | ) | [inline, static] |
Return the pointer to the byte where the bitstream writer will put the next bit.
Definition at line 294 of file put_bits.h.
Referenced by encode_picture_lossless(), encode_superframe(), encode_thread(), ff_copy_bits(), ff_h261_encode_picture_header(), ff_mpeg4_init_partitions(), gif_image_write_image(), h263_encode_picture_header(), jpeg_put_comments(), jpeg_table_header(), MPA_encode_frame(), MPV_encode_picture(), output_frame_end(), put_pack_header(), put_swf_matrix(), put_swf_rect(), put_system_header(), and swf_write_header().
static void put_sbits | ( | PutBitContext * | pb, | |
int | n, | |||
int32_t | value | |||
) | [inline, static] |
Definition at line 267 of file put_bits.h.
Referenced by alac_encode_frame(), asv1_put_level(), dv_encode_video_segment(), encode_block(), ff_flv2_encode_ac_esc(), ff_h261_encode_picture_header(), ff_mjpeg_encode_dc(), ff_msmpeg4_encode_block(), h261_encode_block(), h263_encode_block(), h263_encode_picture_header(), mpeg1_encode_block(), mpeg1_encode_mb_internal(), mpeg1_encode_sequence_header(), mpeg4_encode_block(), put_header(), put_line(), rv20_encode_picture_header(), set_ur_golomb_jpegls(), write_compressed_frame(), and write_subframes().
static void set_put_bits_buffer_size | ( | PutBitContext * | s, | |
int | size | |||
) | [inline, static] |
Change the end of the buffer.
size | the new size in bytes of the buffer where to put bits |
Definition at line 340 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] |
Skip 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 324 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] |
Skip the given number of bytes.
PutBitContext must be flushed & aligned to a byte boundary before calling this.
Definition at line 307 of file put_bits.h.
Referenced by escape_FF(), and ff_copy_bits().