FFmpeg  4.0
Data Structures | Macros | Functions
bytestream.h File Reference
#include <stdint.h>
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"

Go to the source code of this file.

Data Structures

struct  GetByteContext
 
struct  PutByteContext
 

Macros

#define DEF(type, name, bytes, read, write)
 
#define bytestream2_get_ne16   bytestream2_get_le16
 
#define bytestream2_get_ne24   bytestream2_get_le24
 
#define bytestream2_get_ne32   bytestream2_get_le32
 
#define bytestream2_get_ne64   bytestream2_get_le64
 
#define bytestream2_get_ne16u   bytestream2_get_le16u
 
#define bytestream2_get_ne24u   bytestream2_get_le24u
 
#define bytestream2_get_ne32u   bytestream2_get_le32u
 
#define bytestream2_get_ne64u   bytestream2_get_le64u
 
#define bytestream2_put_ne16   bytestream2_put_le16
 
#define bytestream2_put_ne24   bytestream2_put_le24
 
#define bytestream2_put_ne32   bytestream2_put_le32
 
#define bytestream2_put_ne64   bytestream2_put_le64
 
#define bytestream2_peek_ne16   bytestream2_peek_le16
 
#define bytestream2_peek_ne24   bytestream2_peek_le24
 
#define bytestream2_peek_ne32   bytestream2_peek_le32
 
#define bytestream2_peek_ne64   bytestream2_peek_le64
 

Functions

static av_always_inline void bytestream2_init (GetByteContext *g, const uint8_t *buf, int buf_size)
 
static av_always_inline void bytestream2_init_writer (PutByteContext *p, uint8_t *buf, int buf_size)
 
static av_always_inline unsigned int bytestream2_get_bytes_left (GetByteContext *g)
 
static av_always_inline unsigned int bytestream2_get_bytes_left_p (PutByteContext *p)
 
static av_always_inline void bytestream2_skip (GetByteContext *g, unsigned int size)
 
static av_always_inline void bytestream2_skipu (GetByteContext *g, unsigned int size)
 
static av_always_inline void bytestream2_skip_p (PutByteContext *p, unsigned int size)
 
static av_always_inline int bytestream2_tell (GetByteContext *g)
 
static av_always_inline int bytestream2_tell_p (PutByteContext *p)
 
static av_always_inline int bytestream2_size (GetByteContext *g)
 
static av_always_inline int bytestream2_size_p (PutByteContext *p)
 
static av_always_inline int bytestream2_seek (GetByteContext *g, int offset, int whence)
 
static av_always_inline int bytestream2_seek_p (PutByteContext *p, int offset, int whence)
 
static av_always_inline unsigned int bytestream2_get_buffer (GetByteContext *g, uint8_t *dst, unsigned int size)
 
static av_always_inline unsigned int bytestream2_get_bufferu (GetByteContext *g, uint8_t *dst, unsigned int size)
 
static av_always_inline unsigned int bytestream2_put_buffer (PutByteContext *p, const uint8_t *src, unsigned int size)
 
static av_always_inline unsigned int bytestream2_put_bufferu (PutByteContext *p, const uint8_t *src, unsigned int size)
 
static av_always_inline void bytestream2_set_buffer (PutByteContext *p, const uint8_t c, unsigned int size)
 
static av_always_inline void bytestream2_set_bufferu (PutByteContext *p, const uint8_t c, unsigned int size)
 
static av_always_inline unsigned int bytestream2_get_eof (PutByteContext *p)
 
static av_always_inline unsigned int bytestream2_copy_bufferu (PutByteContext *p, GetByteContext *g, unsigned int size)
 
static av_always_inline unsigned int bytestream2_copy_buffer (PutByteContext *p, GetByteContext *g, unsigned int size)
 
static av_always_inline unsigned int bytestream_get_buffer (const uint8_t **b, uint8_t *dst, unsigned int size)
 
