comparison 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
comparison
equal deleted inserted replaced
2241:c26038875ebc 2242:8f605c66d1d4
226 ME_FULL, 226 ME_FULL,
227 ME_LOG, 227 ME_LOG,
228 ME_PHODS, 228 ME_PHODS,
229 ME_EPZS, 229 ME_EPZS,
230 ME_X1 230 ME_X1
231 };
232
233 enum AVRounding {
234 AV_ROUND_ZERO = 0, ///< round toward zero
235 AV_ROUND_INF = 1, ///< round away from zero
236 AV_ROUND_DOWN = 2, ///< round toward -infinity
237 AV_ROUND_UP = 3, ///< round toward +infinity
238 AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
231 }; 239 };
232 240
233 typedef struct RcOverride{ 241 typedef struct RcOverride{
234 int start_frame; 242 int start_frame;
235 int end_frame; 243 int end_frame;
2059 * @return 1 if exact, 0 otherwise 2067 * @return 1 if exact, 0 otherwise
2060 */ 2068 */
2061 int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max); 2069 int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
2062 2070
2063 /** 2071 /**
2064 * rescale a 64bit integer. 2072 * rescale a 64bit integer with rounding to nearest.
2065 * a simple a*b/c isnt possible as it can overflow 2073 * a simple a*b/c isnt possible as it can overflow
2066 */ 2074 */
2067 int64_t av_rescale(int64_t a, int64_t b, int64_t c); 2075 int64_t av_rescale(int64_t a, int64_t b, int64_t c);
2068 2076
2077 /**
2078 * rescale a 64bit integer with specified rounding.
2079 * a simple a*b/c isnt possible as it can overflow
2080 */
2081 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
2069 2082
2070 /** 2083 /**
2071 * Interface for 0.5.0 version 2084 * Interface for 0.5.0 version
2072 * 2085 *
2073 * do not even think about it's usage for this moment 2086 * do not even think about it's usage for this moment