Definition in file rational.h.
Go to the source code of this file.
Classes | |
| 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. | |
| 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 aspect_to_info().
| 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 av_find_stream_info(), decode_syncpoint(), dump_stream_format(), dv_write_pack(), ff_rate_control_init(), ff_rate_estimate_qscale(), ff_vbv_update(), flv_write_header(), getFileInfo(), AvFormatDecoder::GetFrame(), grab_read_header(), grabThumbnail(), AvFormatDecoder::H264PreProcessPkt(), init_pass2(), ThumbFinder::initAVCodec(), AvFormatDecoder::InitVideoCodec(), modify_qscale(), mov_write_tkhd_tag(), mpeg1_encode_sequence_header(), MPV_encode_init(), normalized_fps(), read_seek(), thp_read_header(), v4l2_read_header(), write_header(), x11grab_read_header(), and x11grab_read_packet().
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