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

common internal and external API header More...

#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "attributes.h"
#include "error.h"
#include "macros.h"
#include "version.h"
#include "config.h"
#include "intmath.h"
#include "internal.h"

Go to the source code of this file.

Macros

#define RSHIFT(a, b)
 
#define ROUNDED_DIV(a, b)
 
#define AV_CEIL_RSHIFT(a, b)
 
#define FF_CEIL_RSHIFT   AV_CEIL_RSHIFT
 
#define FFUDIV(a, b)
 
#define FFUMOD(a, b)
 
#define FFABS(a)
 Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable as absolute values of their type.
 
#define FFSIGN(a)
 
#define FFNABS(a)
 Negative Absolute value.
 
#define FFABSU(a)
 Unsigned Absolute value.
 
#define FFABS64U(a)
 
#define av_ceil_log2   av_ceil_log2_c
 
#define av_clip   av_clip_c
 
#define av_clip64   av_clip64_c
 
#define av_clip_uint8   av_clip_uint8_c
 
#define av_clip_int8   av_clip_int8_c
 
#define av_clip_uint16   av_clip_uint16_c
 
#define av_clip_int16   av_clip_int16_c
 
#define av_clipl_int32   av_clipl_int32_c
 
#define av_clip_intp2   av_clip_intp2_c
 
#define av_clip_uintp2   av_clip_uintp2_c
 
#define av_sat_add32   av_sat_add32_c
 
#define av_sat_dadd32   av_sat_dadd32_c
 
#define av_sat_sub32   av_sat_sub32_c
 
#define av_sat_dsub32   av_sat_dsub32_c
 
#define av_sat_add64   av_sat_add64_c
 
#define av_sat_sub64   av_sat_sub64_c
 
#define av_clipf   av_clipf_c
 
#define av_clipd   av_clipd_c
 
#define av_zero_extend   av_zero_extend_c
 
#define av_popcount   av_popcount_c
 
#define av_popcount64   av_popcount64_c
 
#define GET_UTF8(val, GET_BYTE, ERROR)
 Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
 
#define GET_UTF16(val, GET_16BIT, ERROR)
 Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
 
#define PUT_UTF8(val, tmp, PUT_BYTE)
 Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
 
#define PUT_UTF16(val, tmp, PUT_16BIT)
 Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
 

Functions

static av_always_inline av_const int av_clip_c (int a, int amin, int amax)
 Clip a signed integer value into the amin-amax range.
 
static av_always_inline av_const int64_t av_clip64_c (int64_t a, int64_t amin, int64_t amax)
 Clip a signed 64bit integer value into the amin-amax range.
 
static av_always_inline av_const uint8_t av_clip_uint8_c (int a)
 Clip a signed integer value into the 0-255 range.
 
static av_always_inline av_const int8_t av_clip_int8_c (int a)
 Clip a signed integer value into the -128,127 range.
 
static av_always_inline av_const uint16_t av_clip_uint16_c (int a)
 Clip a signed integer value into the 0-65535 range.
 
static av_always_inline av_const int16_t av_clip_int16_c (int a)
 Clip a signed integer value into the -32768,32767 range.
 
static av_always_inline av_const int32_t av_clipl_int32_c (int64_t a)
 Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
 
static av_always_inline av_const int av_clip_intp2_c (int a, int p)
 Clip a signed integer into the -(2^p),(2^p-1) range.
 
static av_always_inline av_const unsigned av_clip_uintp2_c (int a, int p)
 Clip a signed integer to an unsigned power of two range.
 
static av_always_inline av_const unsigned av_zero_extend_c (unsigned a, unsigned p)
 Clear high bits from an unsigned integer starting with specific bit position.
 
static av_always_inline int av_sat_add32_c (int a, int b)
 Add two signed 32-bit values with saturation.
 
static av_always_inline int av_sat_dadd32_c (int a, int b)
 Add a doubled value to another value with saturation at both stages.
 
static av_always_inline int av_sat_sub32_c (int a, int b)
 Subtract two signed 32-bit values with saturation.
 
static av_always_inline int av_sat_dsub32_c (int a, int b)
 Subtract a doubled value from another value with saturation at both stages.
 
static av_always_inline int64_t av_sat_add64_c (int64_t a, int64_t b)
 Add two signed 64-bit values with saturation.
 
static av_always_inline int64_t av_sat_sub64_c (int64_t a, int64_t b)
 Subtract two signed 64-bit values with saturation.
 
static av_always_inline av_const float av_clipf_c (float a, float amin, float amax)
 Clip a float value into the amin-amax range.
 
static av_always_inline av_const double av_clipd_c (double a, double amin, double amax)
 Clip a double value into the amin-amax range.
 
static av_always_inline av_const int av_ceil_log2_c (int x)
 Compute ceil(log2(x)).
 
static av_always_inline av_const int av_popcount_c (uint32_t x)
 Count number of bits set to one in x.
 
static av_always_inline av_const int av_popcount64_c (uint64_t x)
 Count number of bits set to one in x.
 
static av_always_inline av_const int av_parity_c (uint32_t v)
 

Detailed Description

common internal and external API header

Definition in file common.h.

Macro Definition Documentation

◆ RSHIFT

