ffmpeg.libavutil.rational

@file @ingroup lavu_math_rational Utilties for rational number calculation. @author Michael Niedermayer <michaelni@gmx.at>

Members

Functions

av_add_q
AVRational av_add_q(AVRational b, AVRational c)

Add two rationals. @param b First rational @param c Second rational @return b+c

av_cmp_q
int av_cmp_q(AVRational a, AVRational b)

Compare two rationals.

av_d2q
AVRational av_d2q(double d, int max)

Convert a double precision floating point number to a rational.

av_div_q
AVRational av_div_q(AVRational b, AVRational c)

Divide one rational by another. @param b First rational @param c Second rational @return b/c

av_find_nearest_q_idx
int av_find_nearest_q_idx(AVRational q, const(AVRational)* q_list)

Find the value in a list of rationals nearest a given reference rational.

av_inv_q
AVRational av_inv_q(AVRational q)

Invert a rational. @param q value @return 1 / q

av_make_q
AVRational av_make_q(int num, int den)

Create an AVRational.

av_mul_q
AVRational av_mul_q(AVRational b, AVRational c)

Multiply two rationals. @param b First rational @param c Second rational @return b*c

av_nearer_q
int av_nearer_q(AVRational q, AVRational q1, AVRational q2)

Find which of the two rationals is closer to another rational.

av_q2d
double av_q2d(AVRational a)

Convert an AVRational to a double. @param a AVRational to convert @return a in floating-point form @see av_d2q()

av_q2intfloat
uint av_q2intfloat(AVRational q)

Convert an AVRational to a IEEE 32-bit float expressed in fixed-point format.

av_reduce
int av_reduce(int* dst_num, int* dst_den, long num, long den, long max)

Reduce a fraction.

av_sub_q
AVRational av_sub_q(AVRational b, AVRational c)

Subtract one rational from another. @param b First rational @param c Second rational @return b-c

Structs

AVRational
struct AVRational

Rational number (pair of numerator and denominator).

Meta