FFmpeg
Loading...
Searching...
No Matches
bitstream_template.h File Reference

Go to the source code of this file.

Data Structures

struct  BSCTX
 

Macros

#define BS_SUFFIX_LOWER   _be
 
#define BS_SUFFIX_UPPER   BE
 
#define BS_JOIN(x, y, z)
 
#define BS_JOIN3(x, y, z)
 
#define BS_FUNC(x)
 
#define BSCTX   BS_JOIN3(Bitstream, Context, BS_SUFFIX_UPPER)
 

Functions

static int BS_FUNC priv_refill_64 (BSCTX *bc)
 
static int BS_FUNC priv_refill_32 (BSCTX *bc)
 
static int BS_FUNC init (BSCTX *bc, const uint8_t *buffer, unsigned int bit_size)
 Initialize BitstreamContext.
 
static int BS_FUNC init8 (BSCTX *bc, const uint8_t *buffer, unsigned int byte_size)
 Initialize BitstreamContext.
 
static int BS_FUNC tell (const BSCTX *bc)
 Return number of bits already read.
 
static int BS_FUNC size (const BSCTX *bc)
 Return buffer size in bits.
 
static int BS_FUNC bytesize (const BSCTX *bc, int round_up)
 Return buffer size in bytes.
 
static int BS_FUNC left (const BSCTX *bc)
 Return the number of the bits left in a buffer.
 
static uint64_t BS_FUNC priv_val_show (BSCTX *bc, unsigned int n)
 
static void BS_FUNC priv_skip_remaining (BSCTX *bc, unsigned int n)
 
static uint64_t BS_FUNC priv_val_get (BSCTX *bc, unsigned int n)
 
static unsigned int BS_FUNC read_bit (BSCTX *bc)
 Return one bit from the buffer.
 
static uint32_t BS_FUNC read_nz (BSCTX *bc, unsigned int n)
 Return n bits from the buffer, n has to be in the 1-32 range.
 
static uint32_t BS_FUNC read (BSCTX *bc, unsigned int n)
 Return n bits from the buffer, n has to be in the 0-32 range.
 
static uint64_t BS_FUNC read_63 (BSCTX *bc, unsigned int n)
 Return n bits from the buffer, n has to be in the 0-63 range.
 
static uint64_t BS_FUNC read_64 (BSCTX *bc, unsigned int n)
 Return n bits from the buffer, n has to be in the 0-64 range.
 
static int32_t BS_FUNC read_signed_nz (BSCTX *bc, unsigned int n)
 Return n bits from the buffer as a signed integer, n has to be in the 1-32 range.
 
static int32_t BS_FUNC read_signed (BSCTX *bc, unsigned int n)
 Return n bits from the buffer as a signed integer.
 
static uint32_t BS_FUNC peek_nz (BSCTX *bc, unsigned int n)
 Return n bits from the buffer but do not change the buffer state.
 
static uint32_t BS_FUNC peek (BSCTX *bc, unsigned int n)
 Return n bits from the buffer but do not change the buffer state.
 
static int BS_FUNC peek_signed_nz (BSCTX *bc, unsigned int n)
 Return n bits from the buffer as a signed integer, do not change the buffer state.
 
static int BS_FUNC peek_signed (BSCTX *bc, unsigned int n)
 Return n bits from the buffer as a signed integer, do not change the buffer state.
 
static void BS_FUNC skip (BSCTX *bc, unsigned int n)
 Skip n bits in the buffer.
 
static void BS_FUNC seek (BSCTX *bc, unsigned pos)
 Seek to the given bit position.
 
static const uint8_t *BS_FUNC align (BSCTX *bc)
 Skip bits to a byte boundary.
 
static int BS_FUNC read_xbits (BSCTX *bc, unsigned int n)
 Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB).
 
static int BS_FUNC decode012 (BSCTX *bc)
 Return decoded truncated unary code for the values 0, 1, 2.
 
static int BS_FUNC decode210 (BSCTX *bc)
 Return decoded truncated unary code for the values 2, 1, 0.
 
static int BS_FUNC apply_sign (BSCTX *bc, int val)
 
static int BS_FUNC skip_1stop_8data (BSCTX *s)
 
