#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | AVRational |
Rational number num/den. More... | |
Functions | |
static int | av_cmp_q (AVRational a, AVRational b) |
Compare two rationals. | |
static double | av_q2d (AVRational a) |
Rational to double conversion. | |
int | av_reduce (int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max) |
Reduce a fraction. | |
AVRational | av_mul_q (AVRational b, AVRational c) |
Multiplies two rationals. | |
AVRational | av_div_q (AVRational b, AVRational c) |
Divides one rational by another. | |
AVRational | av_add_q (AVRational b, AVRational c) |
Adds two rationals. | |
AVRational | av_sub_q (AVRational b, AVRational c) |
Subtracts one rational from another. | |
AVRational | av_d2q (double d, int max) |
Converts a double precision floating point number to a rational. |
Definition in file rational.h.
AVRational av_add_q | ( | AVRational | b, | |
AVRational | c | |||
) |
Adds two rationals.
b | first rational. | |
c | second rational. |
Definition at line 86 of file rational.c.
Referenced by av_sub_q().
static int av_cmp_q | ( | AVRational | a, | |
AVRational | b | |||
) | [inline, static] |
Compare two rationals.
a | first rational | |
b | second rational |
Definition at line 47 of file rational.h.
Referenced by new_video_stream().
AVRational av_d2q | ( | double | d, | |
int | max | |||
) |
Converts a double precision floating point number to a rational.
d | double to convert | |
max | the maximum allowed numerator and denominator |
Definition at line 95 of file rational.c.
Referenced by av_get_q(), av_opt_set_defaults2(), av_parse_video_frame_rate(), av_set_number(), mpeg_decode_postinit(), new_video_stream(), nuv_header(), and thp_read_header().
AVRational av_div_q | ( | AVRational | b, | |
AVRational | c | |||
) |
Divides one rational by another.
b | first rational. | |
c | second rational. |
Definition at line 82 of file rational.c.
Referenced by avi_read_header(), and mpeg_decode_postinit().
AVRational av_mul_q | ( | AVRational | b, | |
AVRational | c | |||
) |
Multiplies two rationals.
b | first rational. | |
c | second rational. |
Definition at line 77 of file rational.c.
Referenced by av_div_q(), and mkv_write_tracks().
static double av_q2d | ( | AVRational | a | ) | [inline, static] |
Rational to double conversion.
a | rational to convert |
Definition at line 59 of file rational.h.
Referenced by audio_decode_frame(), av_encode(), av_find_stream_info(), 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(), modify_qscale(), mov_write_tkhd_tag(), mpeg1_encode_sequence_header(), MPV_encode_init(), 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_nom, | |
int * | dst_den, | |||
int64_t | nom, | |||
int64_t | den, | |||
int64_t | max | |||
) |
Reduce a fraction.
This is useful for framerate calculations.
dst_nom | destination numerator | |
dst_den | destination denominator | |
nom | source numerator | |
den | source denominator | |
max | the maximum allowed for dst_nom & dst_den |
Definition at line 35 of file rational.c.
Referenced by asf_read_header(), av_add_q(), av_d2q(), av_find_stream_info(), av_mul_q(), avcodec_string(), decode_slice_header(), dxa_read_header(), matroska_read_header(), mpeg_decode_postinit(), smacker_read_header(), vmd_read_header(), yuv4_generate_header(), and yuv4_read_header().
AVRational av_sub_q | ( | AVRational | b, | |
AVRational | c | |||
) |
Subtracts one rational from another.
b | first rational. | |
c | second rational. |
Definition at line 91 of file rational.c.
Referenced by new_video_stream().