1#ifndef MYTH_AV_RATIONAL_H
2#define MYTH_AV_RATIONAL_H
6#include "libavutil/rational.h"
34 return (base *
m_q.num) /
m_q.den;
39 return QStringLiteral(
"%1/%2").arg(QString::number(
m_q.num), QString::number(
m_q.den));
49 return reduce(max, ignore);
54 exact = av_reduce(&q.
m_q.num, &q.
m_q.den,
m_q.num,
m_q.den, max);
66 AVRational
m_q {.num = 0, .den = 1};
C++ wrapper for FFmpeg libavutil AVRational.
MythAVRational reduce(int64_t max) const
static int cmp(MythAVRational a, MythAVRational b)
long long toFixed(long long base) const
Convert the rational number to fixed point.
static MythAVRational fromDouble(double d, int64_t max)
Convert a double to a MythAVRational.
MythAVRational & operator/=(MythAVRational rhs)
MythAVRational & operator-=(MythAVRational rhs)
MythAVRational reduce(int64_t max, bool &exact) const
MythAVRational & operator*=(MythAVRational rhs)
MythAVRational(int n=0, int d=1)
MythAVRational(AVRational q)
MythAVRational & operator+=(MythAVRational rhs)
MythAVRational invert() const
static const iso6937table * d
bool operator<(MythAVRational lhs, MythAVRational rhs)
bool operator==(MythAVRational lhs, MythAVRational rhs)
MythAVRational operator/(MythAVRational lhs, MythAVRational rhs)
bool operator<=(MythAVRational lhs, MythAVRational rhs)
MythAVRational operator+(MythAVRational lhs, MythAVRational rhs)
bool operator>(MythAVRational lhs, MythAVRational rhs)
MythAVRational operator*(MythAVRational lhs, MythAVRational rhs)
bool operator!=(MythAVRational lhs, MythAVRational rhs)
MythAVRational operator-(MythAVRational lhs, MythAVRational rhs)
bool operator>=(MythAVRational lhs, MythAVRational rhs)