static int BS_FUNC priv_set_idx (BSCTX *bc, int code, int *n, int *nb_bits, const VLCElem *table)
 Return the LUT element for the given bitstream configuration.
 
static int BS_FUNC read_vlc (BSCTX *bc, const VLCElem *table, int bits, int max_depth)
 Parse a vlc code.
 
static int BS_FUNC read_vlc_multi (BSCTX *bc, uint8_t dst[8], const VLC_MULTI_ELEM *const Jtable, const VLCElem *const table, const int bits, const int max_depth, const int symbols_size)
 Parse a vlc / vlc_multi code.
 

Macro Definition Documentation

◆ BS_SUFFIX_LOWER

#define BS_SUFFIX_LOWER   _be

Definition at line 25 of file bitstream_template.h.

◆ BS_SUFFIX_UPPER

#define BS_SUFFIX_UPPER   BE

Definition at line 26 of file bitstream_template.h.

◆ BS_JOIN

#define BS_JOIN ( x,
y,
z )
Value:
x ## y ## z

Definition at line 29 of file bitstream_template.h.

◆ BS_JOIN3

#define BS_JOIN3 ( x,
y,
z )
Value:
BS_JOIN(x, y, z)
#define BS_JOIN(x, y, z)

Definition at line 30 of file bitstream_template.h.

◆ BS_FUNC

◆ BSCTX

Function Documentation

◆ priv_refill_64()

static int BS_FUNC priv_refill_64 ( BSCTX * bc)
inlinestatic
Returns
  • 0 on successful refill
  • a negative number when bitstream end is hit

Always succeeds when UNCHECKED_BITSTREAM_READER is enabled.

Definition at line 50 of file bitstream_template.h.

Referenced by init(), priv_refill_64(), read_63(), read_bit(), and skip().

◆ priv_refill_32()

static int BS_FUNC priv_refill_32 ( BSCTX * bc)
inlinestatic
Returns
  • 0 on successful refill
  • a negative number when bitstream end is hit

Always succeeds when UNCHECKED_BITSTREAM_READER is enabled.

Definition at line 75 of file bitstream_template.h.

Referenced by peek_nz(), priv_refill_32(), and read_nz().

◆ init()

static int BS_FUNC init ( BSCTX * bc,
const uint8_t * buffer,
unsigned int bit_size )
inlinestatic

Initialize BitstreamContext.

Parameters
bufferbitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes larger than the actual read bits because some optimized bitstream readers read 32 or 64 bits at once and could read over the end
bit_sizethe size of the buffer in bits
Returns
0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.

Definition at line 101 of file bitstream_template.h.

◆ init8()

static int BS_FUNC init8 ( BSCTX * bc,
const uint8_t * buffer,
unsigned int byte_size )
inlinestatic

Initialize BitstreamContext.

Parameters
bufferbitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes larger than the actual read bits because some optimized bitstream readers read 32 or 64 bits at once and could read over the end
byte_sizethe size of the buffer in bytes
Returns
0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow

Definition at line 135 of file bitstream_template.h.

Referenced by init8().

◆ tell()

static int BS_FUNC tell ( const BSCTX * bc)
inlinestatic

Return number of bits already read.

Definition at line 146 of file bitstream_template.h.

Referenced by align(), exif_decode_tag(), exif_write_ifd(), quant_band_template(), and tell().

◆ size()

static int BS_FUNC size ( const BSCTX * bc)
inlinestatic

Return buffer size in bits.

Definition at line 154 of file bitstream_template.h.

◆ bytesize()

static int BS_FUNC bytesize ( const BSCTX * bc,
int round_up )
inlinestatic

Return buffer size in bytes.

Definition at line 162 of file bitstream_template.h.

Referenced by bytesize().

◆ left()

static int BS_FUNC left ( const BSCTX * bc)
inlinestatic

Return the number of the bits left in a buffer.

Definition at line 170 of file bitstream_template.h.