#define RSHIFT ( a,
b )
Value:
((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
int a
#define b
Definition input.c:43

Definition at line 56 of file common.h.

Referenced by checkasm_check_sw_ops(), dequantization_int_97(), get_amv(), palette_subblock_data(), unpack_vectors(), and vp56_decode_4mv().

◆ ROUNDED_DIV

◆ AV_CEIL_RSHIFT

#define AV_CEIL_RSHIFT ( a,
b )
Value:
(!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \
: ((a) + (1<<(b)) - 1) >> (b))
#define av_builtin_constant_p
Definition attributes.h:193

Definition at line 60 of file common.h.

Referenced by alloc_picture(), apply_film_grain(), apply_unsharp(), av_image_copy_to_buffer(), av_image_fill_color(), av_image_fill_plane_sizes(), blend_frame(), blockdetect_filter_frame(), blur(), blurdetect_filter_frame(), bwdif_vulkan_config_output(), calc_combed_score(), calc_diffs(), calculate_blur(), cfhd_decode(), cfhd_encode_init(), check_yuv2packed1(), check_yuv2packed2(), check_yuv2packedX(), chr_convert(), chr_h_scale(), chr_planar_vscale(), clear_slice16(), clear_slice8(), color_frame(), color_frame(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input0(), config_input1(), config_input_main(), config_input_ref(), config_input_ref(), config_input_ref(), config_input_ref(), config_input_ref(), config_input_ref(), config_input_structure(), config_inputx(), config_inputy(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_output(), config_props(), config_props(), config_props(), config_props(), config_props(), config_props(), config_props(), config_props(), config_props(), config_props_output(), copy_picture_field(), copy_uv_planes(), cover_rect(), cuda_bilateral_process_internal(), cuda_get_buffer(), cuda_pad_pad(), cuda_tex_map_frame(), cuda_transfer_data(), cudachromakey_process_internal(), cudascale_setup_filters(), cudatranspose_rotate(), decode_remap(), decode_slice(), do_denoise(), do_vflip(), dx2_decode_slice_410(), dx2_decode_slice_420(), dxtory_decode_v1_410(), dxtory_decode_v1_420(), dxv_encode(), encode_frame(), encode_frames(), encode_slice(), ff_aom_apply_film_grain(), ff_copy_rectangle2(), ff_ffv1_encode_buffer_size(), ff_ffv1_encode_determine_slices(), ff_fill_rectangle(), ff_frame_to_dnn_classify(), ff_get_buffer(), ff_h263_decode_frame(), ff_h274_apply_film_grain(), ff_libwebp_get_frame(), ff_mjpeg_decode_frame_from_buf(), ff_mjpeg_decode_sof(), ff_rtp_send_jpeg(), ff_set_dimensions(), ff_snow_alloc_blocks(), ff_snow_common_init_after_header(), ff_sws_alphablendaway(), ff_sws_init_single_context(), ff_swscale(), fill16(), fill8(), filter(), filter(), filter(), filter(), filter(), filter(), filter_1phase(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_slice(), filter_slice_chroma(), filter_slice_chroma16(), generate_missing_ref(), geq_filter_frame(), get_height(), get_plane_wh(), get_raw_size(), get_video_buffer(), get_width(), getpix(), getpix_integrate(), handle_partial_mb(), horizontal_frame_pack(), image_copy(), image_get_linesize(), inter_buf_init(), interpolate(), is_frame_different(), ispmf_tl_init(), lead_decode_frame(), libxeve_init(), LLVMFuzzerTestOneInput(), load_input_picture(), lowpass(), lowpass16(), lut2_config_output(), magy_decode_slice(), magy_decode_slice10(), magy_encode_frame(), magy_encode_init(), mimic_decode_frame(), mjpeg_decode_scan(), msm_tl_init(), nlmeans_opencl_filter_frame(), nlmeans_vulkan_filter_frame(), op_pass_setup(), output_single_frame(), param_init(), planarCopyWrapper(), pps(), pps_width_height(), prepare_uv_scale(), qsv_fill_border(), qsvenc_fill_padding_area(), rawvideo_read_packet(), read_in_data(), read_packet_vs(), request_frame(), rgb2yuv(), rgb2yuv_fsb(), scalecuda_resize(), scroll(), set_dimensions(), solve_range_convert(), sps(), test_format(), txd_decode_frame(), upload_texture(), uyvytoyuv420_c(), uyvytoyuv422_c(), v4l2_buffer_swframe_to_buf(), video_frame_cksum(), vk_prores_end_frame(), vvcc_parse_sps(), write_packet(), X264_init(), yuv2rgb(), yuv2yuv(), yuv4_write_packet(), yuyvtoyuv420_c(), and yuyvtoyuv422_c().

◆ FF_CEIL_RSHIFT

#define FF_CEIL_RSHIFT   AV_CEIL_RSHIFT

Definition at line 63 of file common.h.

Referenced by ph_vb_pos(), and v360_vulkan_filter_frame().

◆ FFUDIV

#define FFUDIV ( a,
b )
Value:
(((a)>0 ?(a):(a)-(b)+1) / (b))

Definition at line 65 of file common.h.

Referenced by ff_set_mpeg4_time(), mpeg4_encode_gop_header(), and mpeg4_encode_picture_header().

◆ FFUMOD

#define FFUMOD ( a,
b )
Value:
((a)-(b)*FFUDIV(a,b))
#define FFUDIV(a, b)
Definition common.h:65

Definition at line 66 of file common.h.

Referenced by ff_hevc_set_qPy(), mpeg4_encode_gop_header(), mpeg4_encode_picture_header(), and set_qp_y().

◆ FFABS

#define FFABS ( a)
Value:
((a) >= 0 ? (a) : (-(a)))

Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable as absolute values of their type.

This is the same as with *abs()

See also
FFNABS()

Definition at line 74 of file common.h.

Referenced by acb_search(), alf_classify(), alloc_scratch_buffers(), apply_channel_coupling(), apply_tilt_comp(), aptx_quantize_difference(), asf_read_stream_properties(), autocorr_calc(), av_normalize_sf(), av_reduce(), avi_read_header(), await_reference_row(), boundary_strength(), boundary_strength(), bswap_16bpc(), bswap_32bpc(), build_abs_diff_mask(), calc_lsq_max_fit_error(), calc_precision(), calculate_mask_curve(), calculate_scales(), cdg_scroll(), celt_icwrsi(), celt_quant_final(), celt_search_for_tf(), cfhd_encode_frame(), cfhd_encode_init(), CHECK(), check_draw_edges(), check_mv(), check_rgb24toyv12(), choose_rct_params(), choose_rct_params_bayer(), chroma(), chroma16(), cluster_mvs(), codebook_sanity_check_for_rate_quarter(), comp_harmonic_coeff(), config_output(), config_video_output(), convolution_x(), count_hq_slice(), D(), dct_error(), dct_max8x8_c(), dct_quantize_refine(), dct_quantize_trellis_c(), dct_single_coeff_elimination(), deband_16_c(), deband_16_coupling_c(), deband_8_c(), deband_8_coupling_c(), decode_block(), decode_block(), decode_bmv_frame(), decode_cblk(), decode_dct(), decode_filter(), decode_fixed_vector(), decode_frame(), decode_frame(), decode_frame(), decode_frame(), decode_frame_header(), decode_header(), decode_pic(), decode_q_branch(), decode_tones_amplitude(), derive_bdof_vx_vy(), derive_mmvd(), dirac_decode_data_unit(), dirac_decode_picture_header(), do_backgroundkey16_slice(), do_backgroundkey_slice(), do_plc(), dpcm_predict(), draw_aaline(), draw_cursor(), draw_line(), draw_line(), draw_line(), draw_line(), draw_line(), draw_rline(), draw_scope(), draw_sono(), draw_text(), dss_sp_get_normalize_bits(), dss_sp_vector_sum(), dts_probe(), dv_set_class_number_hd(), dv_set_class_number_sd(), emulated_edge_mc(), emulated_edge_mc(), encode_acs(), encode_acs(), encode_block(), encode_float32_remap(), encode_float32_remap_segment(), encode_header(), encode_picture_ls(), encode_q_branch(), encode_q_branch2(), encode_subband(), encode_subband_c0run(), estimate_acs(), estimate_coeff(), estimate_dcs(), estimate_stereo_mode(), estimate_stereo_mode(), estimate_timings_from_pts(), feed(), ff_configure_buffers_for_index(), ff_dcaadpcm_subband_analysis(), ff_g723_1_scale_vector(), ff_h264_direct_ref_list_init(), ff_hls_write_file_entry(), ff_idet_filter_line_c(), ff_idet_filter_line_c_16bit(), ff_jpegls_update_state_regular(), ff_me_cmp_sad(), ff_me_init(), ff_me_search_ntss(), ff_mpeg1_init_uni_ac_vlc(), ff_mpv_framesize_alloc(), ff_nelly_get_sample_bits(), ff_opus_rc_enc_laplace(), ff_scene_sad16_c(), ff_scene_sad_c(), ff_sws_op_list_optimize(), ff_vc1_pred_b_mv(), ff_vc1_pred_dc(), ff_vc1_pred_mv(), ff_vvc_store_gpm_mvf(), ff_vvc_wide_angle_mode_mapping(), fill_l1distlut(), fill_sierpinski(), fill_with_noise(), filter16_kirsch(), filter_chroma_edge(), filter_dbl(), filter_flt(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_kirsch(), filter_luma_edge(), flat(), flat16(), flv_read_packet(), gain_dequantization(), gen_sub_ass(), generate_noise(), generate_spread_table(), generate_window_func(), get_barrel_map(), get_barrel_split_map(), get_block_bits(), get_cb(), get_cbrt_h(), get_cbrt_h2(), get_cubemap_face_map(), get_diff_limited_q(), get_fcb_param(), get_lin_h2(), get_log_h(), get_log_h2(), get_needed_flags(), get_qminmax(), get_rrp(), get_sad_ob(), get_sae(), get_sbad(), get_sbad_ob(), get_scale_factor(), get_shift(), get_sqrt_h(), get_sqrt_h2(), get_tilt_comp(), gif_read_image(), guess_mv(), gxf_seek(), h261_encode_block(), h263_h_loop_filter_c(), h263_v_loop_filter_c(), h264_filter(), h264_loop_filter_chroma(), h264_loop_filter_chroma_intra(), h264_loop_filter_luma(), h264_loop_filter_luma_intra(), h_block_filter(), hadamard8_intra8x8_c(), hadamard_func(), hard_thresholding(), headroom(), hev(), hev(), image_copy_plane(), implicit_weight_table(), init_uni_ac_vlc(), initFilter(), interpol(), intra_pred(), inv_predict_11(), is_fallback_mode(), levinson_durbin(), limit_clip_spectrum(), limitdiff16(), limitdiff8(), log_add(), long_term_filter(), loop_filter(), lpc2lsp(), lpc_encode_choose_datapath(), ls_decode_line(), ls_encode_line(), ls_encode_regular(), ls_get_code_runterm(), main(), main(), make_glyphs(), max_abs_value_w16(), max_component_diff(), max_nbits(), mode05(), mode06(), mode07(), mode08(), mode10(), mode1314(), mode1516(), mode18(), mp3_sync(), mp3_update_xing(), mp3_write_xing(), mpc8_decode_frame(), mpeg4_decode_block(), mpeg4_decode_sprite_trajectory(), mpeg4_encode_mb(), msrle_decode_8_16_24_32(), mss4_decode_dct(), mvinfo_is_deblock_cand(), nb_decode(), nearest_alive(), noise(), nsse16_c(), nsse8_c(), nsse8_ssse3(), number_sbits(), packedCopyWrapper(), paf_video_decode(), parse_gradient(), parse_weights(), pitch_search(), pnm_decode_frame(), pred_spatial_direct_motion(), preservel(), print_stats(), process_command(), put_alpha_diff(), put_alpha_diff(), put_s(), put_symbol(), put_symbol_inline(), qian_thresholding(), read_highpass(), rectangle_from_corners(), remove_doubling(), render_line(), reverse_dc_prediction(), rtcp_update_jitter(), rv40_loop_filter_strength(), rv40_strong_loop_filter(), rv40_weak_loop_filter(), sab_diamond_search(), safe_bytes_pad(), sbc_calc_scalefactors(), sbc_calc_scalefactors_j(), scale_internal(), scaleforopp_x(), scaleforopp_y(), scaleforsame_x(), scaleforsame_y(), seq_unpack_rle_block(), set_metadata(), silk_is_lpc_stable(), silk_lsf2lpc(), skip_check(), sobel(), soft_thresholding(), speedhq_init_static_data(), subband_scale(), sum_abs_dctelem_c(), swap_channel_layouts_on_filter(), swri_rematrix_init(), sws_getShiftedVec(), test_apv_entropy_decode_block(), test_dwt(), test_dwtf(), threshold16_abs(), threshold8_abs(), thresholding(), tiff_unpack_strip(), ts_discontinuity_detect(), ts_str(), update_qscale(), update_stat(), update_stats(), update_vlc_state(), v_block_filter(), vc1_decode_b_mb_intfi(), vc1_decode_b_mb_intfr(), vc1_decode_i_block_adv(), vc1_decode_i_blocks_adv(), vc1_decode_intra_block(), vc1_decode_p_block(), vc1_decode_p_mb_intfi(), vc1_decode_p_mb_intfr(), vc1_filter_line(), vc1_filter_line(), vectorscope16(), vectorscope8(), vorbis_floor1_decode(), vp3_decode_frame(), vp4_get_mv(), vp6_filter(), vp7_simple_limit(), vp8_normal_limit(), vp8_simple_limit(), vp8_simple_limit(), vvc_sad(), w_c(), wmv2_pred_motion(), wv_unpack_stereo(), x8_loop_filter(), and xan_wc3_copy_pixel_run().

◆ FFSIGN

◆ FFNABS

#define FFNABS ( a)
Value:
((a) <= 0 ? (a) : (-(a)))

Negative Absolute value.

this works for all integers of all types. As with many macros, this evaluates its argument twice, it thus must not have a sideeffect, that is FFNABS(x++) has undefined behavior.

Definition at line 83 of file common.h.

Referenced by predictor_decode_stereo_3950().

◆ FFABSU

#define FFABSU ( a)
Value:
((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))

Unsigned Absolute value.

This takes the absolute value of a signed int and returns it as a unsigned. This also works with INT_MIN which would otherwise not be representable As with many macros, this evaluates its argument twice.

Definition at line 91 of file common.h.

Referenced by do_apply_filter(), and read_diff_float_data().

◆ FFABS64U

#define FFABS64U ( a)
Value:
((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a))

Definition at line 92 of file common.h.

Referenced by av_compare_ts(), lrc_write_packet(), and print_report().

◆ av_ceil_log2

◆ av_clip

#define av_clip   av_clip_c

Definition at line 100 of file common.h.

Referenced by aac_encode_init(), activate(), adapt_prob(), adjust_frame_pts_to_encoder_tb(), adpcm_agm_expand_nibble(), adpcm_circus_expand_nibble(), adpcm_compress_trellis(), adpcm_ct_expand_nibble(), adpcm_flush(), adpcm_ima_alp_compress_sample(), adpcm_ima_alp_expand_nibble(), adpcm_ima_compress_sample(), adpcm_ima_cunning_expand_nibble(), adpcm_ima_escape_expand_nibble(), adpcm_ima_expand_nibble(), adpcm_ima_mtf_expand_nibble(), adpcm_ima_oki_expand_nibble(), adpcm_ima_qt_compress_sample(), adpcm_ima_wav_expand_nibble(), adpcm_sanyo_expand3(), adpcm_sanyo_expand4(), adpcm_sanyo_expand5(), adpcm_sbpro_expand_nibble(), adpcm_swf_decode(), adpcm_yamaha_compress_sample(), adpcm_yamaha_expand_nibble(), adpcm_zork_expand_nibble(), alac_encode_init(), alf_clip(), alf_filter_cc(), als_weighting(), apply_8x8(), apply_channel_coupling(), apply_prof(), apply_prof_uni(), apply_prof_uni_w(), aptx_invert_quantization(), aptx_process_subband(), apv_decode_transquant_c(), apv_write_vlc_spec(), asf_read_timestamp(), ass_log(), av_log_default_callback(), av_timecode_get_smpte(), bgmc_lut_getp(), bidirectional_obmc(), bilateral_obmc(), build_filter(), build_qp_table(), bytestream2_seek(), bytestream2_seek_p(), cabac_init_state(), cabac_init_state(), calc_bit_demand(), calc_dequant(), calc_input_response(), calc_split_position(), celt_enc_quant_pfilter(), celt_quant_fine(), check_lpc(), chroma_4mv_motion(), chroma_tc(), clamp_mv(), clamp_mv(), clip(), color_graticule(), color_graticule16(), compute_unsafe_ssd_integral_image(), config_input(), config_input(), config_input(), config_props(), create_default_qtables(), d3d12va_encode_av1_set_tile(), d3d12va_encode_h264_configure(), d3d12va_encode_hevc_configure(), dct_error(), dds_decode(), deband_16_c(), deband_16_coupling_c(), deband_8_c(), deband_8_coupling_c(), deblocking_filter_CTB(), dec_delay3_2nd(), decode(), decode(), decode_adpcm_ima_hvqm2(), decode_adpcm_ima_hvqm4(), decode_channel(), decode_envelope(), decode_frame(), decode_frame(), decode_gain_and_index(), decode_index_tilemap(), decode_init(), decode_init(), decode_mad1_24(), decode_nal_sei_timecode(), decode_pitch_lag_1_6(), decode_pitch_lag_high(), decode_pitch_lag_low(), decode_scalefactors(), decode_slice(), decode_slice_thread(), decode_subband_slice_buffered(), deflicker16(), dequantize(), dequantize_slice_buffered(), derive_bdof_vx_vy(), derive_qp(), derive_subblock_diff_mvs(), determine_bits(), direct_search(), displace_packed(), displace_planar(), do_adaptive_prediction(), draw_arrow(), draw_curves(), draw_line(), draw_response(), draw_sample_line_gray(), draw_sample_line_rgba_full(), draw_sample_line_rgba_scale(), draw_sample_p2p_gray(), draw_sample_p2p_rgba_full(), draw_sample_p2p_rgba_scale(), draw_spatial(), dxv_decode(), dxv_init(), encode_block(), encode_block(), encode_init(), encode_init(), encode_init(), encode_init(), encode_mb_internal(), encode_residual_ch(), escape130_decode_frame(), eval_expr(), eval_expr(), execute_code(), exp_quant_coarse(), ff_aac_search_for_tns(), ff_adpcm_ima_qt_expand_nibble(), ff_decode_pitch_lag(), ff_er_add_slice(), ff_ffv1_encode_init(), ff_g722_update_high_predictor(), ff_g722_update_low_predictor(), ff_gmc_c(), ff_h264_init_cabac_states(), ff_hevc_hls_residual_coding(), ff_hls_write_file_entry(), ff_id3v2_finish(), ff_jpegls_decode_picture(), ff_libwebp_encode_init_common(), ff_mpv_encode_init(), ff_mspel_motion(), ff_nelly_get_sample_bits(), ff_pcm_default_packet_size(), ff_print_time(), ff_sws_alphablendaway(), ff_vbv_update(), ff_vc1_interp_mc(), ff_vc1_mc_1mv(), ff_vc1_mc_4mv_chroma(), ff_vc1_mc_4mv_chroma4(), ff_vc1_mc_4mv_luma(), ff_vc1_pred_b_mv(), ff_vvc_clip_mv(), ffat_init_encoder(), fguv_32x32xn_c(), fgy_32x32xn_c(), fill_gamma_table(), filter(), filter16_3x3(), filter16_5x5(), filter16_7x7(), filter16_column(), filter16_kirsch(), filter16_prewitt(), filter16_roberts(), filter16_row(), filter16_scale(), filter16_scharr(), filter16_sobel(), filter181(), filter_arfq12(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_mafq12(), filter_scale(), filter_slice(), finish_block(), flashsv_encode_init(), g722_encode_init(), g726_decode(), gate_update(), gen_sub_ass(), generate(), generate_grain_uv_c(), generate_grain_y_c(), generate_noise(), get_ep_size(), get_output(), get_qminmax(), get_qtable(), get_sad_ob(), get_sbad(), get_sbad_ob(), get_xoutput(), getimag(), getreal(), gmc1_motion(), green_graticule(), green_graticule16(), gsm_decode_block(), h263_h_loop_filter_c(), h263_v_loop_filter_c(), h264_loop_filter_chroma(), h264_loop_filter_luma(), hap_init(), hap_init(), horizontal_compose_fidelityi_TMPL(), hpel_motion(), init(), init(), init(), init_dequantizer(), init_enc_options(), init_enc_options(), init_enc_options(), init_pass2(), init_qscale_tab(), init_slice_c(), init_stream(), init_tile(), init_video_param(), init_video_param_jpeg(), interpolate(), interpolate_bilinear16(), interpolate_bilinear8(), invert_graticule(), invert_graticule16(), irdft_horizontal16(), ivi_decode_blocks(), kaiser_beta(), lame_window_init(), line_dilate(), line_erode(), lmcs_derive_lut_sample(), loop_filter_c1(), loop_filter_chroma_strong(), loop_filter_chroma_strong_one_side(), loop_filter_chroma_weak(), loop_filter_l1(), loop_filter_luma_large(), loop_filter_luma_strong(), loop_filter_luma_weak(), lowest_referenced_row(), lowpass_line_complex_c_16(), lpf(), ls_decode_line(), ls_encode_line(), lsf_check_stability(), mc_chroma_scaled(), mc_luma_scaled(), mclms_update(), mip_reduced_pred(), mode01(), mode02(), mode03(), mode04(), mode05(), mode06(), mode07(), mode08(), mode09(), mode1516(), mode17(), mode18(), mode21(), mode22(), modplug_read_packet(), mp_decode_layer3(), mpeg4_decode_studio_block(), multiply(), mxf_timestamp_to_int64(), nmr_commit_channel(), nmr_setup_channel(), nmr_solve_group(), nvenc_setup_rate_control(), opus_encode_init(), parse_lfe_16(), parse_lfe_24(), pget(), photocd_decode_frame(), plot_channel_log(), plot_freq(), png_enc_init(), pred_get_y(), pred_weight_table(), predict_intra(), predictor_calc_error(), process_command(), qoa_decode_frame(), quant_band_template(), quantize(), quantize_and_encode_band_cost_template(), quantize_lpc_coefs(), rate_control(), ratecontrol_1pass(), read_var_block_data(), reflectx(), reflecty(), ringbuf_float_at(), rka_decode_init(), rv30_weak_loop_filter(), rv40_strong_loop_filter(), sb_clip_location(), sbc_encode_init(), scaleforopp_x(), scaleforopp_y(), scaleforsame_x(), scaleforsame_y(), search_for_ms(), search_for_pns(), search_for_quantizers_fast(), search_for_quantizers_twoloop(), search_for_tns_short_pooled(), set_bandwidth(), set_constqp(), set_qp_c(), set_roi_map(), set_special_band_scalefactors(), set_vbr(), sga_probe(), silk_decode_frame(), skip_bits_long(), spatial_compose_dd137i_dy_TMPL(), spatial_compose_dd137i_init_TMPL(), spatial_compose_dd97i_dy_TMPL(), spatial_compose_dd97i_init_TMPL(), spatial_compose_fidelity_TMPL(), sps_chroma_qp_table(), ssim360_tape(), store_weight(), stream_open(), subfile_seek(), sum_bits(), svc_encode_init(), svq1_motion_inter_4v_block(), svq1_motion_inter_block(), svq3_mc_dir(), svq3_mc_dir_part(), synchronize_audio(), synth_block_fcb_acb(), synth_frame(), test_apv_entropy_decode_block(), tm2_motion_block(), truespeech_apply_twopoint_filter(), truespeech_synth(), unpack(), update_index(), update_qp(), update_qscale(), update_stat(), update_volume(), vaapi_av1_start_frame(), vaapi_encode_av1_configure(), vaapi_encode_av1_init_picture_params(), vaapi_encode_av1_set_tile(), vaapi_encode_h264_configure(), vaapi_encode_h265_configure(), vaapi_encode_init_rate_control(), vaapi_encode_mjpeg_init_picture_params(), vaapi_encode_mpeg2_configure(), vaapi_encode_vp8_configure(), vaapi_encode_vp9_configure(), vbn_decode_frame(), vbn_encode(), vector_clip_int32_c(), vectorscope16(), video_frame(), video_image_display(), vp5_parse_coeff_models(), vp6_parse_coeff_models(), vvc_deblock(), wv_get_value_integer(), X264_init(), xa_read_header(), xma_decode_packet(), xyz_to_ball(), xyz_to_barrel(), xyz_to_barrelsplit(), xyz_to_cube1x6(), xyz_to_cube3x2(), xyz_to_cube6x1(), xyz_to_cylindrical(), xyz_to_cylindricalea(), xyz_to_dfisheye(), xyz_to_eac(), xyz_to_equisolid(), xyz_to_fisheye(), xyz_to_flat(), xyz_to_hammer(), xyz_to_hequirect(), xyz_to_mercator(), xyz_to_octahedron(), xyz_to_orthographic(), xyz_to_pannini(), xyz_to_sinusoidal(), xyz_to_stereographic(), yuv2rgb_write_full(), yuv2rgb_write_full(), and yuv2rgb_write_full().

◆ av_clip64

◆ av_clip_uint8

#define av_clip_uint8   av_clip_uint8_c

Definition at line 106 of file common.h.

Referenced by add_8x8_clip_c(), add_coefficients(), add_pixels_clamped2_c(), add_pixels_clamped4_c(), add_rect_clamped_c(), alpha_inverse_prediction(), ana_convert(), batch_assign(), cas_slice8(), cavs_idct8_add_c(), cinepak_decode_codebook(), clamp_add_subtract_half(), coef2maxsf(), coef2minsf(), color_balance8(), color_balance8_p(), color_correlation(), color_correlation_gbrp(), colorcontrast_slice8(), colorcontrast_slice8p(), colorcorrect_slice8(), comp(), config_input(), copyadd_block(), create_chrominance_lut(), create_luma_lut(), decode_haar_block(), decode_huff(), deflicker8(), delta_decode(), diagonal_transformation(), dirac_hpel_filter(), dither_color(), do_despill_slice(), do_output(), dpcm_decode_frame(), draw(), draw_legend(), encode_picture(), export_row8(), fade(), ff_add_pixels_clamped_c(), ff_aom_parse_film_grain_sets(), ff_dvdclut_yuv_to_rgb(), ff_ffv1_encode_init(), ff_gradfun_filter_line_c(), ff_ivi_recompose53(), ff_ivi_recompose_haar(), ff_jpegls_decode_picture(), ff_jref_idct1_add(), ff_jref_idct1_put(), ff_line_noise_c(), ff_mss34_dct_put(), ff_put_pixels_clamped_c(), ff_update_palette(), ff_vc1_h_overlap_mmi(), ff_vc1_v_overlap_mmi(), ff_vp8_idct_add_mmi(), ff_vp8_idct_dc_add_mmi(), fic_idct_put(), filter(), filter_3x3(), filter_5x5(), filter_7x7(), filter_chroma_edge(), filter_column(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_kirsch(), filter_luma_edge(), filter_prewitt(), filter_roberts(), filter_row(), filter_scharr(), filter_sobel(), float2rgbe(), float_y_to_uint_y_wrapper(), get_dc(), get_output(), get_xoutput(), hq_idct_put(), idct(), idct(), idct10(), idct2_add(), idct2_put(), idct4col_add(), idct4col_put(), idct_add(), idct_column_true_mmi(), idct_put(), if(), inv_predict_12(), ir2_decode_plane(), ir2_decode_plane_inter(), irdft_horizontal8(), ivi_output_plane(), lerp8(), limitdiff8(), loop_filter_c1(), loop_filter_l1(), lowpass_line_complex_c(), midequalizer8(), monochrome_slice8(), mss2_blit_wmv9_template(), osq_decode_block(), p8idct(), photocd_decode_frame(), pred_angle(), process_xpal(), put_block_8x4(), put_pixels_clamped2_c(), put_pixels_clamped4_c(), put_signed_rect_clamped_8bit_c(), put_snow_qpel2_h_lowpass_8(), put_snow_qpel2_hv_lowpass_8(), put_snow_qpel2_v_lowpass_8(), refine_full(), refine_residual(), render_line(), render_line_unrolled(), resample_cubic(), resample_linear(), rgb_to_yuv(), rgba2ycocg(), rpza_encode_stream(), run_postproc(), rv34_idct_add_c(), rv34_idct_dc_add_c(), scale_samples_u8(), scale_samples_u8_small(), set(), set_frame(), shorten_decode_frame(), svq3_add_idct_c(), tdsc_yuv2rgb(), temperature_slice8(), temperature_slice8p(), tgq_dconly(), tm2_apply_deltas(), tm2_decode_blocks(), transform2(), truemotion2rt_decode_frame(), update_inter_block(), vc1_filter_line(), vc1_filter_line(), vc1_h_overlap_c(), vc1_inv_trans_4x4_c(), vc1_inv_trans_4x4_dc_c(), vc1_inv_trans_4x8_c(), vc1_inv_trans_4x8_dc_c(), vc1_inv_trans_8x4_c(), vc1_inv_trans_8x4_dc_c(), vc1_inv_trans_8x8_dc_c(), vc1_v_overlap_c(), vectorscope8(), vibrance_slice8(), vibrance_slice8p(), vp3_h_loop_filter_c(), vp3_idct_dc_add_c(), vp3_v_loop_filter_c(), vp6_filter_diag4_c(), vp6_filter_hv4(), weight_averages(), wmv2_idct_add_c(), wmv2_idct_put_c(), write_bytes(), write_parameter_block(), ws_snd_decode_frame(), x8_decode_intra_mb(), ycocg2rgba(), yuv2422_1_c_template(), yuv2422_2_c_template(), yuv2422_X_c_template(), yuv2ayuv_1_c_template(), yuv2ayuv_2_c_template(), yuv2ayuv_X_c_template(), yuv2nv12cX_c(), yuv2p01x_wrapper(), yuv2plane1_8_c(), yuv2planeX_8_c(), yuv2planeX_8_lasx(), yuv2planeX_8_ref(), yuv2planeX_u(), yuv2rgb(), yuv2rgb_1_c_template(), yuv2rgb_2_c_template(), yuv2rgb_full_1_c_template(), yuv2rgb_full_1_template_lasx(), yuv2rgb_full_1_template_lsx(), yuv2rgb_full_2_c_template(), yuv2rgb_full_2_template_lasx(), yuv2rgb_full_2_template_lsx(), yuv2rgb_full_X_c_template(), yuv2rgb_full_X_template_lasx(), yuv2rgb_full_X_template_lsx(), yuv2rgb_X_c_template(), yuv2vyu444_1_c(), yuv2vyu444_2_c(), yuv2vyu444_X_c(), yuv2ya8_1_c(), yuv2ya8_2_c(), and yuv2ya8_X_c().

◆ av_clip_int8

◆ av_clip_uint16

◆ av_clip_int16

#define av_clip_int16   av_clip_int16_c

Definition at line 115 of file common.h.

Referenced by adpcm_circus_expand_nibble(), adpcm_ct_expand_nibble(), adpcm_ima_alp_compress_sample(), adpcm_ima_alp_expand_nibble(), adpcm_ima_compress_sample(), adpcm_ima_cunning_expand_nibble(), adpcm_ima_escape_expand_nibble(), adpcm_ima_expand_nibble(), adpcm_ima_mtf_expand_nibble(), adpcm_ima_qt_compress_sample(), adpcm_ima_wav_expand_nibble(), adpcm_ms_compress_sample(), adpcm_ms_expand_nibble(), adpcm_mtaf_expand_nibble(), adpcm_sanyo_expand3(), adpcm_sanyo_expand4(), adpcm_sanyo_expand5(), adpcm_swf_decode(), adpcm_yamaha_compress_sample(), adpcm_yamaha_expand_nibble(), adpcm_zork_expand_nibble(), adx_decode(), apply_tilt_comp(), bmv_aud_decode_frame(), bonk_decode(), build_filter(), cinaudio_decode_frame(), cng_decode_frame(), comp_ppf_gains(), d3d12va_encode_setup_roi(), decode(), decode_audio_s16(), decode_block(), decode_filter(), decode_frame(), do_adaptive_prediction(), do_apply_filter(), dpcm_decode_frame(), dss_sp_32to16bit(), dss_sp_convert_coeffs(), dss_sp_gen_exc(), dss_sp_sf_synthesis(), dss_sp_shift_sq_add(), dss_sp_shift_sq_sub(), dss_sp_update_state(), encode_high(), encode_low(), ff_acelp_high_pass_filter(), ff_acelp_interpolate(), ff_acelp_weighted_vector_sum(), ff_adpcm_argo_expand_nibble(), ff_adpcm_ima_qt_expand_nibble(), ff_celp_lp_synthesis_filter(), ff_dca_xll_filter_frame(), ff_g729_adaptive_gain_control(), fill_gamma_table(), filter(), filterfn(), g722_decode_frame(), g723_1_decode_frame(), g723_1_encode_frame(), gain_scale(), generate_noise(), get_shear_params_valid(), libopus_decode(), mix(), multiply3x3_c(), mv_scale(), postprocess(), qoa_decode_frame(), ra144_decode_frame(), rescale_rational(), round_sample(), sbc_synthesize_eight(), sbc_synthesize_four(), scalarproduct(), scale_samples_s16(), scale_samples_s16_small(), set(), shorten_decode_frame(), silk_lsf2lpc(), vector_fmul_window_scaled_c(), xa_decode(), yuv2ayuv64_X_c(), yuv2rgb(), and yuv2y2xx_wrapper().

◆ av_clipl_int32

◆ av_clip_intp2

◆ av_clip_uintp2

#define av_clip_uintp2   av_clip_uintp2_c

Definition at line 124 of file common.h.

Referenced by abs_get_rice_param(), ac3_bit_alloc_calc_bap_c(), adpcm_mtaf_expand_nibble(), alf_get_idx(), alf_get_idx(), apply_lut(), apply_lut10(), apv_decode_transquant_c(), bit_allocate(), cabac_init_state(), categorize(), categorize_regions(), celt_gauge_psy_weight(), cng_encode_frame(), coded_lossless_param(), colorlevels_preserve_slice_10_planar(), colorlevels_preserve_slice_12_planar(), colorlevels_preserve_slice_14_planar(), colorlevels_preserve_slice_9_planar(), colorlevels_slice_10_planar(), colorlevels_slice_12_planar(), colorlevels_slice_14_planar(), colorlevels_slice_9_planar(), create_chrominance_lut(), create_luma_lut(), d3d12va_encode_av1_configure(), decode_blocks(), decode_frame_header(), dpcm_decode_frame(), encode_yuv422p10(), ff_celt_quant_bands(), ff_hw_base_encode_init_params_h264(), filter_level_for_mb(), filter_slice_rgba_packed(), filter_slice_rgba_planar(), flac_finish_header(), gain_scale(), hqx_idct_put(), if(), init_video_param(), interlaced_vertical_filter(), ivi_decode_blocks(), mp_decode_frame_helper(), mp_decode_line(), mpeg4_encode_mb(), process_alpha(), process_alpha(), process_bayer(), pvq_band_cost(), quantize_and_encode_band_cost_template(), refine_colors(), silk_decode_frame(), silk_decode_lpc(), uncompressed_header(), unpack(), vaapi_vp8_start_frame(), vc1_decode_intra_block(), vp8_get_quants(), yuv2gbrp16_full_X_c(), yuv2gbrp_full_X_c(), yuv2gbrpf32_full_X_c(), yuv2rgb_write_full(), yuv2rgb_write_full(), yuv2rgb_write_full(), yuv2rgba64_1_c_template(), yuv2rgba64_2_c_template(), yuv2rgba64_full_1_c_template(), yuv2rgba64_full_2_c_template(), yuv2rgba64_full_X_c_template(), yuv2rgba64_X_c_template(), and yuv2v30_X_c_template().

◆ av_sat_add32

◆ av_sat_dadd32

#define av_sat_dadd32   av_sat_dadd32_c

Definition at line 130 of file common.h.

Referenced by ff_g723_1_gen_acb_excitation(), formant_postfilter(), gain_scale(), and lsp2lpc().

◆ av_sat_sub32

#define av_sat_sub32   av_sat_sub32_c

Definition at line 133 of file common.h.

Referenced by av_sat_dsub32_c(), and silk_is_lpc_stable().

◆ av_sat_dsub32

#define av_sat_dsub32   av_sat_dsub32_c

Definition at line 136 of file common.h.

◆ av_sat_add64

◆ av_sat_sub64

◆ av_clipf

#define av_clipf   av_clipf_c

Definition at line 145 of file common.h.

Referenced by aac_encode_frame(), angle_transform(), bit_allocation(), calc_bit_demand(), calc_max_draw(), calc_replaygain(), cas_slice16(), cas_slice8(), comp_adjust(), compute_bilinear_map(), decode(), decode_frame(), decode_frame(), decorrelation(), detect_scene_change(), do_backgroundkey16_slice(), do_backgroundkey_slice(), do_hsvkey_pixel(), draw_legend(), draw_spatial(), encode_init(), encode_init(), evaluate(), fcb_excitation(), ff_affine_transform(), ff_libwebp_encode_init_common(), ff_mpc_dequantize_and_synth(), ff_rate_control_init(), filter(), filter_flt(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_slice_rgba_packed(), filter_slice_rgba_planar(), filters(), filters(), filters(), filters(), find_hb_gain(), find_motion(), fixed_gain_smooth(), focus_transform(), get_component(), get_lin_bin_abs(), get_lin_bin_sign(), get_log_bin_abs(), get_log_bin_sign(), get_scale(), get_scene_score(), get_scene_score(), get_scene_score(), get_value(), grayf16ToY16_c(), grayf32ToY16_c(), hfun(), init_noise(), libopus_decode(), libx265_encode_set_roi(), lsp_interpolate(), lu_to_y(), nb_decode(), nmr_decide_stereo(), nmr_setup_channel(), nmr_solve_group(), parse_cinespace(), parse_cube(), pitch_filter(), pitch_sharpening(), planar_rgbf16_to_uv(), planar_rgbf16_to_y(), planar_rgbf32_to_uv(), planar_rgbf32_to_y(), plot_spectrum_column(), postscale_c(), pq_eotf(), prelut_interp_1d_linear(), project(), psy_3gpp_analyze_channel(), psy_3gpp_init(), quant_dn(), read_yaf16_alpha_c(), read_yaf16_gray_c(), read_yaf32_alpha_c(), read_yaf32_gray_c(), remap_log(), rgb9plus_planar_funcs(), rgbaf16ToA_endian(), rgbaf16ToUV_endian(), rgbaf16ToUV_half_endian(), rgbaf16ToY_endian(), rgbf16ToUV_endian(), rgbf16ToUV_half_endian(), rgbf16ToY_endian(), rgbf32_to_uv_c(), rgbf32_to_uv_half_c(), rgbf32_to_y_c(), sanitize_values(), saturate(), search_for_pns(), search_for_quantizers_twoloop(), set_brightness(), set_contrast(), set_gamma(), set_saturation(), setup_roi(), shifted_planar_rgb16(), silk_decode_frame(), silk_unmix_ms(), smoothstep(), smoothstepf(), softmax_exp(), spx_coordinates(), st2094_pick_knee(), step_collect_psy_metrics(), stereo_position(), swr_next_pts(), synth_block_fcb_acb(), tone_map_setup(), tonemap(), twinvq_mulawinv(), update_context(), vector_clipf_c(), xfade_frame(), xfade_frame(), xfade_frame(), and xyz_to_mercator().

◆ av_clipd

◆ av_zero_extend

◆ av_popcount

◆ av_popcount64

◆ GET_UTF8

#define GET_UTF8 ( val,
GET_BYTE,
ERROR )
Value:
val= (uint8_t)(GET_BYTE);\
{\
uint32_t top = (val & 128) >> 1;\
if ((val & 0xc0) == 0x80 || val >= 0xFE)\
{ERROR}\
while (val & top) {\
unsigned int tmp = (uint8_t)(GET_BYTE) - 128;\
if(tmp>>6)\
{ERROR}\
val= (val<<6) + tmp;\
top <<= 5;\
}\
val &= (top << 1) - 1;\
}
static double val(void *priv, double ch)
Definition aeval.c:77
static uint8_t tmp[40]
Definition aes_ctr.c:52
static void ERROR(const char *str)
Definition audio_fifo.c:58

Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.

Parameters
valOutput value, must be an lvalue of type uint32_t.
GET_BYTEExpression reading one byte from the input. Evaluated up to 7 times (4 for the currently assigned Unicode range). With a memory buffer input, this could be *ptr++, or if you want to make sure that *ptr stops at the end of a NULL terminated string then *ptr ? *ptr++ : 0
ERRORExpression to be evaluated on invalid input, typically a goto statement.
Warning
ERROR should not contain a loop control statement which could interact with the internal while loop, and should force an exit from the macro code (e.g. through a goto or a return) in order to prevent undefined results.

Definition at line 477 of file common.h.

Referenced by ascii_to_wc(), encode_str8(), get_utf8(), get_utf8_length_at(), measure_text(), mxf_utf16len(), put_str16(), utf8_check(), and utf8len().

◆ GET_UTF16

#define GET_UTF16 ( val,
GET_16BIT,
ERROR )
Value:
val = (uint16_t)(GET_16BIT);\
{\
unsigned int hi = val - 0xD800;\
if (hi < 0x800) {\
val = (uint16_t)(GET_16BIT) - 0xDC00;\
if (val > 0x3FFU || hi > 0x3FFU)\
{ERROR}\
val += (hi<<10) + 0x10000;\
}\
}\

Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.

Parameters
valOutput value, must be an lvalue of type uint32_t.
GET_16BITExpression returning two bytes of UTF-16 data converted to native byte order. Evaluated one or two times.
ERRORExpression to be evaluated on invalid input, typically a goto statement.

Definition at line 502 of file common.h.

Referenced by decode_str(), ff_text_r8(), and get_asf_string().

◆ PUT_UTF8

#define PUT_UTF8 ( val,
tmp,
PUT_BYTE )
Value:
{\
int bytes, shift;\
uint32_t in = val;\
if (in < 0x80) {\
tmp = in;\
PUT_BYTE\
} else {\
bytes = (av_log2(in) + 4) / 5;\
shift = (bytes - 1) * 6;\
tmp = (256 - (256 >> bytes)) | (in >> shift);\
PUT_BYTE\
while (shift >= 6) {\
shift -= 6;\
tmp = 0x80 | ((in >> shift) & 0x3f);\
PUT_BYTE\
}\
}\
}
#define av_log2
Definition intmath.h:84
static int shift(int a, int b)
Definition bonk.c:261

Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).

Parameters
valis an input-only argument and should be of type uint32_t. It holds a UCS-4 encoded Unicode character that is to be converted to UTF-8. If val is given as a function it is executed only once.
tmpis a temporary variable and should be of type uint8_t. It represents an intermediate value during conversion that is to be output by PUT_BYTE.
PUT_BYTEwrites the converted UTF-8 bytes to any proper destination. It could be a function or a statement, and uses tmp as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be executed up to 4 times for values in the valid UTF-8 range and up to 7 times in the general case, depending on the length of the converted Unicode character.

Definition at line 530 of file common.h.

Referenced by count_frame_header(), decode_str(), decode_string(), ff_text_r8(), get_asf_string(), mov_read_mac_string(), and write_utf8().

◆ PUT_UTF16

#define PUT_UTF16 ( val,
tmp,
PUT_16BIT )
Value:
{\
uint32_t in = val;\
if (in < 0x10000) {\
tmp = in;\
PUT_16BIT\
} else {\
tmp = 0xD800 | ((in - 0x10000) >> 10);\
PUT_16BIT\
tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
PUT_16BIT\
}\
}\

Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).

