diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2005-10-23 02:11:16 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2005-10-23 02:11:16 +0000 |
commit | 712a40b59a0f451a558d88db1f9f124463016f97 (patch) | |
tree | 82bc80e9b7a5ba09c01acf205c8ac1e20c44914f /src/libffmpeg/libavutil/mathematics.h | |
parent | 640063a719556f8569fe848528b39660c6fc31a6 (diff) | |
download | xine-lib-712a40b59a0f451a558d88db1f9f124463016f97.tar.gz xine-lib-712a40b59a0f451a558d88db1f9f124463016f97.tar.bz2 |
big ffmpeg update
it is likely to break, so please keep both pieces
CVS patchset: 7767
CVS date: 2005/10/23 02:11:16
Diffstat (limited to 'src/libffmpeg/libavutil/mathematics.h')
-rw-r--r-- | src/libffmpeg/libavutil/mathematics.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/libffmpeg/libavutil/mathematics.h b/src/libffmpeg/libavutil/mathematics.h new file mode 100644 index 000000000..0cf726cbe --- /dev/null +++ b/src/libffmpeg/libavutil/mathematics.h @@ -0,0 +1,31 @@ +#ifndef MATHEMATICS_H +#define MATHEMATICS_H + +#include "rational.h" + +enum AVRounding { + AV_ROUND_ZERO = 0, ///< round toward zero + AV_ROUND_INF = 1, ///< round away from zero + AV_ROUND_DOWN = 2, ///< round toward -infinity + AV_ROUND_UP = 3, ///< round toward +infinity + AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero +}; + +/** + * rescale a 64bit integer with rounding to nearest. + * a simple a*b/c isn't possible as it can overflow + */ +int64_t av_rescale(int64_t a, int64_t b, int64_t c); + +/** + * rescale a 64bit integer with specified rounding. + * a simple a*b/c isn't possible as it can overflow + */ +int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding); + +/** + * rescale a 64bit integer by 2 rational numbers. + */ +int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq); + +#endif /* MATHEMATICS_H */ |