Referenced by aac_decoder_config(), ac4_probe(), add_hfyu_left_pred_bgr32_c(), add_hfyu_median_pred_int16_c(), add_lag_median_prediction(), add_median_pred_c(), add_median_prediction(), adjust_pred16(), alac_stereo_decorrelation(), ana_convert(), ape_unpack_stereo(), assign_pair(), av_aes_ctr_crypt(), av_spherical_tile_bounds(), blend_line(), blend_line16(), blend_line_hv(), blend_line_hv16(), blt_ipol(), blt_mask(), blt_solid(), butter_filter_stereo_samples(), calc_draw_region(), cclm_get_luma_rec_pixels(), cclm_select_luma(), cdtoons_decode_frame(), celt_frame_setup_input(), channel_decorrelation(), check(), check_add_hfyu_left_pred_bgr32(), check_add_hfyu_median_pred_int16(), check_add_median_pred(), check_ipred(), check_pred_angular(), check_pred_dc(), check_pred_planar(), check_ref_filter_3tap(), check_ref_filter_strong(), check_sub_hfyu_median_pred_int16(), check_sub_median_pred(), checkasm_check_hevc_pred(), cmp_int(), cmpbytes(), codeblock(), compare16(), compare8(), convert_coeffs(), count_hq_slice(), curl_worker(), dc_127_16x16_c(), dc_127_32x32_c(), dc_127_4x4_c(), dc_127_8x8_c(), dc_128_16x16_c(), dc_128_32x32_c(), dc_128_4x4_c(), dc_128_8x8_c(), dc_129_16x16_c(), dc_129_32x32_c(), dc_129_4x4_c(), dc_129_8x8_c(), dc_16x16_c(), dc_32x32_c(), dc_4x4_c(), dc_8x8_c(), dc_left_16x16_c(), dc_left_32x32_c(), dc_left_4x4_c(), dc_left_8x8_c(), dc_top_16x16_c(), dc_top_32x32_c(), dc_top_4x4_c(), dc_top_8x8_c(), decode_channel(), decode_frame(), decode_frame(), decode_frame_lscr(), decode_interframe_v4(), decode_intra4x4_modes(), decode_mb_i(), decode_mode(), decode_q_branch(), decode_rle(), decode_rle16(), decode_rle_bpp2(), decode_rle_bpp4(), decode_slice(), decode_slice(), decode_splitmvs(), decode_str(), decode_subband(), decode_subband_internal(), decode_subframe(), decode_var_block_data(), decorr_mono(), def_diag_downleft(), def_diag_downright(), def_hor_down(), def_vert_left(), def_vert_right(), diag_downleft_4x4_c(), draw_region(), draw_region_rgb_packed(), dump_cropping(), dx2_decode_slice_410(), dx2_decode_slice_420(), dx2_decode_slice_444(), dx2_decode_slice_555(), dx2_decode_slice_565(), dx2_decode_slice_5x5(), dx2_decode_slice_rgb(), emulated_edge(), encode_frame(), encode_q_branch(), encode_q_branch2(), encode_subband(), ensure_bits(), exp_quant_coarse(), ff_add_hfyu_left_pred_bgr32_rvv(), ff_add_hfyu_left_pred_bgr32_sse2(), ff_add_hfyu_median_pred_int16_sse4(), ff_add_left_pred_unaligned_avx2(), ff_add_left_pred_unaligned_ssse3(), ff_add_median_pred_sse2(), ff_AMediaFormat_getRect(), ff_AMediaFormat_setRect(), ff_blend_mask(), ff_blend_rectangle(), ff_cavs_load_intra_pred_luma(), ff_dc_127_16x16_lsx(), ff_dc_127_16x16_msa(), ff_dc_127_32x32_lsx(), ff_dc_127_32x32_msa(), ff_dc_128_16x16_lsx(), ff_dc_128_16x16_msa(), ff_dc_128_32x32_lsx(), ff_dc_128_32x32_msa(), ff_dc_129_16x16_lsx(), ff_dc_129_16x16_msa(), ff_dc_129_32x32_lsx(), ff_dc_129_32x32_msa(), ff_dc_16x16_msa(), ff_dc_left_16x16_lsx(), ff_dc_left_16x16_msa(), ff_dc_left_32x32_lsx(), ff_dc_left_32x32_msa(), ff_dc_left_4x4_lsx(), ff_dc_left_4x4_msa(), ff_dc_left_8x8_lsx(), ff_dc_left_8x8_msa(), ff_dc_top_16x16_lsx(), ff_dc_top_16x16_msa(), ff_dc_top_32x32_lsx(), ff_dc_top_32x32_msa(), ff_dc_top_4x4_lsx(), ff_dc_top_4x4_msa(), ff_dc_top_8x8_lsx(), ff_dc_top_8x8_msa(), ff_flac_parse_picture(), ff_frame_to_dnn_classify(), ff_h263_resync(), ff_h264_check_intra4x4_pred_mode(), ff_h264_check_intra_pred_mode(), ff_hevc_deblocking_boundary_strengths(), ff_hevc_pred_angular_0(), ff_hevc_pred_angular_1(), ff_hevc_pred_angular_2(), ff_hevc_pred_angular_3(), ff_hevc_pred_angular_mode_10_8_neon(), ff_hevc_pred_angular_mode_26_8_neon(), ff_hevc_pred_dc_16x16_8_neon(), ff_hevc_pred_dc_32x32_8_neon(), ff_hevc_pred_dc_4x4_8_neon(), ff_hevc_pred_dc_8x8_8_neon(), ff_hevc_pred_planar_16x16_8_neon(), ff_hevc_pred_planar_32x32_8_neon(), ff_hevc_pred_planar_4x4_8_neon(), ff_hevc_pred_planar_8x8_8_neon(), ff_hevc_ref_filter_3tap_16x16_8_neon(), ff_hevc_ref_filter_3tap_32x32_8_neon(), ff_hevc_ref_filter_3tap_8x8_8_neon(), ff_hevc_ref_filter_strong_8_neon(), ff_intra_pred_8_16x16_msa(), ff_intra_pred_8_32x32_msa(), ff_ivi_decode_frame(), ff_iwht_iwht_4x4_add_msa(), ff_lag_rac_init(), ff_llvidenc_sub_median_pred_rvb(), ff_llvidenc_sub_median_pred_rvv(), ff_msmpeg4_decode_block(), ff_msmpeg4_decode_ext_header(), ff_rtp_send_raw_rfc4175(), ff_sub_hfyu_median_pred_int16_avx2(), ff_sub_hfyu_median_pred_int16_sse2(), ff_sub_median_pred_sse2(), ff_tm_16x16_msa(), ff_tm_32x32_msa(), ff_tm_4x4_msa(), ff_tm_8x8_msa(), ff_vbv_update(), ff_vc1_h_s_overlap_mmi(), ff_vc1_inv_trans_4x8_mmi(), ff_vert_16x16_lsx(), ff_vert_16x16_msa(), ff_vert_32x32_lsx(), ff_vert_32x32_msa(), ff_vvc_alf_ctb_cc_idc(), ff_vvc_alf_ctb_flag(), ff_vvc_non_inter_flag(), ff_vvc_pred_mode_flag(), fill_ltable(), filter_frame(), filter_frame(), filter_frame(), filter_slice(), flac_decoder_config(), frame_block_to_cell(), func_uninit(), get_block_bits(), get_centere(), get_final(), get_inc(), get_left_top(), get_mip_inc(), get_submv_prob(), getfilter_float(), gif_read_image(), gradient_predict(), h263_decode_gob_header(), h264_metadata_update_sps(), h265_metadata_deduce_crop(), h265_metadata_update_sps(), hor_16x16_c(), hor_32x32_c(), hor_4x4_c(), hor_8x8_c(), idct_row(), init_obmc_weight(), init_obmc_weight_row(), initFilter(), INTRA_DC_TL_16X16(), INTRA_DC_TL_16x16(), INTRA_DC_TL_32X32(), INTRA_DC_TL_32x32(), INTRA_DC_TL_4X4(), INTRA_DC_TL_4x4(), INTRA_DC_TL_8X8(), INTRA_DC_TL_8x8(), intra_pred(), intra_pred(), intra_pred_dc_128(), intra_pred_down_left(), intra_pred_down_right(), intra_pred_horiz(), intra_pred_lp(), intra_pred_lp_left(), intra_pred_lp_top(), intra_pred_plane(), intra_pred_vert(), left(), ljpeg_decode_rgb_scan(), ljpeg_encode_bgr(), magicyuv_median_pred16(), magy_decode_slice(), magy_decode_slice10(), main(), margins_borders16(), margins_borders8(), mediaformat_ndk_getRect(), mediaformat_ndk_setRect(), median_predict(), mkv_write_track_video(), mmf_read_packet(), mov_read_clap(), mov_read_default(), mov_read_trun(), mov_write_clap_tag(), mov_write_video_tag(), mpeg4_decode_dpcm_macroblock(), mpeg_decode_slice(), mpegts_probe(), mpegts_write_section(), old_codec1(), old_codec2(), old_codec20(), old_codec21(), old_codec23(), old_codec31(), old_codec37(), old_codec4(), old_codec45(), old_codec47(), old_codec48(), opus_decoder_config(), parse_strk(), parse_vtrk(), pred_angular(), pred_angular_h(), pred_angular_v(), pred_dc(), pred_dc(), pred_dc_neon(), pred_dc_val(), pred_h(), pred_intra_mode(), pred_mip(), pred_mv(), pred_non_zero_count(), pred_planar(), pred_planar(), predict_intra(), predictor_decode_stereo_3950(), prepare_intra_edge_params(), process_frame_obj(), put_obmc(), raw_read_packet(), raw_read_packet(), read_63(), read_packet(), read_window(), real_seek(), ref_filter(), ref_filter_3tap(), ref_filter_strong(), residual_ts_coding_subblock(), rle_decode(), rv10_decode_packet(), rv34_pred_4x4_block(), sao_copy_hor(), sao_filter_CTB(), sb_coded_flag_decode(), scale_vt_filter_frame(), set_frame(), sga_decode_frame(), sga_probe(), shift_stereo(), skip_1stop_8data(), sub_hfyu_median_pred_int16_c(), sub_left_prediction(), sub_median_pred_c(), sub_median_prediction(), svq3_decode_frame(), svq3_decode_mb(), tm2_null_res_block(), tm_16x16_c(), tm_32x32_c(), tm_4x4_c(), tm_8x8_c(), uavs3d_find_next_start_code(), vble_restore_plane(), vc1_h_s_overlap_c(), vert_16x16_c(), vert_32x32_c(), vert_4x4_c(), vert_8x8_c(), VP9_COPY_LOONGARCH_LSX_FUNC(), wavarc_read_packet(), xa_decode(), xcbgrab_reposition(), xma_decode_packet(), xwma_read_packet(), and yule_filter_stereo_samples().

◆ priv_val_show()

static uint64_t BS_FUNC priv_val_show ( BSCTX * bc,
unsigned int n )
inlinestatic

Definition at line 175 of file bitstream_template.h.

Referenced by peek_nz(), priv_val_get(), and priv_val_show().

◆ priv_skip_remaining()

static void BS_FUNC priv_skip_remaining ( BSCTX * bc,
unsigned int n )
inlinestatic

◆ priv_val_get()

static uint64_t BS_FUNC priv_val_get ( BSCTX * bc,
unsigned int n )
inlinestatic

Definition at line 196 of file bitstream_template.h.

Referenced by priv_val_get(), read_63(), read_bit(), and read_nz().

◆ read_bit()

static unsigned int BS_FUNC read_bit ( BSCTX * bc)
inlinestatic

Return one bit from the buffer.

Definition at line 211 of file bitstream_template.h.

Referenced by decode012(), decode210(), read_64(), read_bit(), and skip_1stop_8data().

◆ read_nz()

static uint32_t BS_FUNC read_nz ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer, n has to be in the 1-32 range.

May be faster than bits_read() when n is not a compile-time constant and is known to be non-zero;

Definition at line 224 of file bitstream_template.h.

Referenced by read(), read_nz(), and read_signed_nz().

◆ read()

