diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-07-15 14:06:39 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-07-15 14:06:39 +0000 |
commit | 5c07b9e914695a596874fabbe1c86b56d8afeca0 (patch) | |
tree | 586120acf93d818260f5b0b74d4efe44b391af33 /libavcodec/rational.c | |
parent | f4888b830f44349de0bb137bc913ea6193adbe9e (diff) | |
download | ffmpeg-5c07b9e914695a596874fabbe1c86b56d8afeca0.tar.gz |
more comments
Originally committed as revision 3317 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rational.c')
-rw-r--r-- | libavcodec/rational.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/rational.c b/libavcodec/rational.c index ad085653a5..7ccad9e383 100644 --- a/libavcodec/rational.c +++ b/libavcodec/rational.c @@ -31,21 +31,33 @@ #include "avcodec.h" #include "rational.h" +/** + * returns b*c. + */ AVRational av_mul_q(AVRational b, AVRational c){ av_reduce(&b.num, &b.den, b.num * (int64_t)c.num, b.den * (int64_t)c.den, INT_MAX); return b; } +/** + * returns b/c. + */ AVRational av_div_q(AVRational b, AVRational c){ av_reduce(&b.num, &b.den, b.num * (int64_t)c.den, b.den * (int64_t)c.num, INT_MAX); return b; } +/** + * returns b+c. + */ AVRational av_add_q(AVRational b, AVRational c){ av_reduce(&b.num, &b.den, b.num * (int64_t)c.den + c.num * (int64_t)b.den, b.den * (int64_t)c.den, INT_MAX); return b; } +/** + * returns b-c. + */ AVRational av_sub_q(AVRational b, AVRational c){ av_reduce(&b.num, &b.den, b.num * (int64_t)c.den - c.num * (int64_t)b.den, b.den * (int64_t)c.den, INT_MAX); return b; |