Parameters
valis an input-only argument and should be of type uint32_t. It holds a UCS-4 encoded Unicode character that is to be converted to UTF-16. If val is given as a function it is executed only once.
tmpis a temporary variable and should be of type uint16_t. It represents an intermediate value during conversion that is to be output by PUT_16BIT.
PUT_16BITwrites the converted UTF-16 data to any proper destination in desired endianness. It could be a function or a statement, and uses tmp as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be executed 1 or 2 times depending on input character.

Definition at line 564 of file common.h.

Referenced by put_str16().

Function Documentation

◆ av_clip_c()

static av_always_inline av_const int av_clip_c ( int a,
int amin,
int amax )
static

Clip a signed integer value into the amin-amax range.

Parameters
avalue to clip
aminminimum value of the clip range
amaxmaximum value of the clip range
Returns
clipped value

Definition at line 178 of file common.h.

◆ av_clip64_c()

static av_always_inline av_const int64_t av_clip64_c ( int64_t a,
int64_t amin,
int64_t amax )
static

Clip a signed 64bit integer value into the amin-amax range.

Parameters
avalue to clip
aminminimum value of the clip range
amaxmaximum value of the clip range
Returns
clipped value

Definition at line 195 of file common.h.

◆ av_clip_uint8_c()

static av_always_inline av_const uint8_t av_clip_uint8_c ( int a)
static