◆ read_63()

static uint64_t BS_FUNC read_63 ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer, n has to be in the 0-63 range.

Definition at line 252 of file bitstream_template.h.

Referenced by read_63(), and read_64().

◆ read_64()

static uint64_t BS_FUNC read_64 ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer, n has to be in the 0-64 range.

Definition at line 286 of file bitstream_template.h.

Referenced by read_64().

◆ read_signed_nz()

static int32_t BS_FUNC read_signed_nz ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer as a signed integer, n has to be in the 1-32 range.

May be faster than bits_read_signed() when n is not a compile-time constant and is known to be non-zero;

Definition at line 306 of file bitstream_template.h.

Referenced by read_signed(), and read_signed_nz().

◆ read_signed()

static int32_t BS_FUNC read_signed ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer as a signed integer.

n has to be in the 0-32 range.

Definition at line 316 of file bitstream_template.h.

Referenced by apply_sign(), read_signed(), and read_signed().

◆ peek_nz()

static uint32_t BS_FUNC peek_nz ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer but do not change the buffer state.

n has to be in the 1-32 range. May

Definition at line 330 of file bitstream_template.h.

Referenced by peek(), peek_nz(), and peek_signed_nz().

◆ peek()

static uint32_t BS_FUNC peek ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer but do not change the buffer state.

