simple arithmetic expression evaluator. More...
#include <float.h>#include "attributes.h"#include "avassert.h"#include "avutil.h"#include "common.h"#include "eval.h"#include "ffmath.h"#include "log.h"#include "mathematics.h"#include "mem.h"#include "sfc64.h"#include "time.h"#include "avstring.h"#include "reverse.h"Go to the source code of this file.
simple arithmetic expression evaluator.
see http://joe.hotchkiss.com/programming/eval/eval.html
Definition in file eval.c.
Definition at line 59 of file eval.c.
Referenced by av_expr_parse(), and eval_expr().
Referenced by eval_expr().
Parse the string in numstr and return its value as a double.
If the string is empty, contains only whitespaces, or does not contain an initial substring that has the expected syntax for a floating-point number, no conversion is performed. In this case, returns a value of zero and the value returned in tail is the value of numstr.
Definition at line 110 of file eval.c.
Referenced by ff_parse_sample_rate(), parse_number(), parse_points_str(), parse_primary(), parse_string(), parse_weights(), set_param(), var_read_float(), vgs_eval(), and vgs_parse_numeric_argument().
Definition at line 151 of file eval.c.
Referenced by parse_primary().
Definition at line 191 of file eval.c.
Referenced by parse_primary().
Definition at line 196 of file eval.c.
Referenced by av_expr_eval(), and eval_expr().
Definition at line 664 of file eval.c.
Referenced by av_expr_parse(), and parse_primary().
Free a parsed expression previously created with av_expr_parse().
Definition at line 368 of file eval.c.
Referenced by addroi_uninit(), av_expr_free(), av_expr_parse(), av_expr_parse_and_eval(), avfilter_free(), command(), config_input(), config_input(), config_input(), config_input(), config_output(), config_params(), config_props(), config_props(), eval_expr(), eval_expr(), eval_expr(), ff_rate_control_uninit(), generate_kernel(), geq_uninit(), init(), init_axis_color(), init_cqt(), init_volume(), libplacebo_uninit(), noise_close(), nppscale_parse_expr(), nppscale_uninit(), ost_free(), overlay_cuda_uninit(), parse_channel_expressions(), parse_expr(), parse_factor(), parse_primary(), parse_subexpr(), parse_term(), process_command(), process_command(), scale_parse_expr(), set_enable_expr(), set_expr(), set_expr(), set_expr(), set_expr(), set_expr(), set_expr(), setts_close(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), uninit(), and vgs_statement_free().
Definition at line 382 of file eval.c.
Referenced by parse_dB(), and parse_pow().
Definition at line 551 of file eval.c.
Referenced by parse_expr(), parse_factor(), parse_subexpr(), and parse_term().
Definition at line 567 of file eval.c.
Referenced by parse_dB().
Definition at line 574 of file eval.c.
Referenced by parse_factor().
Definition at line 589 of file eval.c.
Referenced by parse_term().
Definition at line 616 of file eval.c.
Referenced by parse_subexpr().
Definition at line 640 of file eval.c.
Referenced by parse_expr().
Definition at line 694 of file eval.c.
Referenced by av_expr_parse(), and verify_expr().
Parse an expression.
Definition at line 735 of file eval.c.
Referenced by addroi_init(), av_expr_parse_and_eval(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_input(), config_output(), config_output(), config_output(), config_params(), config_props(), config_props(), ff_rate_control_init(), generate_kernel(), geq_init(), init(), init(), init(), init(), init(), init(), init_axis_color(), init_cqt(), init_volume(), initialize(), libplacebo_init(), modplug_read_header(), noise_init(), nppscale_parse_expr(), process_command(), process_command(), process_command(), process_command(), process_forced_keyframes(), scale_parse_expr(), set_enable_expr(), set_expr(), set_expr(), set_expr(), set_expr(), set_expr(), set_expr(), setts_init(), and vgs_parse_numeric_argument().
Definition at line 798 of file eval.c.
Referenced by av_expr_count_func(), av_expr_count_vars(), and expr_count().
Track the presence of variables and their number of occurrences in a parsed expression.
Definition at line 814 of file eval.c.
Referenced by check_exprs(), check_exprs(), nppscale_scale(), and scale_frame().
Track the presence of user provided functions and their number of occurrences in a parsed expression.
Definition at line 819 of file eval.c.
Referenced by geq_init().
Evaluate a previously parsed expression.
Definition at line 824 of file eval.c.
Referenced by activate(), activate(), addroi_config_input(), av_expr_parse_and_eval(), config_input(), config_input(), config_output(), config_output(), config_props(), do_eval(), draw_text(), eval_expr(), eval_expr(), eval_expr(), eval_expr(), eval_pts(), evaluate_timeline_at_frame(), filter_channel(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), forced_kf_apply(), generate_kernel(), get_max_local_gain(), get_qscale(), get_target_gain(), init(), init_axis_color(), init_cqt(), init_volume(), modplug_read_packet(), noise(), nppscale_eval_dimensions(), output_single_frame(), parse_expr(), request_frame(), scale_eval_dimensions(), select_frame(), set_brightness(), set_contrast(), set_gamma(), set_saturation(), set_volume(), setts_filter(), slice_geq_filter(), update_alpha(), update_context(), update_crops(), and vgs_eval().
Parse and evaluate an expression.
Note, this is significantly slower than av_expr_eval().
Definition at line 839 of file eval.c.
Referenced by activate(), av_parse_ratio(), calc_persp_luts(), config_input(), config_input(), config_input(), config_output(), config_output_props(), config_props(), config_props(), config_props(), drawbox_vaapi_config_output(), eval_expr(), ff_print_eval_expr(), ff_print_formatted_eval_expr(), ff_scale_eval_dimensions(), filter_frame(), filter_frame(), filter_frame(), generate_kernel(), get_aspect_ratio(), main(), pad_opencl_config_output(), pad_vaapi_config_output(), and set_string_number().
Definition at line 64 of file eval.c.
Referenced by av_expr_eval(), and av_expr_parse().
Definition at line 76 of file eval.c.
Referenced by ac3_exponent_min_c(), ac3_extract_exponents_c(), acelp_decode_gain_codef(), apply_channel_coupling(), ath(), av_bessel_i0(), av_div_sf_ieee754(), av_mul_sf_ieee754(), bit_allocate(), bitreduction(), checkasm_mean(), checkasm_median(), checkasm_mode(), checkasm_sample(), checkasm_stddev(), checkasm_var_add(), checkasm_var_pow(), checkasm_var_sub(), comp_harmonic_coeff(), compute_exp_strategy(), config_filter(), config_input(), config_output(), config_output(), config_output(), convert_sp2zp(), create_freq_table(), decode(), decode_aiff_header(), decode_subframe(), dnn_detect_parse_yolo_output(), encode_exp_vlc(), encode_exponents(), encode_exponents_blk_ch(), erf(), estimate_pitch(), eval_expr(), evrc_decode_frame(), exit_handler(), fade_gain(), ff_ac3_bit_alloc_calc_psd(), ff_ac3_exponent_min_neon(), ff_ac3_exponent_min_rvb(), ff_ac3_exponent_min_rvv(), ff_ac3_exponent_min_sse2(), ff_ac3_extract_exponents_neon(), ff_ac3_extract_exponents_sse2(), ff_ac3_extract_exponents_ssse3(), ff_extract_exponents_rvb(), ff_extract_exponents_rvvb(), ff_tx_mdct_fwd(), ff_tx_mdct_inv(), filter_dbl(), filter_frame(), fir_to_phase(), gaussian(), gaussian(), generate_min_phase_kernel(), generate_window_func(), get_aiff_header(), get_coef(), get_volume(), get_volume(), hom(), init(), init_gaussian_filter(), init_gaussian_filter(), init_pass2(), mapres(), modify_qscale(), mult(), nb_decode(), noise_filter(), output_gain(), output_gain(), parse_mantissas(), parse_points(), parse_primary(), put_float(), qdm2_fft_decode_tones(), qdm2_fft_init_coefficient(), quant(), quantize_mantissas_blk_ch(), relative_error(), sbr_hf_g_filt_c(), scalbnl(), set_ap1(), set_band_parameters(), set_default_ctl_value(), set_gauss(), set_parameters(), sigmoid(), spectral_flatness(), speex_std_stereo(), stream_component_open(), swri_dither_init(), sws_getGaussianVec(), trc_arib_std_b67_inv(), try_export_flags(), twinvq_mulawinv(), unsharp_opencl_make_filter_params(), vorbis_floor0_decode(), vorbisfloat2float(), and wv_get_value_float().
Definition at line 102 of file eval.c.
Referenced by ac_decode_bool(), add_info(), add_meta(), add_metadata(), add_serial_pair(), amr_parse_fmtp(), ape_tag_read_field(), aptx_bin_search(), arith2_get_scaled_value(), asf_read_generic_value(), asf_read_value(), asf_set_metadata(), asf_store_aspect_ratio(), asf_write_header1(), autocorrelation(), av_dict_set(), av_dict_set_fxp(), av_dict_set_int(), av_exif_get_entry(), av_exif_set_entry(), av_opt_set_from_string(), avf_device_from_id(), avf_device_listing_serial(), avi_read_tag(), avpriv_fits_header_parse_line(), bidir_sal(), binary(), blend_line16(), blend_pixel16(), bsf_opt_parse(), cat_header(), cbs_read_multi_byte(), cbs_vp8_bool_decoder_read_signed(), cbs_vp8_bool_decoder_read_unsigned(), cbs_vp8_read_unsigned_le(), cbs_vp9_read_increment(), cbs_vp9_read_le(), cbs_vp9_read_s(), cbs_vp9_write_increment(), cbs_vp9_write_le(), cbs_vp9_write_s(), cbs_write_multi_byte(), celt_decode_coarse_energy(), celt_stereo_merge(), cfhd_encode_init(), check_4block_inter(), check_block_inter(), check_fill(), check_func(), check_lengths(), comp_adjust(), compact_print_int(), compact_print_str(), crazytime_to_avtime(), dctcoef_set(), decode_adaptive45(), decode_adaptive6(), decode_block(), decode_block(), decode_byterun(), decode_coeffs(), decode_delta_j(), decode_frame(), decode_header(), decode_info_header(), decode_inter(), decode_macroblock(), decode_mad1_24(), decode_motion(), decode_motion_vectors(), decode_skip_count(), decode_skip_count(), decode_unit(), decode_unit3(), decode_value(), decode_value3(), default_print_int(), default_print_str(), deq_idx(), dequantize_coefficients(), dict_iterate(), dict_set_if_not_null(), dng_process_color16(), dng_process_color8(), do_interpolation(), draw_dot(), draw_dot(), draw_legend(), draw_scope(), dss_read_metadata_string(), dtshd_read_header(), dv_sdp_parse_fmtp_config(), dxv_compress_dxt1(), dxv_decompress_dxt1(), dxv_decompress_dxt5(), encode_gbrp10(), encode_gbrp12(), encode_rgb48_10bit(), exif_get_entry(), exif_ifd_to_dict(), expand32(), extract_segment_number(), factorization(), fastaudio_decode(), ff_AMediaFormat_setFloat(), ff_AMediaFormat_setInt32(), ff_AMediaFormat_setInt64(), ff_AMediaFormat_setString(), ff_apv_entropy_build_decode_lut(), ff_bgmc_decode(), ff_cbs_read_se_golomb(), ff_cbs_read_ue_golomb(), ff_cbs_write_se_golomb(), ff_cbs_write_ue_golomb(), ff_draw_round_to_sub(), ff_ebur128_set_channel(), ff_exp2(), ff_fill_block16_mmi(), ff_fill_block16_rvv(), ff_fill_block8_mmi(), ff_fill_block8_rvv(), ff_fill_block_tab_16_avx2(), ff_fill_block_tab_16_sse2(), ff_fill_block_tab_8_avx2(), ff_fill_block_tab_8_sse2(), ff_filter_opt_parse(), ff_get_cpu_flags_riscv(), ff_h264_parse_sprop_parameter_sets(), ff_hevc_rem_intra_luma_pred_mode_decode(), ff_hevc_sao_band_position_decode(), ff_http_auth_handle_header(), ff_imf_xml_read_boolean(), ff_itunes_parse_smpb(), ff_log2_q15(), ff_mjpeg_encode_huffman_close(), ff_opus_rc_dec_laplace(), ff_opus_rc_enc_laplace(), ff_opus_rc_get_raw(), ff_parse_fmtp(), ff_put_no_rnd_pixels_l2_msa(), ff_read_riff_info(), ff_rtsp_next_attr_and_value(), ff_safe_queue_pop_front(), ff_tadd_string_metadata(), ff_vp3dsp_set_bounding_values(), fill_block16_c(), fill_block8_c(), fill_ltable(), filter_color(), filter_color2(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_mono(), filter_units_make_type_list(), filterfn(), find_index(), fixed_length_decode(), flat_print_int(), flat_print_str(), flic_decode_frame_1BPP(), ftp_parse_entry_mlsd(), g729_prng(), generate_grain_uv_c(), generate_grain_y_c(), generate_hann_window(), generate_hann_window(), generate_spread_table(), get_bucket(), get_cbphi(), get_duration_insec(), get_opt_const_name(), get_opt_flags_string(), get_tag(), get_v210(), get_variable_bits(), gxf_material_tags(), gxf_track_tags(), handle_connect_error(), hevc_sdp_parse_fmtp_config(), hex_log(), id3v2_3_metadata_split_date(), ilbc_parse_fmtp(), import_map(), ini_print_int(), ini_print_str(), init_ptable(), interpolation(), ivr_read_header(), jpeg2000_decode_ctx_vlc(), jpeg2000_modify_state(), json_print_int(), json_print_item_str(), json_print_str(), kth_order_egk_decode(), l3_unscale(), lag_decode_prob(), last_sig_coeff_suffix_decode(), last_significant_coeff_suffix_decode(), liboapve_init(), libx265_param_parse_float(), libx265_param_parse_int(), log2s(), main(), make_eval_expr(), map_freq(), mcc_parse_time_code_part(), mcc_read_header(), mediaformat_jni_setFloat(), mediaformat_jni_setInt32(), mediaformat_jni_setInt64(), mediaformat_jni_setString(), mediaformat_ndk_setFloat(), mediaformat_ndk_setInt32(), mediaformat_ndk_setInt64(), mediaformat_ndk_setString(), mermaid_print_int(), mermaid_print_str(), mov_read_iloc(), mov_read_timecode_track(), mov_write_emsg_tag(), mov_write_string_tag(), mov_write_track_kind(), move_metadata(), mpegaudio_tableinit(), mpegaudiodec_common_tableinit(), mpegts_check_bitstream(), msp2_decode_frame(), mxf_free_metadataset(), mxf_read_pixel_layout(), mxf_write_local_tag_utf16(), mxf_write_metadata_key(), mxf_write_tagged_value(), mxf_write_uuid(), nist_read_header(), nsp_read_header(), nsv_parse_NSVf_header(), offset_fn(), oledate_to_avtime(), open_slave(), opt_preset(), pack_float_sample(), param_write_hex(), param_write_int(), param_write_string(), parse_content_length(), parse_fmtp(), parse_fmtp(), parse_fmtp(), parse_fmtp_config(), parse_fmtp_config(), parse_lfe_16(), parse_lfe_24(), parse_line(), parse_mantissas(), parse_multipart_header(), parse_profile_level_id(), parse_set_cookie(), parse_timecode_in_framenum_format(), parse_utf(), parse_value(), pcx_rle_decode(), pick_color16(), pick_color8(), picmemset(), picmemset_8bpp(), pixscope_filter_frame(), pop_int(), pow_2(), process_command(), process_float(), put_bits(), put_bits32(), put_bits63(), put_bits64(), put_bits_le(), put_bits_no_assert(), ABI::Windows ::Graphics::Capture::put_MinUpdateInterval(), put_sbits(), put_sbits63(), qdm2_decode(), qdm2_decode_fft_packets(), qdm2_get_se_vlc(), qdm2_get_vlc(), qdm2_packet_checksum(), quantize(), quantize_value(), radix_sort_pass(), random_coeff(), randomize_buffers(), rb_size(), read_dist_clustering(), read_high_coeffs(), read_info_chunk(), read_keyword_value(), read_low_coeffs(), read_sm_data(), read_string(), read_tag(), read_uint_max(), read_var_block_data(), read_var_byte(), redirect_cache_set(), remap_log(), reverse_decorr(), reverse_mono_decorr(), rfc4175_parse_fmtp(), rtmp_write_amf_data(), scale_mv(), scale_vt_init(), scan_word(), sdp_parse_fmtp_config_av1(), sdp_parse_fmtp_config_h264(), set_control(), set_disposition_bits(), set_encoder_int_property_or_log(), set_encoder_property_or_log(), set_marker(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_meta(), set_metadata_float(), set_metadata_int(), set_option(), set_sample(), sgn(), silk_decode_excitation(), silk_decode_lpc(), silk_stabilize_lsf(), smc_encode_stream(), softclip(), split_tag_value(), stdc_bit_ceil_uc(), stdc_bit_ceil_ui(), stdc_bit_ceil_ul(), stdc_bit_ceil_ull(), stdc_bit_ceil_us(), stdc_bit_floor_uc(), stdc_bit_floor_ui(), stdc_bit_floor_ul(), stdc_bit_floor_ull(), stdc_bit_floor_us(), stdc_bit_width_uc(), stdc_bit_width_ui(), stdc_bit_width_ul(), stdc_bit_width_ull(), stdc_bit_width_us(), stdc_count_ones_uc(), stdc_count_ones_ui(), stdc_count_ones_ul(), stdc_count_ones_ull(), stdc_count_ones_us(), stdc_count_zeros_uc(), stdc_count_zeros_ui(), stdc_count_zeros_ul(), stdc_count_zeros_ull(), stdc_count_zeros_us(), stdc_first_leading_one_uc(), stdc_first_leading_one_ui(), stdc_first_leading_one_ul(), stdc_first_leading_one_ull(), stdc_first_leading_one_us(), stdc_first_leading_zero_uc(), stdc_first_leading_zero_ui(), stdc_first_leading_zero_ul(), stdc_first_leading_zero_ull(), stdc_first_leading_zero_us(), stdc_first_trailing_one_uc(), stdc_first_trailing_one_ui(), stdc_first_trailing_one_ul(), stdc_first_trailing_one_ull(), stdc_first_trailing_one_us(), stdc_first_trailing_zero_uc(), stdc_first_trailing_zero_ui(), stdc_first_trailing_zero_ul(), stdc_first_trailing_zero_ull(), stdc_first_trailing_zero_us(), stdc_has_single_bit_uc(), stdc_has_single_bit_ui(), stdc_has_single_bit_ul(), stdc_has_single_bit_ull(), stdc_has_single_bit_us(), stdc_leading_ones_uc(), stdc_leading_ones_ui(), stdc_leading_ones_ul(), stdc_leading_ones_ull(), stdc_leading_ones_us(), stdc_leading_zeros_uc(), stdc_leading_zeros_ui(), stdc_leading_zeros_ul(), stdc_leading_zeros_ull(), stdc_leading_zeros_us(), stdc_trailing_ones_uc(), stdc_trailing_ones_ui(), stdc_trailing_ones_ul(), stdc_trailing_ones_ull(), stdc_trailing_ones_us(), stdc_trailing_zeros_uc(), stdc_trailing_zeros_ui(), stdc_trailing_zeros_ul(), stdc_trailing_zeros_ull(), stdc_trailing_zeros_us(), str_to_dict(), subviewer_read_header(), sunrast_decode_frame(), sunrast_image_write_image(), tak_parse_streaminfo(), tgq_decode_block(), tiff_decode_tag(), tput16(), tput32(), tput64(), trace_read_log(), trace_write_log(), tta_decode_frame(), tta_encode_frame(), ttml_set_header_values_from_extradata(), update_band_masking(), update_model2_to_6(), update_model3_to_7(), update_model4_to_5(), update_model5_to_6(), v4l2_get_ext_ctrl(), v4l2_set_ext_ctrl(), vaapi_encode_av1_trace_write_log(), validate_se_golomb_value(), validate_ue_golomb_value(), var_read_metadata(), vc1_decode_ac_coeff(), vc1_decode_i_block(), vc1_decode_i_block_adv(), vc1_decode_intra_block(), vc1_decode_p_block(), vgs_eval(), vivo_read_header(), vlc_decode_block(), vp56_rac_gets(), vp89_rac_get_uint(), vp8_ts_parse_int_array(), vpx_ts_param_parse(), write16_internal(), write32_internal(), write_keyword_value(), write_run(), write_signed(), write_simple_unsigned(), write_tag(), write_tag_int32(), write_tiff_long(), write_tiff_short(), write_unsigned(), wv_get_value_float(), wv_unpack_dsd_fast(), wv_unpack_dsd_high(), xiph_parse_fmtp_pair(), xml_print_int(), xml_print_str(), and xor_32_to_8().
Referenced by jxl_u32(), jxl_u32(), and parse_primary().