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 FFMPEG_INTEGER_H 00029 #define FFMPEG_INTEGER_H 00030 00031 #include <stdint.h> 00032 00033 #define AV_INTEGER_SIZE 8 00034 00035 typedef struct AVInteger{ 00036 uint16_t v[AV_INTEGER_SIZE]; 00037 } AVInteger; 00038 00039 AVInteger av_add_i(AVInteger a, AVInteger b); 00040 AVInteger av_sub_i(AVInteger a, AVInteger b); 00041 00046 int av_log2_i(AVInteger a); 00047 AVInteger av_mul_i(AVInteger a, AVInteger b); 00048 00052 int av_cmp_i(AVInteger a, AVInteger b); 00053 00058 AVInteger av_shr_i(AVInteger a, int s); 00059 00064 AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b); 00065 00069 AVInteger av_div_i(AVInteger a, AVInteger b); 00070 00074 AVInteger av_int2i(int64_t a); 00075 00081 int64_t av_i2int(AVInteger a); 00082 00083 #endif /* FFMPEG_INTEGER_H */