Clip a signed integer value into the 0-255 range.

Parameters
avalue to clip
Returns
clipped value

Definition at line 210 of file common.h.

◆ av_clip_int8_c()

static av_always_inline av_const int8_t av_clip_int8_c ( int a)
static

Clip a signed integer value into the -128,127 range.

Parameters
avalue to clip
Returns
clipped value

Definition at line 221 of file common.h.

◆ av_clip_uint16_c()

static av_always_inline av_const uint16_t av_clip_uint16_c ( int a)
static

Clip a signed integer value into the 0-65535 range.

Parameters
avalue to clip
Returns
clipped value

Definition at line 232 of file common.h.

◆ av_clip_int16_c()

static av_always_inline av_const int16_t av_clip_int16_c ( int a)
static

Clip a signed integer value into the -32768,32767 range.

Parameters
avalue to clip
Returns
clipped value

Definition at line 243 of file common.h.

◆ av_clipl_int32_c()

static av_always_inline av_const int32_t av_clipl_int32_c ( int64_t a)
static

Clip a signed 64-bit integer value into the -2147483648,2147483647 range.

Parameters
avalue to clip
Returns
clipped value

Definition at line 254 of file common.h.

◆ av_clip_intp2_c()

static av_always_inline av_const int av_clip_intp2_c ( int a,
int p )
static

