#include <stdint.h>
#include "common.h"
Go to the source code of this file.
Data Structures | |
struct | AVRational |
rational number numerator/denominator More... | |
Functions | |
static int | av_cmp_q (AVRational a, AVRational b) |
Compares two rationals. | |
static double | av_q2d (AVRational a) |
Converts rational to double. | |
int | av_reduce (int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max) |
Reduces a fraction. | |
AVRational | av_mul_q (AVRational b, AVRational c) av_const |
Multiplies two rationals. | |
AVRational | av_div_q (AVRational b, AVRational c) av_const |
Divides one rational by another. | |
AVRational | av_add_q (AVRational b, AVRational c) av_const |
Adds two rationals. | |
AVRational | av_sub_q (AVRational b, AVRational c) av_const |
Subtracts one rational from another. | |
AVRational | av_d2q (double d, int max) av_const |
Converts a double precision floating point number to a rational. | |
int | av_nearer_q (AVRational q, AVRational q1, AVRational q2) |
int | av_find_nearest_q_idx (AVRational q, const AVRational *q_list) |
Finds the nearest value in q_list to q . |
Definition in file rational.h.
AVRational av_add_q | ( | AVRational | b, | |
AVRational | c | |||
) | const |
Adds two rationals.
b | first rational | |
c | second rational |
Definition at line 87 of file rational.c.
Referenced by av_sub_q().
static int av_cmp_q | ( | AVRational | a, | |
AVRational | b | |||
) | [inline, static] |
Compares two rationals.
a | first rational | |
b | second rational |
Definition at line 48 of file rational.h.
Referenced by av_nearer_q(), av_write_header(), compute_chapters_end(), and dump_stream_format().
AVRational av_d2q | ( | double | d, | |
int | max | |||
) | const |
Converts a double precision floating point number to a rational.
d | double to convert | |
max | the maximum allowed numerator and denominator |
Definition at line 96 of file rational.c.
Referenced by av_get_q(), av_opt_set_defaults2(), av_parse_video_frame_rate(), av_set_number2(), mov_read_tkhd(), mpeg_decode_postinit(), new_video_stream(), nuv_header(), and thp_read_header().
AVRational av_div_q | ( | AVRational | b, | |
AVRational | c | |||
) | const |
Divides one rational by another.
b | first rational | |
c | second rational |
Definition at line 83 of file rational.c.
Referenced by avi_read_header(), and mpeg_decode_postinit().
int av_find_nearest_q_idx | ( | AVRational | q, | |
const AVRational * | q_list | |||
) |
Finds the nearest value in q_list
to q
.
q_list | an array of rationals terminated by {0, 0} |
Definition at line 121 of file rational.c.
Referenced by new_video_stream().
AVRational av_mul_q | ( | AVRational | b, | |
AVRational | c | |||
) | const |
Multiplies two rationals.
b | first rational | |
c | second rational |
Definition at line 78 of file rational.c.
Referenced by av_div_q(), and avi_write_header().
int av_nearer_q | ( | AVRational | q, | |
AVRational | q1, | |||
AVRational | q2 | |||
) |
q
than q2
, -1 if q2
is nearer than q1
, 0 if they have the same distance. Definition at line 106 of file rational.c.
Referenced by av_find_nearest_q_idx().
static double av_q2d | ( | AVRational | a | ) | [inline, static] |
Converts rational to double.
a | rational to convert |
Definition at line 60 of file rational.h.
Referenced by audio_decode_frame(), av_encode(), av_find_stream_info(), avi_write_header(), decode_syncpoint(), do_video_out(), do_video_stats(), dump_stream_format(), dv_write_pack(), ff_rate_control_init(), ff_rate_estimate_qscale(), ff_vbv_update(), flv_write_header(), grab_read_header(), init_pass2(), main(), mkv_write_tracks(), modify_qscale(), mov_write_tkhd_tag(), mpeg1_encode_sequence_header(), MPV_encode_init(), mxf_write_header(), opt_input_file(), output_picture2(), print_report(), read_seek(), subtitle_thread(), thp_read_header(), v4l2_read_header(), video_image_display(), video_thread(), write_header(), x11grab_read_header(), and x11grab_read_packet().
int av_reduce | ( | int * | dst_num, | |
int * | dst_den, | |||
int64_t | num, | |||
int64_t | den, | |||
int64_t | max | |||
) |
Reduces a fraction.
This is useful for framerate calculations.
dst_num | destination numerator | |
dst_den | destination denominator | |
num | source numerator | |
den | source denominator | |
max | the maximum allowed for dst_num & dst_den |
Definition at line 36 of file rational.c.
Referenced by asf_read_header(), av_add_q(), av_d2q(), av_find_stream_info(), av_mul_q(), av_resample_init(), avcodec_string(), avi_write_header(), decode_slice_header(), dump_stream_format(), dxa_read_header(), matroska_read_header(), mpeg_decode_postinit(), mxf_parse_mpeg2_frame(), read_fps(), smacker_read_header(), vmd_read_header(), and yuv4_read_header().
AVRational av_sub_q | ( | AVRational | b, | |
AVRational | c | |||
) | const |
Subtracts one rational from another.
b | first rational | |
c | second rational |
Definition at line 92 of file rational.c.