VirtualBox

source: vbox/trunk/src/libs/ffmpeg-20060710/libavutil/mathematics.h@ 9713

Last change on this file since 9713 was 5776, checked in by vboxsync, 17 years ago

ffmpeg: exported to OSE

File size: 888 bytes
Line 
1#ifndef MATHEMATICS_H
2#define MATHEMATICS_H
3
4#include "rational.h"
5
6enum AVRounding {
7 AV_ROUND_ZERO = 0, ///< round toward zero
8 AV_ROUND_INF = 1, ///< round away from zero
9 AV_ROUND_DOWN = 2, ///< round toward -infinity
10 AV_ROUND_UP = 3, ///< round toward +infinity
11 AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
12};
13
14/**
15 * rescale a 64bit integer with rounding to nearest.
16 * a simple a*b/c isn't possible as it can overflow
17 */
18int64_t av_rescale(int64_t a, int64_t b, int64_t c);
19
20/**
21 * rescale a 64bit integer with specified rounding.
22 * a simple a*b/c isn't possible as it can overflow
23 */
24int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
25
26/**
27 * rescale a 64bit integer by 2 rational numbers.
28 */
29int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq);
30
31#endif /* MATHEMATICS_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette