From 5c07b9e914695a596874fabbe1c86b56d8afeca0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 15 Jul 2004 14:06:39 +0000 Subject: [PATCH] more comments Originally committed as revision 3317 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/integer.c | 26 ++++++++++++++++++++++++++ libavcodec/rational.c | 12 ++++++++++++ libavcodec/rational.h | 18 +++++++++++++----- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/libavcodec/integer.c b/libavcodec/integer.c index 025560f9e8..38a826f861 100644 --- a/libavcodec/integer.c +++ b/libavcodec/integer.c @@ -47,6 +47,10 @@ AVInteger av_sub_i(AVInteger a, AVInteger b){ return a; } +/** + * returns the rounded down value of the logarithm of base 2 of the given AVInteger. + * this is simply the index of the most significant bit which is 1. Or 0 of all bits are 0 + */ int av_log2_i(AVInteger a){ int i; @@ -78,6 +82,9 @@ AVInteger av_mul_i(AVInteger a, AVInteger b){ return out; } +/** + * returns 0 if a==b, 1 if a>b and -1 if ab and -1 if a>63)|1; + else return 0; } +/** + * converts the given AVRational to a double. + */ static inline double av_q2d(AVRational a){ return a.num / (double) a.den; }