X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Finteger.h;h=d4d0201db4f9131c5d06cd3497fc9a14222e3b06;hb=382cb1154c0f7f5a55e715c154af876364e7205f;hp=6680e79ac33c8cd6ed850b25bf1a389fbcaf3fa6;hpb=37b2f1d07354e7871cf720aceaf8fdfae9d66573;p=ffmpeg diff --git a/libavutil/integer.h b/libavutil/integer.h index 6680e79ac33..d4d0201db4f 100644 --- a/libavutil/integer.h +++ b/libavutil/integer.h @@ -17,17 +17,19 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * */ /** - * @file integer.h + * @file libavutil/integer.h * arbitrary precision integers * @author Michael Niedermayer */ -#ifndef INTEGER_H -#define INTEGER_H +#ifndef AVUTIL_INTEGER_H +#define AVUTIL_INTEGER_H + +#include +#include "common.h" #define AV_INTEGER_SIZE 8 @@ -35,43 +37,50 @@ typedef struct AVInteger{ uint16_t v[AV_INTEGER_SIZE]; } AVInteger; -AVInteger av_add_i(AVInteger a, AVInteger b); -AVInteger av_sub_i(AVInteger a, AVInteger b); -int av_log2_i(AVInteger a); -AVInteger av_mul_i(AVInteger a, AVInteger b); +AVInteger av_add_i(AVInteger a, AVInteger b) av_const; +AVInteger av_sub_i(AVInteger a, AVInteger b) av_const; + +/** + * Returns the rounded-down value of the base 2 logarithm of the given + * AVInteger. This is simply the index of the most significant bit + * which is 1, or 0 if all bits are 0. + */ +int av_log2_i(AVInteger a) av_const; +AVInteger av_mul_i(AVInteger a, AVInteger b) av_const; /** - * returns 0 if a==b, 1 if a>b and -1 if ab and -1 if a