Go to the documentation of this file.
103 if (num_sign ^ den_sign)
115 return (
a.den < 0) ^ (
b.den < 0) ? -
test :
test;
116 else if (
b.den &&
a.den)
118 else if (
a.num &&
b.num)
119 return (
a.num >> 63) - (
b.num >> 63);
static av_always_inline av_uint128 av_to128u(uint64_t a)
int av_cmp_q64(AVRational64 a, AVRational64 b)
Compare two 64-bit rationals.
AVRational64 av_mul_q64(AVRational64 b, AVRational64 c)
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)
Divide one 64-bit rational by another.
AVRational64 av_sub_q64(AVRational64 b, AVRational64 c)
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 int zero(InterplayACMContext *s, unsigned ind, unsigned col)
static AVRational64 reduce64(av_int128 num, av_int128 den)
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
static av_int128 gcd128(av_int128 a, av_int128 b)
static av_always_inline AVRational64 av_inv_q64(AVRational64 q)
Invert a 64-bit rational.
AVRational64 av_add_q64(AVRational64 b, AVRational64 c)
Add two 64-bit rationals.