Lines Matching defs:num
37 int64_t num, int64_t den, int64_t max)
40 int sign = (num < 0) ^ (den < 0);
41 int64_t gcd = av_gcd(FFABS(num), FFABS(den));
44 num = FFABS(num) / gcd;
47 if (num <= max && den <= max) {
48 a1 = (AVRational) { num, den };
53 uint64_t x = num / den;
54 int64_t next_den = num - den * x;
55 int64_t a2n = x * a1.num + a0.num;
59 if (a1.num) x = (max - a0.num) / a1.num;
62 if (den * (2 * x * a1.den + a0.den) > num * a1.den)
63 a1 = (AVRational) { x * a1.num + a0.num, x * a1.den + a0.den };
69 num = den;
72 av_assert2(av_gcd(a1.num, a1.den) <= 1U);
74 *dst_num = sign ? -a1.num : a1.num;
82 av_reduce(&b.num, &b.den,
83 b.num * (int64_t) c.num,
90 return av_mul_q(b, (AVRational) { c.den, c.num });
94 av_reduce(&b.num, &b.den,
95 b.num * (int64_t) c.den +
96 c.num * (int64_t) b.den,
103 return av_add_q(b, (AVRational) { -c.num, c.den });
118 av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
126 int64_t a = q1.num * (int64_t)q2.den + q2.num * (int64_t)q1.den;
135 return ((x_up > q.num) - (x_down < q.num)) * av_cmp_q(q2, q1);
152 for (a.num = -2; a.num <= 2; a.num++) {
154 for (b.num = -2; b.num <= 2; b.num++) {
163 av_log(0, AV_LOG_ERROR, "%d/%d %d/%d, %d %f\n", a.num,
164 a.den, b.num, b.den, c,d);