Mercurial > libavcodec.hg
comparison avcodec.h @ 2817:b128802eb77b libavcodec
libavutil: Utility code from libavcodec moved to a separate library.
| author | al |
|---|---|
| date | Mon, 01 Aug 2005 20:07:05 +0000 |
| parents | 48fb350b0ec9 |
| children | 45ccf6842c34 |
comparison
equal
deleted
inserted
replaced
| 2816:c6ab4b91a5c5 | 2817:b128802eb77b |
|---|---|
| 9 | 9 |
| 10 #ifdef __cplusplus | 10 #ifdef __cplusplus |
| 11 extern "C" { | 11 extern "C" { |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include "common.h" | 14 #include "avutil.h" |
| 15 #include "rational.h" | |
| 16 #include <sys/types.h> /* size_t */ | 15 #include <sys/types.h> /* size_t */ |
| 17 | 16 |
| 18 //FIXME the following 2 really dont belong in here | 17 //FIXME the following 2 really dont belong in here |
| 19 #define FFMPEG_VERSION_INT 0x000409 | 18 #define FFMPEG_VERSION_INT 0x000409 |
| 20 #define FFMPEG_VERSION "CVS" | 19 #define FFMPEG_VERSION "CVS" |
| 21 | 20 |
| 22 #define AV_STRINGIFY(s) AV_TOSTRING(s) | 21 #define AV_STRINGIFY(s) AV_TOSTRING(s) |
| 23 #define AV_TOSTRING(s) #s | 22 #define AV_TOSTRING(s) #s |
| 24 | 23 |
| 25 #define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+0) | 24 #define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+1) |
| 26 #define LIBAVCODEC_VERSION 49.0.0 | 25 #define LIBAVCODEC_VERSION 49.0.1 |
| 27 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT | 26 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT |
| 28 | 27 |
| 29 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) | 28 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) |
| 30 | 29 |
| 31 #define AV_NOPTS_VALUE int64_t_C(0x8000000000000000) | 30 #define AV_NOPTS_VALUE int64_t_C(0x8000000000000000) |
| 275 ME_FULL, | 274 ME_FULL, |
| 276 ME_LOG, | 275 ME_LOG, |
| 277 ME_PHODS, | 276 ME_PHODS, |
| 278 ME_EPZS, | 277 ME_EPZS, |
| 279 ME_X1 | 278 ME_X1 |
| 280 }; | |
| 281 | |
| 282 enum AVRounding { | |
| 283 AV_ROUND_ZERO = 0, ///< round toward zero | |
| 284 AV_ROUND_INF = 1, ///< round away from zero | |
| 285 AV_ROUND_DOWN = 2, ///< round toward -infinity | |
| 286 AV_ROUND_UP = 3, ///< round toward +infinity | |
| 287 AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero | |
| 288 }; | 279 }; |
| 289 | 280 |
| 290 enum AVDiscard{ | 281 enum AVDiscard{ |
| 291 //we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames) | 282 //we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames) |
| 292 AVDISCARD_NONE =-16, ///< discard nothing | 283 AVDISCARD_NONE =-16, ///< discard nothing |
| 2306 /** | 2297 /** |
| 2307 * returns a single letter to describe the picture type | 2298 * returns a single letter to describe the picture type |
| 2308 */ | 2299 */ |
| 2309 char av_get_pict_type_char(int pict_type); | 2300 char av_get_pict_type_char(int pict_type); |
| 2310 | 2301 |
| 2311 /** | |
| 2312 * reduce a fraction. | |
| 2313 * this is usefull for framerate calculations | |
| 2314 * @param max the maximum allowed for dst_nom & dst_den | |
| 2315 * @return 1 if exact, 0 otherwise | |
| 2316 */ | |
| 2317 int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max); | |
| 2318 | |
| 2319 /** | |
| 2320 * rescale a 64bit integer with rounding to nearest. | |
| 2321 * a simple a*b/c isn't possible as it can overflow | |
| 2322 */ | |
| 2323 int64_t av_rescale(int64_t a, int64_t b, int64_t c); | |
| 2324 | |
| 2325 /** | |
| 2326 * rescale a 64bit integer with specified rounding. | |
| 2327 * a simple a*b/c isn't possible as it can overflow | |
| 2328 */ | |
| 2329 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding); | |
| 2330 | |
| 2331 /** | |
| 2332 * rescale a 64bit integer by 2 rational numbers. | |
| 2333 */ | |
| 2334 int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq); | |
| 2335 | |
| 2336 double av_int2dbl(int64_t v); | |
| 2337 float av_int2flt(int32_t v); | |
| 2338 int64_t av_dbl2int(double d); | |
| 2339 int32_t av_flt2int(float d); | |
| 2340 | |
| 2341 | 2302 |
| 2342 /* frame parsing */ | 2303 /* frame parsing */ |
| 2343 typedef struct AVCodecParserContext { | 2304 typedef struct AVCodecParserContext { |
| 2344 void *priv_data; | 2305 void *priv_data; |
| 2345 struct AVCodecParser *parser; | 2306 struct AVCodecParser *parser; |
