summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/rational.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2005-04-19 05:16:45 +0000
committerMike Melanson <mike@multimedia.cx>2005-04-19 05:16:45 +0000
commit97c50cb77949856573d7f5f5a3c28cb73e61e011 (patch)
tree2dbabcbb9009b09d66789498ce1d2451a4b39bc0 /src/libffmpeg/libavcodec/rational.c
parent19e7199dad84489aa49e3b2dd5c0e45657ec0fb8 (diff)
downloadxine-lib-97c50cb77949856573d7f5f5a3c28cb73e61e011.tar.gz
xine-lib-97c50cb77949856573d7f5f5a3c28cb73e61e011.tar.bz2
sync to FFmpeg build 4752
CVS patchset: 7463 CVS date: 2005/04/19 05:16:45
Diffstat (limited to 'src/libffmpeg/libavcodec/rational.c')
-rw-r--r--src/libffmpeg/libavcodec/rational.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libffmpeg/libavcodec/rational.c b/src/libffmpeg/libavcodec/rational.c
index ad085653a..7ccad9e38 100644
--- a/src/libffmpeg/libavcodec/rational.c
+++ b/src/libffmpeg/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;