Mercurial > libavcodec.hg
diff avcodec.h @ 2242:8f605c66d1d4 libavcodec
av_rescale with user specified rounding
| author | michael |
|---|---|
| date | Sun, 19 Sep 2004 16:38:54 +0000 |
| parents | dff53892ff8a |
| children | 7e0b2e86afa9 |
line wrap: on
line diff
--- a/avcodec.h Sun Sep 19 14:43:09 2004 +0000 +++ b/avcodec.h Sun Sep 19 16:38:54 2004 +0000 @@ -230,6 +230,14 @@ ME_X1 }; +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 +}; + typedef struct RcOverride{ int start_frame; int end_frame; @@ -2061,11 +2069,16 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max); /** - * rescale a 64bit integer. + * rescale a 64bit integer with rounding to nearest. * a simple a*b/c isnt 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 isnt possible as it can overflow + */ +int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding); /** * Interface for 0.5.0 version