n has to be in the 0-32 range.

Definition at line 344 of file bitstream_template.h.

Referenced by peek(), priv_set_idx(), read_vlc(), read_vlc_multi(), read_xbits(), and receive_for_stream().

◆ peek_signed_nz()

static int BS_FUNC peek_signed_nz ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer as a signed integer, do not change the buffer state.

n has to be in the 1-32 range. May be faster than bits_peek_signed() when n is not a compile-time constant and is known to be non-zero;

Definition at line 359 of file bitstream_template.h.

Referenced by peek_signed(), and peek_signed_nz().

◆ peek_signed()

static int BS_FUNC peek_signed ( BSCTX * bc,
unsigned int n )
inlinestatic

Return n bits from the buffer as a signed integer, do not change the buffer state.

n has to be in the 0-32 range.

Definition at line 370 of file bitstream_template.h.

Referenced by peek_signed().

◆ skip()

static void BS_FUNC skip ( BSCTX * bc,
unsigned int n )
inlinestatic

Skip n bits in the buffer.

Definition at line 383 of file bitstream_template.h.

Referenced by aax_read_packet(), ac3_decode_frame(), align(), append_flv_data(), asf_read_multiple_payload(), av_read_image_line2(), av_write_image_line2(), avui_decode_frame(), avui_encode_frame(), cbs_h264_discarded_nal_unit(), cbs_h265_discarded_nal_unit(), cdtoons_render_sprite(), checkasm_check_key(), clv_decode_frame(), conv_down(), convert_coeffs(), convert_frame(), convert_frame_partial(), cpia_decode_frame(), cri_decode_frame(), decode_555(), decode_block(), decode_dct(), decode_frame(), decode_frame(), decode_frame(), decode_header_trees(), decode_inter_block(), decode_inter_blocks(), decode_inter_plane(), decode_intra_block(), decode_intra_blocks(), decode_intra_plane(), decode_long_vertical_delta2(), decode_loudness_set(), decode_mad1(), decode_motion_vectors(), decode_mvdv(), decode_rle(), decode_scale_factors(), decode_tdlt(), decode_usac_extension(), decompress_5(), decompress_68(), discard_units(), dovi_configure_ext(), draw(), dshow_cycle_devices(), dtshd_read_header(), dwa_uncompress(), dwt_plane(), dxv_decompress_yo(), encode_slices(), end_ebml_master_crc32(), escape124_decode_frame(), escape130_decode_frame(), ff_configure_buffers_for_index(), ff_h264_decode_mb_cabac(), ff_hevc_hls_filter(), ff_htmlmarkup_to_ass(), ff_iamf_parse_obu_header(), ff_libwebp_get_frame(), ff_mjpeg_decode_frame_from_buf(), ff_rm_read_mdpr_codecdata(), ff_tx_decompose_length(), ff_vk_filter_init_context(), fic_decode_frame(), filter_channel(), filter_start(), find_frame_end(), finished_reading_packet(), flush(), flv_data_packet(), flv_read_packet(), forward(), frame_data_apply(), g722_decode_frame(), get_nb_samples(), gif_read_header(), gxf_packet(), handle_notify(), ipvideo_decode_format_10_opcodes(), is_animated_webp_packet(), load_enabled_qfs(), main(), min_cb_nz_tl_init(), mp_decode_layer3(), mpc7_decode_frame(), mpegps_read_packet(), mpegps_read_pes_header(), mpegts_push_data(), mss4_decode_dct(), mxf_read_packet(), nut_read_packet(), old_codec37(), old_codec47(), opus_packet(), output_chunk_list(), parse_ext_blocks(), pnm_parse(), qpeg_decode_inter(), qtrle_decode_1bpp(), r3d_read_packet(), read_code(), read_header(), read_kuki_chunk(), read_packet(), rm_read_index(), rm_sync(), rtmp_write(), rtp_asf_fix_header(), seek(), sga_read_header(), skip(), skip_1stop_8data(), swf_read_packet(), tm2_read_stream(), ulti_decode_frame(), vc1_decode_ac_coeff(), vc1_decode_i_block(), vc1_decode_i_block_adv(), vc1_decode_intra_block(), vc1_decode_p_block(), vc1_unescape_buffer_neon(), vc1_unescape_buffer_neon(), vorbis_packet(), vpk_read_packet(), and write_packet().