Clip a signed integer into the -(2^p),(2^p-1) range.

Parameters
avalue to clip
pbit position to clip at
Returns
clipped value

Definition at line 266 of file common.h.

◆ av_clip_uintp2_c()

static av_always_inline av_const unsigned av_clip_uintp2_c ( int a,
int p )
static

◆ av_zero_extend_c()

static av_always_inline av_const unsigned av_zero_extend_c ( unsigned a,
unsigned p )
static

Clear high bits from an unsigned integer starting with specific bit position.

Parameters
avalue to clip
pbit position to clip at. Must be between 0 and 31.
Returns
clipped value

Definition at line 292 of file common.h.

◆ av_sat_add32_c()

static av_always_inline int av_sat_add32_c ( int a,
int b )
static

Add two signed 32-bit values with saturation.

Parameters
aone value
banother value
Returns
sum with signed saturation

Definition at line 307 of file common.h.

◆ av_sat_dadd32_c()

static av_always_inline int av_sat_dadd32_c ( int a,
int b )
static

Add a doubled value to another value with saturation at both stages.

Parameters
afirst value
bvalue doubled and added to a
Returns
sum sat(a + sat(2*b)) with signed saturation

Definition at line 319 of file common.h.

◆ av_sat_sub32_c()

static av_always_inline int av_sat_sub32_c ( int a,
int b )
static

