00001 /* 00002 * arbitrary precision integers 00003 * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00028 #ifndef AVUTIL_INTEGER_H 00029 #define AVUTIL_INTEGER_H 00030 00031 #include <stdint.h> 00032 #include "common.h" 00033 00034 #define AV_INTEGER_SIZE 8 00035 00036 typedef struct AVInteger{ 00037 uint16_t v[AV_INTEGER_SIZE]; 00038 } AVInteger; 00039 00040 AVInteger av_add_i(AVInteger a, AVInteger b) av_const; 00041 AVInteger av_sub_i(AVInteger a, AVInteger b) av_const; 00042 00048 int av_log2_i(AVInteger a) av_const; 00049 AVInteger av_mul_i(AVInteger a, AVInteger b) av_const; 00050 00054 int av_cmp_i(AVInteger a, AVInteger b) av_const; 00055 00061 AVInteger av_shr_i(AVInteger a, int s) av_const; 00062 00067 AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b); 00068 00072 AVInteger av_div_i(AVInteger a, AVInteger b) av_const; 00073 00077 AVInteger av_int2i(int64_t a) av_const; 00078 00084 int64_t av_i2int(AVInteger a) av_const; 00085 00086 #endif /* AVUTIL_INTEGER_H */