#include <stdint.h>
#include <math.h>
#include "common.h"
#include "rational.h"
Go to the source code of this file.
Defines | |
#define | M_E 2.7182818284590452354 |
#define | M_LN2 0.69314718055994530942 |
#define | M_LN10 2.30258509299404568402 |
#define | M_PI 3.14159265358979323846 |
#define | M_SQRT1_2 0.70710678118654752440 |
Enumerations | |
enum | AVRounding { AV_ROUND_ZERO = 0, AV_ROUND_INF = 1, AV_ROUND_DOWN = 2, AV_ROUND_UP = 3, AV_ROUND_NEAR_INF = 5 } |
Functions | |
int64_t av_const | av_gcd (int64_t a, int64_t b) |
int64_t | av_rescale (int64_t a, int64_t b, int64_t c) av_const |
Rescales a 64-bit integer with rounding to nearest. | |
int64_t | av_rescale_rnd (int64_t a, int64_t b, int64_t c, enum AVRounding) av_const |
Rescales a 64-bit integer with specified rounding. | |
int64_t | av_rescale_q (int64_t a, AVRational bq, AVRational cq) av_const |
Rescales a 64-bit integer by 2 rational numbers. |
#define M_E 2.7182818284590452354 |
#define M_LN10 2.30258509299404568402 |
#define M_LN2 0.69314718055994530942 |
#define M_PI 3.14159265358979323846 |
Definition at line 39 of file mathematics.h.
Referenced by AC3_encode_init(), audio_encode_example(), av_build_filter(), build_basis(), decode_init(), eval_expr(), ff_fft_init(), ff_iir_filter_init_coeffs(), ff_kbd_window_init(), ff_mdct_init(), ff_rdft_init(), ff_ref_dct_init(), ff_sine_window_init(), fft_init(), fft_ref_init(), get_qscale(), idct248_ref(), imc_decode_init(), imdct_ref(), init_atrac3_transforms(), lsp2polyf(), mdct_ref(), open_audio(), Process(), qdm2_fft_generate_tone(), qdm2_fft_tone_synthesizer(), vorbis_floor0_decode(), and wma_lsp_to_curve_init().
#define M_SQRT1_2 0.70710678118654752440 |
Definition at line 42 of file mathematics.h.
Referenced by dca_subsubframe(), and nelly_decode_block().
enum AVRounding |
Definition at line 45 of file mathematics.h.
int64_t av_const av_gcd | ( | int64_t | a, | |
int64_t | b | |||
) |
Definition at line 53 of file mathematics.c.
Referenced by av_find_stream_info(), av_gcd(), av_reduce(), av_set_pts_info(), avcodec_string(), decode_main_header(), dump_stream_format(), ff_gcd(), ff_parse_specific_params(), h263_decode_picture_header(), mov_read_ctts(), mov_read_elst(), mov_read_stts(), MPV_encode_init(), and xvid_correct_framerate().
int64_t av_rescale | ( | int64_t | a, | |
int64_t | b, | |||
int64_t | c | |||
) | const |
Rescales a 64-bit integer with rounding to nearest.
A simple a*b/c isn't possible as it can overflow.
Definition at line 116 of file mathematics.c.
Referenced by asf_build_simple_index(), av_estimate_timings_from_bit_rate(), av_gen_search(), av_seek_frame(), av_update_cur_dts(), avi_read_header(), avi_read_packet(), avi_read_seek(), compute_pkt_fields(), compute_pkt_fields2(), dc1394_read_common(), dump_format(), finalize_packet(), mov_read_packet(), mov_read_trak(), mpeg_mux_write_packet(), mpegts_write_packet(), mxf_read_seek(), nsv_parse_NSVs_header(), output_packet(), and r3d_read_reda().
int64_t av_rescale_q | ( | int64_t | a, | |
AVRational | bq, | |||
AVRational | cq | |||
) | const |
Rescales a 64-bit integer by 2 rational numbers.
Definition at line 120 of file mathematics.c.
Referenced by av_encode(), av_find_stream_info(), av_update_stream_timings(), compute_chapters_end(), decode_thread(), do_audio_out(), do_subtitle_out(), do_video_out(), dv_extract_video_info(), dv_offset_reset(), dv_read_header(), ff_interleave_new_audio_packet(), fill_all_stream_timings(), http_prepare_data(), main(), mov_read_seek(), mp3_parse_vbr_tags(), ogg_compare_granule(), oggvorbis_encode_frame(), output_packet(), rl2_read_seek(), rtcp_send_sr(), rtp_write_header(), rtsp_read_seek(), write_audio_frame(), and write_video_frame().
int64_t av_rescale_rnd | ( | int64_t | a, | |
int64_t | b, | |||
int64_t | c, | |||
enum | AVRounding | |||
) | const |
Rescales a 64-bit integer with specified rounding.
A simple a*b/c isn't possible as it can overflow.
Definition at line 64 of file mathematics.c.
Referenced by av_nearer_q(), av_rescale(), av_rescale_q(), av_rescale_rnd(), dv_write_pack(), ff_nut_reset_ts(), gxf_write_media_preamble(), mov_write_edts_tag(), mov_write_mvhd_tag(), mov_write_tkhd_tag(), rtp_write_header(), and write_packet().