summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2004-03-14 21:14:07 +0000
committerMike Melanson <mike@multimedia.cx>2004-03-14 21:14:07 +0000
commit0d90aec0fd7428a77b5c4c536ab65635669bc42d (patch)
tree9eb56c6c1176bf6a6f3ae65199a3f43aa8c2aa2d /src/libffmpeg/libavcodec/avcodec.h
parentb4d3aa3dcce07b90098e33c37b563e797378d0f1 (diff)
downloadxine-lib-0d90aec0fd7428a77b5c4c536ab65635669bc42d.tar.gz
xine-lib-0d90aec0fd7428a77b5c4c536ab65635669bc42d.tar.bz2
sync to ffmpeg build 4707
CVS patchset: 6253 CVS date: 2004/03/14 21:14:07
Diffstat (limited to 'src/libffmpeg/libavcodec/avcodec.h')
-rw-r--r--src/libffmpeg/libavcodec/avcodec.h124
1 files changed, 95 insertions, 29 deletions
diff --git a/src/libffmpeg/libavcodec/avcodec.h b/src/libffmpeg/libavcodec/avcodec.h
index 2e884e834..510bd41d2 100644
--- a/src/libffmpeg/libavcodec/avcodec.h
+++ b/src/libffmpeg/libavcodec/avcodec.h
@@ -24,7 +24,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000408
#define FFMPEG_VERSION "0.4.8"
-#define LIBAVCODEC_BUILD 4699
+#define LIBAVCODEC_BUILD 4707
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
@@ -33,6 +33,9 @@ extern "C" {
#define AV_TOSTRING(s) #s
#define LIBAVCODEC_IDENT "FFmpeg" LIBAVCODEC_VERSION "b" AV_STRINGIFY(LIBAVCODEC_BUILD)
+#define AV_NOPTS_VALUE int64_t_C(0x8000000000000000)
+#define AV_TIME_BASE 1000000
+
enum CodecID {
CODEC_ID_NONE,
CODEC_ID_MPEG1VIDEO,
@@ -100,6 +103,7 @@ enum CodecID {
CODEC_ID_VMDAUDIO,
CODEC_ID_MSZH,
CODEC_ID_ZLIB,
+ CODEC_ID_QTRLE,
/* various pcm "codecs" */
CODEC_ID_PCM_S16LE,
@@ -123,6 +127,7 @@ enum CodecID {
CODEC_ID_ADPCM_XA,
CODEC_ID_ADPCM_ADX,
CODEC_ID_ADPCM_EA,
+ CODEC_ID_ADPCM_G726,
/* AMR */
CODEC_ID_AMR_NB,
@@ -137,6 +142,8 @@ enum CodecID {
CODEC_ID_INTERPLAY_DPCM,
CODEC_ID_XAN_DPCM,
+ CODEC_ID_FLAC,
+
CODEC_ID_MPEG2TS, /* _FAKE_ codec to indicate a raw MPEG2 transport
stream (only used by libavformat) */
};
@@ -230,12 +237,6 @@ typedef struct RcOverride{
/* only for ME compatiblity with old apps */
extern int motion_estimation_method;
-/* ME algos sorted by quality */
-//FIXME remove IMHO
-static const __attribute__((unused)) int Motion_Est_QTab[] =
- { ME_ZERO, ME_PHODS, ME_LOG, ME_X1, ME_EPZS, ME_FULL };
-
-
#define FF_MAX_B_FRAMES 8
/* encoding support
@@ -297,6 +298,8 @@ static const __attribute__((unused)) int Motion_Est_QTab[] =
used */
#define CODEC_CAP_PARSE_ONLY 0x0004
#define CODEC_CAP_TRUNCATED 0x0008
+/* codec can export data for HW decoding (XvMC) */
+#define CODEC_CAP_HWACCEL 0x0010
//the following defines might change, so dont expect compatibility if u use them
#define MB_TYPE_INTRA4x4 0x0001
@@ -381,8 +384,8 @@ typedef struct AVPanScan{
int pict_type;\
\
/**\
- * presentation timestamp in micro seconds (time when frame should be shown to user)\
- * if 0 then the frame_rate will be used as reference\
+ * presentation timestamp in AV_TIME_BASE (=micro seconds currently) (time when frame should be shown to user)\
+ * if AV_NOPTS_VALUE then the frame_rate will be used as reference\
* - encoding: MUST be set by user\
* - decoding: set by lavc\
*/\
@@ -535,6 +538,13 @@ typedef struct AVPanScan{
* - decoding: set by lavc (before get_buffer() call))\
*/\
int buffer_hints;\
+\
+ /**\
+ * DCT coeffitients\
+ * - encoding: unused\
+ * - decoding: set by lavc\
+ */\
+ short *dct_coeff;\
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
@@ -567,10 +577,27 @@ typedef struct AVFrame {
#define DEFAULT_FRAME_RATE_BASE 1001000
/**
+ * Used by av_log
+ */
+typedef struct AVCLASS AVClass;
+struct AVCLASS {
+ const char* class_name;
+ const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext
+ or AVFormatContext, which begin with an AVClass.
+ Needed because av_log is in libavcodec and has no visibility
+ of AVIn/OutputFormat */
+};
+
+/**
* main external api structure.
*/
typedef struct AVCodecContext {
/**
+ * Info on struct for av_log
+ * - set by avcodec_alloc_context
+ */
+ AVClass *av_class;
+ /**
* the average bitrate.
* - encoding: set by user. unused for constant quantizer encoding
* - decoding: set by lavc. 0 or some bitrate if this info is available in the stream
@@ -634,11 +661,6 @@ typedef struct AVCodecContext {
*/
int width, height;
-#define FF_ASPECT_SQUARE 1
-#define FF_ASPECT_4_3_625 2
-#define FF_ASPECT_4_3_525 3
-#define FF_ASPECT_16_9_625 4
-#define FF_ASPECT_16_9_525 5
#define FF_ASPECT_EXTENDED 15
/**
@@ -1149,7 +1171,7 @@ typedef struct AVCodecContext {
#define FF_DEBUG_MB_TYPE 8
#define FF_DEBUG_QP 16
#define FF_DEBUG_MV 32
-//#define FF_DEBUG_VIS_MV 0x00000040
+#define FF_DEBUG_DCT_COEFF 0x00000040
#define FF_DEBUG_SKIP 0x00000080
#define FF_DEBUG_STARTCODE 0x00000100
#define FF_DEBUG_PTS 0x00000200
@@ -1277,7 +1299,7 @@ typedef struct AVCodecContext {
* - encoding: unused
* - decoding: set by user, if not set then the native format will always be choosen
*/
- enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt);
+ enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
/**
* DTG active format information (additionnal aspect ratio
@@ -1513,6 +1535,38 @@ typedef struct AVCodecContext {
#define FF_AA_FASTINT 1 //not implemented yet
#define FF_AA_INT 2
#define FF_AA_FLOAT 3
+ /**
+ * Quantizer noise shaping.
+ * - encoding: set by user
+ * - decoding: unused
+ */
+ int quantizer_noise_shaping;
+
+ /**
+ * Thread count.
+ * is used to decide how many independant tasks should be passed to execute()
+ * - encoding: set by user
+ * - decoding: set by user
+ */
+ int thread_count;
+
+ /**
+ * the codec may call this to execute several independant things. it will return only after
+ * finishing all tasks, the user may replace this with some multithreaded implementation, the
+ * default implementation will execute the parts serially
+ * @param count the number of things to execute
+ * - encoding: set by lavc, user can override
+ * - decoding: set by lavc, user can override
+ */
+ int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
+
+ /**
+ * Thread opaque.
+ * can be used by execute() to store some per AVCodecContext stuff.
+ * - encoding: set by execute()
+ * - decoding: set by execute()
+ */
+ void *thread_opaque;
} AVCodecContext;
@@ -1577,6 +1631,7 @@ typedef struct AVCodec {
const AVOption *options;
struct AVCodec *next;
void (*flush)(AVCodecContext *);
+ const AVRational *supported_framerates; ///array of supported framerates, or NULL if any, array is terminated by {0,0}
} AVCodec;
/**
@@ -1707,6 +1762,8 @@ extern AVCodec ra_288_decoder;
extern AVCodec roq_dpcm_decoder;
extern AVCodec interplay_dpcm_decoder;
extern AVCodec xan_dpcm_decoder;
+extern AVCodec qtrle_decoder;
+extern AVCodec flac_decoder;
/* pcm codecs */
#define PCM_CODEC(id, name) \
@@ -1735,6 +1792,7 @@ PCM_CODEC(CODEC_ID_ADPCM_4XM, adpcm_4xm);
PCM_CODEC(CODEC_ID_ADPCM_XA, adpcm_xa);
PCM_CODEC(CODEC_ID_ADPCM_ADX, adpcm_adx);
PCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);
+PCM_CODEC(CODEC_ID_ADPCM_G726, adpcm_g726);
#undef PCM_CODEC
@@ -1849,6 +1907,11 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
void avcodec_default_free_buffers(AVCodecContext *s);
+int avcodec_thread_init(AVCodecContext *s, int thread_count);
+void avcodec_thread_free(AVCodecContext *s);
+int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
+//FIXME func typedef
+
/**
* opens / inits the AVCodecContext.
* not thread save!
@@ -2034,8 +2097,7 @@ void *av_mallocz(unsigned int size);
void *av_realloc(void *ptr, unsigned int size);
void av_free(void *ptr);
char *av_strdup(const char *s);
-void __av_freep(void **ptr);
-#define av_freep(p) __av_freep((void **)(p))
+void av_freep(void *ptr);
void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
/* for static data only */
/* call av_free_static to release all staticaly allocated tables */
@@ -2057,19 +2119,23 @@ void img_copy(AVPicture *dst, const AVPicture *src,
#define AV_LOG_INFO 1
#define AV_LOG_DEBUG 2
-extern void av_log(AVCodecContext*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-extern void av_vlog(AVCodecContext*, int level, const char *fmt, va_list);
+extern void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
+extern void av_vlog(void*, int level, const char *fmt, va_list);
extern int av_log_get_level(void);
extern void av_log_set_level(int);
-extern void av_log_set_callback(void (*)(AVCodecContext*, int, const char*, va_list));
-
-#undef AV_LOG_TRAP_PRINTF
-#ifdef AV_LOG_TRAP_PRINTF
-#define printf DO NOT USE
-#define fprintf DO NOT USE
-#undef stderr
-#define stderr DO NOT USE
-#endif
+extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
+
+/* endian macros */
+#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
+#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
+ (((uint8_t*)(x))[1] << 16) | \
+ (((uint8_t*)(x))[2] << 8) | \
+ ((uint8_t*)(x))[3])
+#define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0])
+#define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \
+ (((uint8_t*)(x))[2] << 16) | \
+ (((uint8_t*)(x))[1] << 8) | \
+ ((uint8_t*)(x))[0])
#ifdef __cplusplus
}