static av_always_inline void bytestream_put_buffer (uint8_t **b, const uint8_t *src, unsigned int size)
 

Macro Definition Documentation

◆ DEF

#define DEF (   type,
  name,
  bytes,
  read,
  write 
)

Definition at line 42 of file bytestream.h.

◆ bytestream2_get_ne16

#define bytestream2_get_ne16   bytestream2_get_le16

Definition at line 115 of file bytestream.h.

Referenced by expand_rle_row16(), and rle_unpack().

◆ bytestream2_get_ne24

#define bytestream2_get_ne24   bytestream2_get_le24

Definition at line 116 of file bytestream.h.

◆ bytestream2_get_ne32

#define bytestream2_get_ne32   bytestream2_get_le32

Definition at line 117 of file bytestream.h.

Referenced by daala_header().

◆ bytestream2_get_ne64

#define bytestream2_get_ne64   bytestream2_get_le64

Definition at line 118 of file bytestream.h.

◆ bytestream2_get_ne16u

#define bytestream2_get_ne16u   bytestream2_get_le16u

Definition at line 119 of file bytestream.h.

Referenced by read_uncompressed_sgi().

◆ bytestream2_get_ne24u

#define bytestream2_get_ne24u   bytestream2_get_le24u

Definition at line 120 of file bytestream.h.

◆ bytestream2_get_ne32u

#define bytestream2_get_ne32u   bytestream2_get_le32u

Definition at line 121 of file bytestream.h.

◆ bytestream2_get_ne64u

#define bytestream2_get_ne64u   bytestream2_get_le64u

Definition at line 122 of file bytestream.h.

◆ bytestream2_put_ne16

#define bytestream2_put_ne16   bytestream2_put_le16

Definition at line 123 of file bytestream.h.

Referenced by ff_videotoolbox_uninit().

◆ bytestream2_put_ne24

#define bytestream2_put_ne24   bytestream2_put_le24

Definition at line 124 of file bytestream.h.

Referenced by ff_videotoolbox_uninit().

◆ bytestream2_put_ne32

#define bytestream2_put_ne32   bytestream2_put_le32

Definition at line 125 of file bytestream.h.

Referenced by ff_videotoolbox_uninit().

◆ bytestream2_put_ne64

#define bytestream2_put_ne64   bytestream2_put_le64

Definition at line 126 of file bytestream.h.

◆ bytestream2_peek_ne16

#define bytestream2_peek_ne16   bytestream2_peek_le16

Definition at line 127 of file bytestream.h.

◆ bytestream2_peek_ne24

#define bytestream2_peek_ne24   bytestream2_peek_le24

Definition at line 128 of file bytestream.h.

◆ bytestream2_peek_ne32

#define bytestream2_peek_ne32   bytestream2_peek_le32

Definition at line 129 of file bytestream.h.

◆ bytestream2_peek_ne64

#define bytestream2_peek_ne64   bytestream2_peek_le64

Definition at line 130 of file bytestream.h.

Function Documentation

◆ bytestream2_init()

