Commit abf1ce4f authored by michael's avatar michael

simplify


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3097 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 24e654d0
...@@ -776,15 +776,11 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max) ...@@ -776,15 +776,11 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max)
assert(den != 0); assert(den != 0);
if(den < 0){ if(den < 0)
den= -den; return av_reduce(dst_nom, dst_den, -nom, -den, max);
nom= -nom;
}
if(nom < 0){ sign= nom < 0;
nom= -nom; nom= ABS(nom);
sign= 1;
}
gcd = ff_gcd(nom, den); gcd = ff_gcd(nom, den);
nom /= gcd; nom /= gcd;
...@@ -814,9 +810,7 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max) ...@@ -814,9 +810,7 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max)
assert(ff_gcd(nom, den) == 1); assert(ff_gcd(nom, den) == 1);
if(sign) nom= -nom; *dst_nom = sign ? -nom : nom;
*dst_nom = nom;
*dst_den = den; *dst_den = den;
return exact; return exact;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment