libavutil: Utility code from libavcodec moved to a separate library.

Originally committed as revision 4489 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Alexander Strasser
2005-08-01 20:07:05 +00:00
parent 0cc64d3d1c
commit c11c2bc20b
20 changed files with 369 additions and 175 deletions

View File

@@ -11,8 +11,7 @@
extern "C" {
#endif
#include "common.h"
#include "rational.h"
#include "avutil.h"
#include <sys/types.h> /* size_t */
//FIXME the following 2 really dont belong in here
@@ -22,8 +21,8 @@ extern "C" {
#define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_TOSTRING(s) #s
#define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+0)
#define LIBAVCODEC_VERSION 49.0.0
#define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+1)
#define LIBAVCODEC_VERSION 49.0.1
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
@@ -279,14 +278,6 @@ enum Motion_Est_ID {
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
};
enum AVDiscard{
//we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames)
AVDISCARD_NONE =-16, ///< discard nothing
@@ -2308,36 +2299,6 @@ void avcodec_default_free_buffers(AVCodecContext *s);
*/
char av_get_pict_type_char(int pict_type);
/**
* reduce a fraction.
* this is usefull for framerate calculations
* @param max the maximum allowed for dst_nom & dst_den
* @return 1 if exact, 0 otherwise
*/
int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
/**
* 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);
double av_int2dbl(int64_t v);
float av_int2flt(int32_t v);
int64_t av_dbl2int(double d);
int32_t av_flt2int(float d);
/* frame parsing */
typedef struct AVCodecParserContext {