28 #ifndef AVUTIL_RATIONAL_H
29 #define AVUTIL_RATIONAL_H
69 if(tmp)
return (
int)((tmp ^ a.
den ^ b.
den)>>63)|1;
70 else if(b.
den && a.
den)
return 0;
71 else if(a.
num && b.
num)
return (a.
num>>31) - (b.
num>>31);
81 return a.
num / (double) a.
den;
94 int av_reduce(
int *dst_num,
int *dst_den, int64_t num, int64_t den, int64_t max);
uint32_t av_q2intfloat(AVRational q)
Converts a AVRational to a IEEE 32bit float.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
static const uint8_t q1[256]
static AVRational av_make_q(int num, int den)
Create a rational.
Macro definitions for various function/variable attributes.
static double av_q2d(AVRational a)
Convert rational to double.
AVRational av_mul_q(AVRational b, AVRational c) av_const
Multiply two rationals.
AVRational av_add_q(AVRational b, AVRational c) av_const
Add two rationals.
int av_nearer_q(AVRational q, AVRational q1, AVRational q2)
AVRational av_div_q(AVRational b, AVRational c) av_const
Divide one rational by another.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
AVRational av_sub_q(AVRational b, AVRational c) av_const
Subtract one rational from another.
AVRational av_d2q(double d, int max) av_const
Convert a double precision floating point number to a rational.
int av_find_nearest_q_idx(AVRational q, const AVRational *q_list)
Find the nearest value in q_list to q.
rational number numerator/denominator
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.