Go to the documentation of this file.
29 static const int64_t numlist[] = {
30 INT64_MIN, INT64_MIN+1, INT64_MAX, INT32_MIN, INT32_MAX, 1,0,-1,
31 123456789, INT32_MAX-1, INT32_MAX+1LL, UINT32_MAX-1, UINT32_MAX, UINT32_MAX+1LL
34 for (
a.num = -2;
a.num <= 2;
a.num++) {
35 for (
a.den = -2;
a.den <= 2;
a.den++) {
36 for (
b.num = -2;
b.num <= 2;
b.num++) {
37 for (
b.den = -2;
b.den <= 2;
b.den++) {
42 else if (
d < 0)
d = -1;
43 else if (
d !=
d)
d = INT_MIN;
46 a.den,
b.num,
b.den,
c,
d);
48 if(
b.den && (
r.num*
a.den !=
a.num*
r.den || !
r.num != !
a.num || !
r.den != !
a.den))
90 for (
a.num = 1;
a.num <= 10;
a.num++) {
91 for (
a.den = 1;
a.den <= 10;
a.den++) {
94 for (
b.num = 1;
b.num <= 10;
b.num++) {
95 for (
b.den = 1;
b.den <= 10;
b.den++) {
101 for (start = 0; start < 10 ; start++) {
105 for (
i = 0;
i<100;
i++) {
110 a.den,
b.num,
b.den,
acc, exact);
120 for (
a.den = 1;
a.den < 0x100000000U/3;
a.den*=3) {
121 for (
a.num = -1;
a.num < (1<<27);
a.num += 1 +
a.num/100) {
int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
Add a value to a timestamp.
@ AV_ROUND_ZERO
Round toward zero.
AVRational av_sub_q(AVRational b, AVRational c)
Subtract one rational from another.
int64_t av_i2int(AVInteger a)
Convert the given AVInteger to an int64_t.
int64_t av_gcd(int64_t a, int64_t b)
Compute the greatest common divisor of two integer operands.
uint32_t av_q2intfloat(AVRational q)
Convert an AVRational to a IEEE 32-bit float expressed in fixed-point format.
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
AVInteger av_int2i(int64_t a)
Convert the given int64_t to an AVInteger.
int av_cmp_i(AVInteger a, AVInteger b)
Return 0 if a==b, 1 if a>b and -1 if a<b.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static __device__ float fabs(float a)
Rational number (pair of numerator and denominator).
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
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
AVInteger av_mul_i(AVInteger a, AVInteger b)
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
#define i(width, name, range_min, range_max)
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
AVInteger av_div_i(AVInteger a, AVInteger b)
Return a/b.
AVRational av_add_q(AVRational b, AVRational c)
Add two rationals.