]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
move doxy comments from rational.c to rational.h and add some new comments
authorgpoirier <gpoirier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 26 Feb 2007 14:27:29 +0000 (14:27 +0000)
committergpoirier <gpoirier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 26 Feb 2007 14:27:29 +0000 (14:27 +0000)
patch by Dujardin Bernard %dujardin P iut A numericable P fr%

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8132 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavutil/rational.c
libavutil/rational.h

index 0480aa882f1e449d16639368469389f5b16d205e..ac0c9d371452c241ffffd3c3bb622495fceb196b 100644 (file)
@@ -75,40 +75,24 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max)
     return den==0;
 }
 
-/**
- * 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){
     return av_mul_q(b, (AVRational){c.den, c.num});
 }
 
-/**
- * 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){
     return av_add_q(b, (AVRational){-c.num, c.den});
 }
 
-/**
- * Converts a double precission floating point number to a AVRational.
- * @param max the maximum allowed numerator and denominator
- */
 AVRational av_d2q(double d, int max){
     AVRational a;
 #define LOG2  0.69314718055994530941723212145817656807550013436025
index c915e36c0726c6c90cb88d4186e3b2aead16c06b..df6643ec861be5fc85f7f022573d7d9fbdded739 100644 (file)
@@ -51,7 +51,7 @@ static inline int av_cmp_q(AVRational a, AVRational b){
 }
 
 /**
- * Rational to double conversion
+ * Rational to double conversion.
  * @param a rational to convert
  * @return (double) a
  */
@@ -71,10 +71,44 @@ static inline double av_q2d(AVRational a){
  */
 int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
 
+/**
+ * Multiplies two rationals.
+ * @param b first rational.
+ * @param c second rational.
+ * @return b*c.
+ */
 AVRational av_mul_q(AVRational b, AVRational c);
+
+/**
+ * Divides two rationals.
+ * @param b first rational.
+ * @param c second rational.
+ * @return b/c.
+ */
 AVRational av_div_q(AVRational b, AVRational c);
+
+/**
+ * Adds two rationals.
+ * @param b first rational.
+ * @param c second rational.
+ * @return b+c.
+ */
 AVRational av_add_q(AVRational b, AVRational c);
+
+/**
+ * Substracts two rationals.
+ * @param b first rational.
+ * @param c second rational.
+ * returns b-c.
+ */
 AVRational av_sub_q(AVRational b, AVRational c);
+
+/**
+ * Converts a double precision floating point number to a rational.
+ * @param d double to convert
+ * @param max the maximum allowed numerator and denominator
+ * @return (AVRational) d.
+ */
 AVRational av_d2q(double d, int max);
 
 #endif // RATIONAL_H