Subtract two signed 32-bit values with saturation.

Parameters
aone value
banother value
Returns
difference with signed saturation

Definition at line 331 of file common.h.

◆ av_sat_dsub32_c()

static av_always_inline int av_sat_dsub32_c ( int a,
int b )
static

Subtract a doubled value from another value with saturation at both stages.

Parameters
afirst value
bvalue doubled and subtracted from a
Returns
difference sat(a - sat(2*b)) with signed saturation

Definition at line 343 of file common.h.

◆ av_sat_add64_c()

static av_always_inline int64_t av_sat_add64_c ( int64_t a,
int64_t b )
static

Add two signed 64-bit values with saturation.

Parameters
aone value
banother value
Returns
sum with signed saturation

Definition at line 355 of file common.h.

◆ av_sat_sub64_c()

static av_always_inline int64_t av_sat_sub64_c ( int64_t a,
int64_t b )
static

Subtract two signed 64-bit values with saturation.

Parameters
aone value
banother value
Returns
difference with signed saturation

Definition at line 374 of file common.h.

◆ av_clipf_c()

static av_always_inline av_const float av_clipf_c ( float a,
float amin,
float amax )
static

Clip a float value into the amin-amax range.

If a is nan or -inf amin will be returned. If a is +inf amax will be returned.