static av_always_inline void bytestream2_init ( GetByteContext g,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 133 of file bytestream.h.

Referenced by aasc_decode_frame(), adpcm_decode_frame(), aic_decode_frame(), alac_set_info(), apng_probe(), avi_extract_stream_metadata(), avpriv_exif_decode_ifd(), bethsoftvid_decode_frame(), bfi_decode_frame(), bmp_decode_frame(), cbs_h2645_split_fragment(), cdg_decode_frame(), cfhd_decode(), chunky2chunky(), clv_decode_frame(), cook_decode_init(), daala_header(), dca_core_filter(), dds_decode(), decode_aiff_header(), decode_byte_vertical_delta(), decode_byterun2(), decode_delta_d(), decode_delta_e(), decode_delta_j(), decode_delta_l(), decode_extradata_ps_mp4(), decode_frame(), decode_frame_common(), decode_frame_headers(), decode_header(), decode_i2_frame(), decode_init(), decode_interframe_v4(), decode_interframe_v4a(), decode_long_vertical_delta(), decode_long_vertical_delta2(), decode_p_frame(), decode_short_horizontal_delta(), decode_short_vertical_delta(), decode_short_vertical_delta2(), decode_type1(), decode_type2(), decode_wave_header(), decompress_2(), decompress_5(), decompress_68(), decompress_chunks_thread(), dfa_decode_frame(), dpcm_decode_frame(), dxv_decode(), ff_amf_get_field_value(), ff_amf_tag_size(), ff_canopus_parse_info_tag(), ff_dca_lbr_parse(), ff_h2645_packet_split(), ff_hevc_decode_extradata(), ff_lzw_decode_init(), ffat_init_encoder(), find_tracked_method(), flic_decode_frame_15_16BPP(), flic_decode_frame_24BPP(), flic_decode_frame_8BPP(), g2m_decode_frame(), gdv_decode_frame(), generate_fake_vps(), get_anim_duration(), gif_decode_frame(), handle_notify(), hap_decode(), hap_parse_frame_header(), hapqa_extract(), hevc_extradata_to_annexb(), hevc_mp4toannexb_filter(), hnm_update_palette(), hq_hqa_decode_frame(), ipvideo_decode_format_06_opcodes(), ipvideo_decode_format_10_opcodes(), ipvideo_decode_frame(), jpeg2000_decode_frame(), jpeg2000_read_main_headers(), LLVMFuzzerTestOneInput(), load_buffer(), lz_unpack(), magy_decode_frame(), mimic_decode_frame(), mjpeg_decode_app(), mkv_parse_video_projection(), mm_decode_frame(), mm_decode_inter(), msrle_decode_frame(), mss2_decode_frame(), mss3_decode_frame(), mss4_decode_frame(), mvc_decode_frame(), ogm_header(), on2avc_decode_frame(), paf_video_decode(), parse_opus_ts_header(), pcm_bluray_decode_frame(), pcm_dvd_decode_samples(), pcx_decode_frame(), pix_decode_frame(), pixlet_decode_frame(), piz_uncompress(), qdm2_decode_init(), qdmc_decode_init(), qtrle_decode_frame(), read_connect(), read_number_result(), redspark_read_header(), rle_unpack(), roq_decode_frame(), rpza_decode_frame(), rscc_decode_frame(), rtmp_send_packet(), rtmp_write(), send_invoke_response(), smc_decode_frame(), tdsc_decode_frame(), tgq_decode_frame(), tiff_unpack_strip(), tm2_read_stream(), tscc2_decode_frame(), txd_decode_frame(), ulti_decode_frame(), unpack_intraframe(), vmd_decode(), vp8_lossy_decode_alpha(), vp9_superframe_split_filter(), vqa_decode_chunk(), vqa_decode_frame(), wavpack_decode_block(), webp_decode_frame(), xan_decode_frame(), xan_unpack(), xan_wc3_decode_frame(), and xwd_decode_frame().

◆ bytestream2_init_writer()

static av_always_inline void bytestream2_init_writer ( PutByteContext p,
uint8_t buf,
int  buf_size 
)
static

◆ bytestream2_get_bytes_left()

static av_always_inline unsigned int bytestream2_get_bytes_left ( GetByteContext g)
static

Definition at line 154 of file bytestream.h.

Referenced by adpcm_decode_frame(), amf_get_field_value2(), amf_tag_skip(), apng_probe(), bfi_decode_frame(), cbs_h2645_split_fragment(), cfhd_decode(), check_header_variable(), codec2subblock(), cook_decode_init(), dds_decode(), decode(), decode0(), decode_0(), decode_6(), decode_aiff_header(), decode_bdlt(), decode_byterun(), decode_byterun2(), decode_dds1(), decode_delta_d(), decode_delta_e(), decode_delta_j(), decode_delta_l(), decode_dsw1(), decode_extradata_ps_mp4(), decode_format80(), decode_frame(), decode_frame_common(), decode_header(), decode_hextile(), decode_init(), decode_long_vertical_delta2(), decode_mvc1(), decode_mvc2(), decode_p_block(), decode_plane(), decode_rgb8(), decode_rgbn(), decode_rle(), decode_rle16(), decode_rle_bpp2(), decode_rle_bpp4(), decode_short_horizontal_delta(), decode_short_vertical_delta2(), decode_tdlt(), decode_tsw1(), decode_type1(), decode_type2(), decode_wave_header(), decode_wdlt(), decompress_2(), decompress_5(), decompress_68(), dfa_decode_frame(), dxv_decode(), dxv_decompress_cgo(), dxv_decompress_dxt5(), dxv_decompress_raw(), expand_rle_row16(), expand_rle_row8(), extract_header(), ff_amf_tag_size(), ff_dca_lbr_parse(), ff_exif_decode_ifd(), ff_h2645_packet_split(), ff_hap_parse_section_header(), ff_hevc_decode_extradata(), ff_lzf_uncompress(), ff_lzw_decode_tail(), ff_snappy_peek_uncompressed_length(), ff_snappy_uncompress(), ff_tadd_bytes_metadata(), ff_tadd_doubles_metadata(), ff_tadd_long_metadata(), ff_tadd_rational_metadata(), ff_tadd_shorts_metadata(), ff_tadd_string_metadata(), ff_tdecode_header(), ffat_init_encoder(), fill_ltable(), flic_decode_frame_15_16BPP(), flic_decode_frame_24BPP(), flic_decode_frame_8BPP(), g2m_decode_frame(), g2m_load_cursor(), gdv_decode_frame(), generate_fake_vps(), get_anim_duration(), get_coc(), get_cod(), get_cox(), get_opcodes(), get_poc(), get_qcc(), get_qcx(), get_siz(), get_sot(), gif_parse_next_image(), gif_read_extension(), gif_read_header1(), gif_read_image(), handle_notify(), hap_decode(), hap_parse_decode_instructions(), hap_parse_frame_header(), hevc_mp4toannexb_filter(), hq_hqa_decode_frame(), huf_decode(), huf_uncompress(), huf_unpack_enc_table(), ipvideo_decode_block_opcode_0x7(), ipvideo_decode_block_opcode_0x8(), ipvideo_decode_block_opcode_0x9(), ipvideo_decode_block_opcode_0xA(), ipvideo_decode_block_opcode_0xD(), ipvideo_decode_format_06_opcodes(), ipvideo_decode_format_10_opcodes(), ipvideo_decode_format_11_opcodes(), jp2_find_codestream(), jpeg2000_decode_frame(), jpeg2000_decode_packet(), jpeg2000_read_main_headers(), kmvc_decode_inter_8x8(), kmvc_decode_intra_8x8(), lz_unpack(), mm_decode_inter(), mm_decode_intra(), msrle_decode_8_16_24_32(), msrle_decode_pal4(), mss3_decode_frame(), mss4_decode_frame(), ogm_header(), old_codec1(), old_codec37(), old_codec47(), on2avc_decode_frame(), op(), opcode_0xf7(), opcode_0xf8(), paf_video_decode(), pcx_decode_frame(), pcx_palette(), pcx_rle_decode(), pix_decode_frame(), pixlet_decode_frame(), png_decode_idat(), process_block(), qdm2_decode_init(), qdmc_decode_init(), qpeg_decode_inter(), qpeg_decode_intra(), read_connect(), read_frame_header(), read_high_coeffs(), read_rle_sgi(), read_uncompressed_sgi(), rle_decode(), rle_uncompress(), rle_unpack(), roqvideo_decode_frame(), rpza_decode_stream(), rscc_decode_frame(), set_palette(), smc_decode_stream(), targa_decode_rle(), tdsc_decode_frame(), tdsc_decode_tiles(), tgq_decode_mb(), tiff_decode_tag(), tiff_unpack_strip(), tscc2_decode_frame(), txd_decode_frame(), ulti_decode_frame(), vb_decode_framedata(), vmd_decode(), vqa_decode_chunk(), wavpack_decode_block(), webp_decode_frame(), xan_decode_chroma(), xan_decode_frame(), xan_unpack(), xan_unpack_luma(), xan_wc3_decode_frame(), and xwd_decode_frame().

◆ bytestream2_get_bytes_left_p()

static av_always_inline unsigned int bytestream2_get_bytes_left_p ( PutByteContext p)
static

◆ bytestream2_skip()

static av_always_inline void bytestream2_skip ( GetByteContext g,
unsigned int  size 
)
static

Definition at line 164 of file bytestream.h.

Referenced by adpcm_decode_frame(), amf_get_field_value2(), amf_tag_skip(), apng_probe(), avi_extract_stream_metadata(), bfi_decode_frame(), cbs_h2645_split_fragment(), cdg_decode_frame(), clv_decode_frame(), daala_header(), dca_core_filter(), dds_decode(), decode_0(), decode_aiff_header(), decode_byterun(), decode_byterun2(), decode_delta_j(), decode_extradata_ps_mp4(), decode_fctl_chunk(), decode_frame(), decode_frame_common(), decode_frame_headers(), decode_header(), decode_iccp_chunk(), decode_idat_chunk(), decode_ihdr_chunk(), decode_interframe_v4(), decode_interframe_v4a(), decode_long_vertical_delta(), decode_mvc2(), decode_phys_chunk(), decode_plane(), decode_plte_chunk(), decode_rle(), decode_rle16(), decode_trns_chunk(), decode_type1(), decode_type2(), decode_wave_header(), decompress_i(), decompress_p(), dfa_decode_frame(), dxv_decode(), dxv_decompress_cocg(), dxv_decompress_opcodes(), dxv_decompress_yo(), extract_header(), ff_canopus_parse_info_tag(), ff_dca_lbr_parse(), ff_h2645_packet_split(), ff_hevc_decode_extradata(), ff_lzw_decode_tail(), ffat_init_encoder(), flic_decode_frame_15_16BPP(), flic_decode_frame_24BPP(), flic_decode_frame_8BPP(), g2m_decode_frame(), g2m_load_cursor(), generate_fake_vps(), get_anim_duration(), get_nb_samples(), get_opcodes(), handle_notify(), hevc_extradata_to_annexb(), hq_hqa_decode_frame(), hqa_decode_frame(), huf_uncompress(), huf_unpack_enc_table(), ipvideo_decode_format_10_opcodes(), ipvideo_decode_format_11_opcodes(), jp2_find_codestream(), jpeg2000_decode_frame(), jpeg2000_decode_packet(), jpeg2000_decode_packets(), jpeg2000_flush(), jpeg2000_read_main_headers(), magy_decode_frame(), mimic_decode_frame(), mkv_parse_video_projection(), mm_decode_pal(), msrle_decode_8_16_24_32(), msrle_decode_pal4(), mss3_decode_frame(), mss4_decode_frame(), ogm_header(), old_codec37(), old_codec47(), on2avc_decode_frame(), paf_video_decode(), parse_opus_ts_header(), parse_palette(), parse_pixel_format(), pcm_bluray_decode_frame(), pix_decode_frame(), pix_decode_header(), pixlet_decode_frame(), png_decode_idat(), process_frame_obj(), qdm2_decode_init(), qtrle_decode_2n4bpp(), qtrle_decode_frame(), read_frame_header(), read_highpass(), read_uncompressed_sgi(), rscc_decode_frame(), smc_decode_stream(), tdsc_decode_frame(), tdsc_decode_tiles(), tdsc_load_cursor(), tdsc_parse_dtsm(), tdsc_parse_tdsf(), tgq_decode_frame(), tgq_decode_mb(), tiff_decode_tag(), tm2_read_stream(), tscc2_decode_frame(), txd_decode_frame(), vmd_decode(), vqa_decode_chunk(), wavpack_decode_block(), webp_decode_frame(), xan_decode_chroma(), xan_decode_frame(), and xan_unpack_luma().

◆ bytestream2_skipu()

static av_always_inline void bytestream2_skipu ( GetByteContext g,
unsigned int  size 
)
static

◆ bytestream2_skip_p()

static av_always_inline void bytestream2_skip_p ( PutByteContext p,
unsigned int  size 
)
static

◆ bytestream2_tell()

static av_always_inline int bytestream2_tell ( GetByteContext g)
static

◆ bytestream2_tell_p()

static av_always_inline int bytestream2_tell_p ( PutByteContext p)
static

◆ bytestream2_size()

static av_always_inline int bytestream2_size ( GetByteContext g)
static

Definition at line 198 of file bytestream.h.

Referenced by smc_decode_stream(), and xan_decode_frame_type0().

◆ bytestream2_size_p()

static av_always_inline int bytestream2_size_p ( PutByteContext p)
static

Definition at line 203 of file bytestream.h.

Referenced by ff_videotoolbox_uninit().

◆ bytestream2_seek()

static av_always_inline int bytestream2_seek ( GetByteContext g,
int  offset,
int  whence 
)
static

◆ bytestream2_seek_p()

static av_always_inline int bytestream2_seek_p ( PutByteContext p,
int  offset,
int  whence 
)
static

◆ bytestream2_get_buffer()

static av_always_inline unsigned int bytestream2_get_buffer ( GetByteContext g,
uint8_t dst,
unsigned int  size 
)
static

◆ bytestream2_get_bufferu()

static av_always_inline unsigned int bytestream2_get_bufferu ( GetByteContext g,
uint8_t dst,
unsigned int  size 
)
static

◆ bytestream2_put_buffer()

static av_always_inline unsigned int bytestream2_put_buffer ( PutByteContext p,
const uint8_t src,
unsigned int  size 
)
static

◆ bytestream2_put_bufferu()

static av_always_inline unsigned int bytestream2_put_bufferu ( PutByteContext p,
const uint8_t src,
unsigned int  size 
)
static

Definition at line 297 of file bytestream.h.

◆ bytestream2_set_buffer()

static av_always_inline void bytestream2_set_buffer ( PutByteContext p,
const uint8_t  c,
unsigned int  size 
)
static

Definition at line 306 of file bytestream.h.

◆ bytestream2_set_bufferu()

static av_always_inline void bytestream2_set_bufferu ( PutByteContext p,
const uint8_t  c,
unsigned int  size 
)
static

Definition at line 320 of file bytestream.h.

◆ bytestream2_get_eof()

static av_always_inline unsigned int bytestream2_get_eof ( PutByteContext p)
static

Definition at line 328 of file bytestream.h.

Referenced by tiff_unpack_strip(), and wavpack_encode_block().

◆ bytestream2_copy_bufferu()

static av_always_inline unsigned int bytestream2_copy_bufferu ( PutByteContext p,
GetByteContext g,
unsigned int  size 
)
static

Definition at line 333 of file bytestream.h.

Referenced by bytestream2_copy_buffer().

◆ bytestream2_copy_buffer()

static av_always_inline unsigned int bytestream2_copy_buffer ( PutByteContext p,
GetByteContext g,
unsigned int  size 
)
static

Definition at line 343 of file bytestream.h.

◆ bytestream_get_buffer()

static av_always_inline unsigned int bytestream_get_buffer ( const uint8_t **  b,
uint8_t dst,
unsigned int  size 
)
static

Definition at line 359 of file bytestream.h.

Referenced by flac_read_header(), pcm_decode_frame(), and rtmp_write().

◆ bytestream_put_buffer()

static av_always_inline void bytestream_put_buffer ( uint8_t **  b,
const uint8_t src,
unsigned int  size 
)
static