◆ seek()

static void BS_FUNC seek ( BSCTX * bc,
unsigned pos )
inlinestatic

Seek to the given bit position.

Definition at line 407 of file bitstream_template.h.

Referenced by avio_alloc_context(), ffio_init_context(), id3v2_parse(), main(), and seek().

◆ align()

◆ read_xbits()

static int BS_FUNC read_xbits ( BSCTX * bc,
unsigned int n )
inlinestatic

Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB).

If MSB not set it is negative.

Parameters
nlength in bits

Definition at line 432 of file bitstream_template.h.

Referenced by read_xbits().

◆ decode012()

◆ decode210()

static int BS_FUNC decode210 ( BSCTX * bc)
inlinestatic

Return decoded truncated unary code for the values 2, 1, 0.

Definition at line 455 of file bitstream_template.h.

Referenced by decode210(), decode_mb(), ff_vc1_parse_frame_header_adv(), and vc1_decode_ac_coeff().

◆ apply_sign()

static int BS_FUNC apply_sign ( BSCTX * bc,
int val )
inlinestatic

Definition at line 464 of file bitstream_template.h.

Referenced by apply_sign().

◆ skip_1stop_8data()

static int BS_FUNC skip_1stop_8data ( BSCTX * s)
inlinestatic

Definition at line 470 of file bitstream_template.h.

Referenced by skip_1stop_8data().

◆ priv_set_idx()

static int BS_FUNC priv_set_idx ( BSCTX * bc,
int code,
int * n,
int * nb_bits,
const VLCElem * table )
inlinestatic

Return the LUT element for the given bitstream configuration.

Definition at line 487 of file bitstream_template.h.

Referenced by priv_set_idx(), read_vlc(), and read_vlc_multi().

◆ read_vlc()

static int BS_FUNC read_vlc ( BSCTX * bc,
const VLCElem * table,
int bits,
int max_depth )
inlinestatic

Parse a vlc code.

Parameters
bitsis the number of bits which will be read at once, must be identical to nb_bits in vlc_init()
max_depthis the number of times bits bits must be read to completely read the longest vlc code = (max_vlc_length + bits - 1) / bits If the vlc code is invalid and max_depth=1, then no bits will be removed. If the vlc code is invalid and max_depth>1, then the number of bits removed is undefined.

Definition at line 510 of file bitstream_template.h.

Referenced by read_vlc().

◆ read_vlc_multi()

static int BS_FUNC read_vlc_multi ( BSCTX * bc,
uint8_t dst[8],
const VLC_MULTI_ELEM *const Jtable,
const VLCElem *const table,
const int bits,
const int max_depth,
const int symbols_size )
inlinestatic

Parse a vlc / vlc_multi code.

Parameters
bitsis the number of bits which will be read at once, must be identical to nb_bits in vlc_init()
max_depthis the number of times bits bits must be read to completely read the longest vlc code = (max_vlc_length + bits - 1) / bits
dstthe parsed symbol(s) will be stored here. Up to 8 bytes are written
Returns
number of symbols parsed If the vlc code is invalid and max_depth=1, then no bits will be removed. If the vlc code is invalid and max_depth>1, then the number of bits removed is undefined.

Definition at line 544 of file bitstream_template.h.

Referenced by read_vlc_multi().