Definition in file rational.c.
Go to the source code of this file.
Functions | |
| 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. | |
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(), MPEG2fixup::BuildFrame(), 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_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().
| 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 mpeg_decode_postinit().
| 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().
| 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.
| 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(), nuv_header(), and thp_read_header().
1.5.5