avutil/mathematics/av_add_stable: check for the common case of inc=1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
5b7519fbaa
commit
4956d0e5a6
@ -188,6 +188,7 @@ simple_round:
|
|||||||
|
|
||||||
int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
|
int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
|
||||||
{
|
{
|
||||||
|
if (inc != 1)
|
||||||
inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});
|
inc_tb = av_mul_q(inc_tb, (AVRational) {inc, 1});
|
||||||
|
|
||||||
if (av_cmp_q(inc_tb, ts_tb) < 0) {
|
if (av_cmp_q(inc_tb, ts_tb) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user