2 * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 AV_ROUND_ZERO = 0, ///< round toward zero
26 AV_ROUND_INF = 1, ///< round away from zero
27 AV_ROUND_DOWN = 2, ///< round toward -infinity
28 AV_ROUND_UP = 3, ///< round toward +infinity
29 AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
33 * rescale a 64bit integer with rounding to nearest.
34 * a simple a*b/c isn't possible as it can overflow
36 int64_t av_rescale(int64_t a, int64_t b, int64_t c);
39 * rescale a 64bit integer with specified rounding.
40 * a simple a*b/c isn't possible as it can overflow
42 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
45 * rescale a 64bit integer by 2 rational numbers.
47 int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq);
49 #endif /* MATHEMATICS_H */