FFmpeg
|
Replacements for frequently missing libm functions. More...
#include <math.h>
#include "config.h"
#include "attributes.h"
#include "intfloat.h"
#include "mathematics.h"
Go to the source code of this file.
Macros | |
#define | atanf(x) ((float)atan(x)) |
#define | atan2f(y, x) ((float)atan2(y, x)) |
#define | powf(x, y) ((float)pow(x, y)) |
#define | cosf(x) ((float)cos(x)) |
#define | FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) |
#define | expf(x) ((float)exp(x)) |
#define | exp2(x) exp((x) * M_LN2) |
#define | exp2f(x) ((float)exp2(x)) |
#define | isinf(x) |
#define | isnan(x) |
#define | isfinite(x) |
#define | ldexpf(x, exp) ((float)ldexp(x, exp)) |
#define | llrint(x) ((long long)rint(x)) |
#define | llrintf(x) ((long long)rint(x)) |
#define | log2(x) (log(x) * 1.44269504088896340736) |
#define | log2f(x) ((float)log2(x)) |
#define | log10f(x) ((float)log10(x)) |
#define | sinf(x) ((float)sin(x)) |
Functions | |
static av_always_inline double | cbrt (double x) |
static av_always_inline float | cbrtf (float x) |
static av_always_inline double | copysign (double x, double y) |
static double | ff_eval_poly (const double *coeff, int size, double x) |
static double | erf (double z) |
erf function Algorithm taken from the Boost project, source: http://www.boost.org/doc/libs/1_46_1/boost/math/special_functions/erf.hpp Use, modification and distribution are subject to the Boost Software License, Version 1.0 (see notice below). More... | |
static av_always_inline av_const int | avpriv_isinff (float x) |
static av_always_inline av_const int | avpriv_isinf (double x) |
static av_always_inline av_const int | avpriv_isnanf (float x) |
static av_always_inline av_const int | avpriv_isnan (double x) |
static av_always_inline av_const int | avpriv_isfinitef (float x) |
static av_always_inline av_const int | avpriv_isfinite (double x) |
static av_const double | hypot (double x, double y) |
static double | rint (double x) |
static av_always_inline av_const long int | lrint (double x) |
static av_always_inline av_const long int | lrintf (float x) |
static av_always_inline av_const double | round (double x) |
static av_always_inline av_const float | roundf (float x) |
static av_always_inline av_const double | trunc (double x) |
static av_always_inline av_const float | truncf (float x) |
Replacements for frequently missing libm functions.
Definition in file libm.h.
#define atanf | ( | x | ) | ((float)atan(x)) |
Definition at line 40 of file libm.h.
Referenced by calc_bark(), cylindrical_to_xyz(), filter_flt(), ps_tableinit(), stereographic_to_xyz(), xyz_to_cube(), and xyz_to_eac().
#define atan2f | ( | y, | |
x | |||
) | ((float)atan2(y, x)) |
Definition at line 45 of file libm.h.
Referenced by celt_calc_theta(), compute_sat_hue_metrics16(), compute_sat_hue_metrics8(), draw_spatial(), filter_2_1(), filter_5_0_side(), filter_5_1_back(), filter_5_1_side(), filter_stereo(), filter_surround(), fir_to_phase(), fisheye_to_xyz(), fov_from_dfov(), pannini_to_xyz(), perspective_to_xyz(), ps_tableinit(), stereo_transform(), upmix_7_1_5_0_side(), xyz_to_barrel(), xyz_to_barrelsplit(), xyz_to_cube(), xyz_to_cylindrical(), xyz_to_equirect(), xyz_to_fisheye(), xyz_to_hammer(), xyz_to_hequirect(), xyz_to_mercator(), xyz_to_pannini(), and xyz_to_sinusoidal().
#define powf | ( | x, | |
y | |||
) | ((float)pow(x, y)) |
Definition at line 50 of file libm.h.
Referenced by ac3_parse_header(), ac3_tables_init(), calc_input_response(), cbrtf(), decode_block(), decode_init(), decode_ppc(), fastaudio_decode(), ff_atrac_init_gain_compensation(), ff_eac3_parse_header(), filter_flt(), generate_window_func(), get_pm_factor(), get_value(), imc_decode_level_coefficients_raw(), init_pow2table(), kaiser_beta(), kelvin2rgb(), make_bands(), search_for_quantizers_twoloop(), siren_init(), smooth(), upmix_1_0(), upmix_2_1(), upmix_3_0(), upmix_3_1(), upmix_3_1_surround(), upmix_4_0(), upmix_4_1(), upmix_5_0_back(), upmix_5_1_back(), upmix_5_1_back_2_1(), upmix_5_1_back_surround(), upmix_6_0(), upmix_6_1(), upmix_7_0(), upmix_7_1(), upmix_7_1_5_0_side(), upmix_7_1_5_1(), and upmix_stereo().
#define cosf | ( | x | ) | ((float)cos(x)) |
Definition at line 78 of file libm.h.
Referenced by activate(), barrel_to_xyz(), barrelsplit_to_xyz(), calculate_rotation(), celt_exp_rotation(), color_range(), config_input(), config_props(), cylindrical_to_xyz(), dfisheye_to_xyz(), equirect_to_xyz(), equisolid_to_xyz(), ff_mdct15_init(), filter_frame(), fir_to_phase(), fisheye_to_xyz(), get_lfe(), hequirect_to_xyz(), init(), lininterp(), lsf2lsp(), mercator_to_xyz(), orthographic_to_xyz(), pannini_to_xyz(), perspective_to_xyz(), process_command(), ps_tableinit(), run_channel_fft(), set_params(), sinusoidal_to_xyz(), stereo_position(), stereo_transform(), stereographic_to_xyz(), upmix_1_0(), upmix_2_1(), upmix_3_0(), upmix_3_1(), upmix_3_1_surround(), upmix_4_0(), upmix_4_1(), upmix_5_0_back(), upmix_5_1_back(), upmix_5_1_back_2_1(), upmix_5_1_back_surround(), upmix_6_0(), upmix_6_1(), upmix_7_0(), upmix_7_1(), upmix_7_1_5_0_side(), upmix_7_1_5_1(), upmix_stereo(), xyz_to_cube(), xyz_to_hammer(), xyz_to_pannini(), and xyz_to_sinusoidal().
#define expf | ( | x | ) | ((float)exp(x)) |
Definition at line 283 of file libm.h.
Referenced by calculate_gamma(), calculate_gaussian_coeffs(), config_filter(), config_input(), config_output(), config_params(), convert_coeffs(), decode_init(), ff_fast_powf(), filter(), filter_flt(), fir_to_phase(), gaussian_for(), inv_log_scale(), load_data(), log_scale(), mercator_to_xyz(), parse_gains(), softmax_exp(), step_collect_psy_metrics(), and synth_block_fcb_acb().
Definition at line 288 of file libm.h.
Referenced by config_input(), decode_init_static(), ff_exp10(), imc_decode_level_coefficients(), init(), initFilter(), MPA_encode_init(), nelly_decode_block(), nellymoser_init_static(), and psy_3gpp_init().
#define exp2f | ( | x | ) | ((float)exp2(x)) |
Definition at line 293 of file libm.h.
Referenced by calc_reduction_3gpp(), celt_denormalize(), ff_atrac3p_init_dsp_static(), ff_exp10f(), filter_frame(), init_tables(), process_anticollapse(), and wma_lsp_to_curve_init().
#define isinf | ( | x | ) |
Definition at line 317 of file libm.h.
Referenced by eval_expr(), generate_kernel(), get_exponent_dynamic(), and hypot().
#define isnan | ( | x | ) |
Definition at line 340 of file libm.h.
Referenced by audio_decode_frame(), av_d2q(), av_expr_parse_and_eval(), clip_with_log(), compute_target_delay(), config_input(), config_output(), config_props(), decompose_zp2biquads(), double2int64str(), entry_func(), eval_expr(), eval_pts(), event_loop(), filter_frame(), final_block_filtering(), func_pts(), gain_interpolate_func(), generate_kernel(), get_qscale(), get_video_frame(), h264_metadata_handle_display_orientation(), init(), init_cscheme(), isnan_vec(), load_font_file(), main(), matroska_parse_tracks(), mov_read_tkhd(), normalize_double(), normalize_xy(), request_frame(), scale_eval_dimensions(), sdl_audio_callback(), select_frame(), set_volume(), sync_clock_to_slave(), synchronize_audio(), tansig_approx(), test(), thp_probe(), tonemap_opencl_init(), update_alpha(), update_context(), update_fontsize(), update_stat(), v360_slice(), video_refresh(), vif_statistic(), and vp_duration().
#define isfinite | ( | x | ) |
Definition at line 359 of file libm.h.
Referenced by apply_window_and_mdct(), ff_aac_search_for_tns(), ff_pnm_decode_header(), fits_decode_frame(), isfinite_array(), xyz_to_equisolid(), xyz_to_orthographic(), and xyz_to_stereographic().
Definition at line 389 of file libm.h.
Referenced by get_float().
#define llrint | ( | x | ) | ((long long)rint(x)) |
Definition at line 394 of file libm.h.
Referenced by avutil_version(), build_filter(), do_video_out(), ff_audio_mix_set_matrix(), ff_rfps_add_frame(), ff_rint64_clip(), filter_channel(), func_pts(), mpegaudio_tableinit(), mpegaudiodec_common_tableinit(), qdmc_decode_init(), read_header_openmpt(), set(), setts_filter(), setup_compress_thresh(), and write_number().
#define llrintf | ( | x | ) | ((long long)rint(x)) |
Definition at line 399 of file libm.h.
Referenced by do_video_out(), and lerp_color16().
#define log2 | ( | x | ) | (log(x) * 1.44269504088896340736) |
Definition at line 404 of file libm.h.
Referenced by calculate_visual_weight(), config_output(), decode_frame(), decode_ppc(), draw_legend(), draw_mandelbrot(), dump_fir(), encode_block(), encode_init(), filter_frame(), find_best_state(), generate_kernel(), main(), midi(), qscale2qlog(), and value_string().
#define log2f | ( | x | ) | ((float)log2(x)) |
Definition at line 409 of file libm.h.
Referenced by bit_allocation(), calc_pe_3gpp(), celt_frame_mdct(), coef2maxsf(), coef2minsf(), imc_decode_level_coefficients(), imc_decode_level_coefficients_raw(), sbr_make_f_derived(), sbr_make_f_master(), search_for_pns(), search_for_quantizers_anmr(), search_for_quantizers_fast(), search_for_quantizers_twoloop(), set_special_band_scalefactors(), and vif_statistic().
#define log10f | ( | x | ) | ((float)log10(x)) |
Definition at line 414 of file libm.h.
Referenced by compute_frame_features(), draw_legend(), ff_amr_set_fixed_gain(), ff_sipr_decode_frame_16k(), and get_value().
#define sinf | ( | x | ) | ((float)sin(x)) |
Definition at line 419 of file libm.h.
Referenced by activate(), atrac9_decode_init(), barrel_to_xyz(), barrelsplit_to_xyz(), calculate_lanczos_coeffs(), calculate_rotation(), celt_exp_rotation(), color_range(), config_input(), cylindrical_to_xyz(), dfisheye_to_xyz(), draw_mandelbrot(), equirect_to_xyz(), equisolid_to_xyz(), ff_mdct15_init(), ff_sine_window_init(), filter_flt(), filter_fltp(), fir_to_phase(), fisheye_to_xyz(), fov_from_dfov(), frand(), hequirect_to_xyz(), hn_lpf(), lininterp(), make_lpf(), mercator_to_xyz(), pannini_to_xyz(), perspective_to_xyz(), prepare_equisolid_in(), prepare_equisolid_out(), prepare_orthographic_in(), prepare_orthographic_out(), ps_tableinit(), run_channel_fft(), set_params(), sine_window_init_fixed(), sinusoidal_to_xyz(), siren_init(), stereo_transform(), stereographic_to_xyz(), upmix_1_0(), upmix_2_1(), upmix_3_0(), upmix_3_1(), upmix_3_1_surround(), upmix_4_0(), upmix_4_1(), upmix_5_0_back(), upmix_5_1_back(), upmix_5_1_back_2_1(), upmix_5_1_back_surround(), upmix_6_0(), upmix_6_1(), upmix_7_0(), upmix_7_1(), upmix_7_1_5_0_side(), upmix_7_1_5_1(), upmix_stereo(), xyz_to_equisolid(), xyz_to_hammer(), xyz_to_orthographic(), and xyz_to_pannini().
|
static |
|
static |
Definition at line 61 of file libm.h.
Referenced by calculate_gamma(), decode_spectrum_and_dequant(), draw_spatial(), filter_frame(), get_cm_factor(), get_value(), and quantize_and_encode_band_cost_template().
|
static |
Definition at line 68 of file libm.h.
Referenced by copysignl(), decfloat(), hexfloat(), and perform_compression().
|
inlinestatic |
|
inlinestatic |
erf function Algorithm taken from the Boost project, source: http://www.boost.org/doc/libs/1_46_1/boost/math/special_functions/erf.hpp Use, modification and distribution are subject to the Boost Software License, Version 1.0 (see notice below).
Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 121 of file libm.h.
Referenced by bound(), ff_aac_adjust_common_pred(), and filter_dbl().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
Definition at line 366 of file libm.h.
Referenced by av_display_rotation_get(), check_stability(), compute_sat_hue_metrics16(), compute_sat_hue_metrics8(), config_output(), config_props(), decompose_transform(), decompose_zp2biquads(), distance(), draw_curves(), draw_response(), eval_expr(), freq_gain(), get_natural_factor(), get_response(), h264_metadata_handle_display_orientation(), mov_read_tkhd(), oscilloscope_config_input(), parse_points(), ps_tableinit(), ring2_test(), update_oscilloscope(), vectorscope16(), vectorscope8(), and video_audio_display().
|
inlinestatic |
|
static |
|
static |
|
static |
Definition at line 444 of file libm.h.
Referenced by aom_init(), apply_dependent_coupling_fixed(), apply_independent_coupling_fixed(), autocorr_calc(), combine_residual_frame(), comparef(), config_input(), dequant(), encode_init(), eval_expr(), ff_dnn_execute_layer_math_unary(), ff_merge_channel_layouts(), filter_frame(), frame_size(), get_expected(), get_rotation(), hevc_idct_32x32_msa(), imdct_half_32(), imdct_half_64(), mov_write_sidx_tags(), noise_scale(), ps_tableinit(), ransac_update_num_iters(), read_global_param(), sbr_hf_apply_noise(), sbr_hf_assemble(), sbr_hf_inverse_filter(), sbr_sum_square_c(), scale_coefs(), sls_flags_filename_process(), subband_scale(), update_fontsize(), and vector_fmul_window_scaled_c().
|
static |
Definition at line 451 of file libm.h.
Referenced by bitreduction(), search_for_pns(), set_special_band_scalefactors(), and xvid_correct_framerate().
|
static |
|
static |