Go to the documentation of this file.
30 #ifndef SWSCALE_RATIONAL64_H
31 #define SWSCALE_RATIONAL64_H
AVRational64 av_gcd_q64(AVRational64 a, AVRational64 b, int max_den, AVRational64 def)
Return the best rational so that a and b are multiple of it.
int av_cmp_q64(AVRational64 a, AVRational64 b)
Compare two 64-bit rationals.
AVRational64 av_mul_q64(AVRational64 b, AVRational64 c) av_const
Multiply two 64-bit rationals.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
AVRational64 av_div_q64(AVRational64 b, AVRational64 c) av_const
Divide one 64-bit rational by another.
AVRational64 av_sub_q64(AVRational64 b, AVRational64 c) av_const
Subtract one 64-bit rational from another.
64-bit Rational number (pair of numerator and denominator).
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static double av_q2d_64(AVRational64 a)
Convert an AVRational64 to a double.
static AVRational64 av_make_q64(int64_t num, int64_t den)
Create an AVRational64.
static av_always_inline AVRational64 av_inv_q64(AVRational64 q)
Invert a 64-bit rational.
AVRational64 av_add_q64(AVRational64 b, AVRational64 c) av_const
Add two 64-bit rationals.