Parameters
avalue to clip
aminminimum value of the clip range
amaxmaximum value of the clip range
Returns
clipped value

Definition at line 396 of file common.h.

◆ av_clipd_c()

static av_always_inline av_const double av_clipd_c ( double a,
double amin,
double amax )
static

Clip a double value into the amin-amax range.

If a is nan or -inf amin will be returned. If a is +inf amax will be returned.

Parameters
avalue to clip
aminminimum value of the clip range
amaxmaximum value of the clip range
Returns
clipped value

Definition at line 413 of file common.h.

◆ av_ceil_log2_c()

static av_always_inline av_const int av_ceil_log2_c ( int x)
static

Compute ceil(log2(x)).

Parameters
xvalue used to compute ceil(log2(x))
Returns
computed ceiling of log2(x)

Definition at line 425 of file common.h.

Referenced by config_input(), config_input(), and hevc_parse_slice_header().

◆ av_popcount_c()

static av_always_inline av_const int av_popcount_c ( uint32_t x)
static

Count number of bits set to one in x.

Parameters
xvalue to count bits of
Returns
the number of bits set to one in x

Definition at line 435 of file common.h.

◆ av_popcount64_c()

static av_always_inline av_const int av_popcount64_c ( uint64_t x)
static

Count number of bits set to one in x.

Parameters
xvalue to count bits of
Returns
the number of bits set to one in x

Definition at line 449 of file common.h.

◆ av_parity_c()

static av_always_inline av_const int av_parity_c ( uint32_t v)
static

Definition at line 454 of file common.h.