]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/avcodec.h
move p*m from image/lavf -> image2/lavc
[ffmpeg] / libavcodec / avcodec.h
index 17477032ba23fa2b7d2251aaaf5269c942f772af..a379b527ce4eeca27ffad55c88c18cbe46a87273 100644 (file)
@@ -17,7 +17,7 @@ extern "C" {
 
 #define FFMPEG_VERSION_INT     0x000409
 #define FFMPEG_VERSION         "0.4.9-pre1"
-#define LIBAVCODEC_BUILD       4724
+#define LIBAVCODEC_BUILD       4730
 
 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
 #define LIBAVCODEC_VERSION     FFMPEG_VERSION
@@ -103,6 +103,8 @@ enum CodecID {
     CODEC_ID_SNOW,
     CODEC_ID_TSCC,
     CODEC_ID_ULTI,
+    CODEC_ID_QDRAW,
+    CODEC_ID_VIXL,
 
     /* various pcm "codecs" */
     CODEC_ID_PCM_S16LE,
@@ -127,6 +129,7 @@ enum CodecID {
     CODEC_ID_ADPCM_ADX,
     CODEC_ID_ADPCM_EA,
     CODEC_ID_ADPCM_G726,
+    CODEC_ID_ADPCM_CT,
 
        /* AMR */
     CODEC_ID_AMR_NB,
@@ -140,6 +143,7 @@ enum CodecID {
     CODEC_ID_ROQ_DPCM,
     CODEC_ID_INTERPLAY_DPCM,
     CODEC_ID_XAN_DPCM,
+    CODEC_ID_SOL_DPCM,
     
     CODEC_ID_FLAC,
     
@@ -148,6 +152,13 @@ enum CodecID {
 
     CODEC_ID_DTS,
     CODEC_ID_XVID,
+
+    CODEC_ID_PNG,    
+    CODEC_ID_PPM,
+    CODEC_ID_PBM,
+    CODEC_ID_PGM,
+    CODEC_ID_PGMYUV,
+    CODEC_ID_PAM,
 };
 
 /* CODEC_ID_MP3LAME is absolete */
@@ -200,6 +211,7 @@ enum PixelFormat {
     PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
     PIX_FMT_XVMC_MPEG2_IDCT,
     PIX_FMT_UYVY422,   ///< Packed pixel, Cb Y0 Cr Y1 
+    PIX_FMT_UYVY411,   ///< Packed pixel, Cb Y0 Y1 Cr Y2 Y3
     PIX_FMT_NB,
 };
 
@@ -293,6 +305,7 @@ extern int motion_estimation_method;
 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< will reserve space for SVCD scan offset user data
 #define CODEC_FLAG_CLOSED_GOP     0x80000000
 #define CODEC_FLAG2_FAST          0x00000001 ///< allow non spec compliant speedup tricks
+#define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< strictly enforce GOP size
 
 /* Unsupported options :
  *             Syntax Arithmetic coding (SAC)
@@ -677,9 +690,11 @@ typedef struct AVCodecContext {
     int frame_rate;
     
     /**
-     * width / height.
+     * picture width / height.
      * - encoding: MUST be set by user. 
-     * - decoding: set by user if known, codec should override / dynamically change if needed
+     * - decoding: set by lavc.
+     * Note, for compatibility its possible to set this instead of 
+     * coded_width/height before decoding
      */
     int width, height;
     
@@ -1111,6 +1126,7 @@ typedef struct AVCodecContext {
 #define FF_IDCT_ALTIVEC      8
 #define FF_IDCT_SH4          9
 #define FF_IDCT_SIMPLEARM    10
+#define FF_IDCT_H264         11
 
     /**
      * slice count.
@@ -1663,6 +1679,14 @@ typedef struct AVCodecContext {
      * - decoding: set by user
      */
      int lowres;
+
+    /**
+     * bistream width / height. may be different from width/height if lowres
+     * or other things are used
+     * - encoding: unused
+     * - decoding: set by user before init if known, codec should override / dynamically change if needed
+     */
+    int coded_width, coded_height;
 } AVCodecContext;
 
 
@@ -1716,7 +1740,7 @@ int avoption_parse(void* strct, const AVOption* list, const char* opts);
 typedef struct AVCodec {
     const char *name;
     enum CodecType type;
-    int id;
+    enum CodecID id;
     int priv_data_size;
     int (*init)(AVCodecContext *);
     int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
@@ -1769,6 +1793,7 @@ extern AVCodec faac_encoder;
 extern AVCodec xvid_encoder;
 extern AVCodec mpeg1video_encoder;
 extern AVCodec mpeg2video_encoder;
+extern AVCodec h261_encoder;
 extern AVCodec h263_encoder;
 extern AVCodec h263p_encoder;
 extern AVCodec flv_encoder;
@@ -1777,6 +1802,12 @@ extern AVCodec rv20_encoder;
 extern AVCodec dvvideo_encoder;
 extern AVCodec mjpeg_encoder;
 extern AVCodec ljpeg_encoder;
+extern AVCodec png_encoder;
+extern AVCodec ppm_encoder;
+extern AVCodec pgm_encoder;
+extern AVCodec pgmyuv_encoder;
+extern AVCodec pbm_encoder;
+extern AVCodec pam_encoder;
 extern AVCodec mpeg4_encoder;
 extern AVCodec msmpeg4v1_encoder;
 extern AVCodec msmpeg4v2_encoder;
@@ -1820,6 +1851,7 @@ extern AVCodec wmav2_decoder;
 extern AVCodec mjpeg_decoder;
 extern AVCodec mjpegb_decoder;
 extern AVCodec sp5x_decoder;
+extern AVCodec png_decoder;
 extern AVCodec mp2_decoder;
 extern AVCodec mp3_decoder;
 extern AVCodec mace3_decoder;
@@ -1867,11 +1899,14 @@ extern AVCodec ra_288_decoder;
 extern AVCodec roq_dpcm_decoder;
 extern AVCodec interplay_dpcm_decoder;
 extern AVCodec xan_dpcm_decoder;
+extern AVCodec sol_dpcm_decoder;
 extern AVCodec sonic_decoder;
 extern AVCodec qtrle_decoder;
 extern AVCodec flac_decoder;
 extern AVCodec tscc_decoder;
 extern AVCodec ulti_decoder;
+extern AVCodec qdraw_decoder;
+extern AVCodec xl_decoder;
 
 /* pcm codecs */
 #define PCM_CODEC(id, name) \
@@ -1901,6 +1936,7 @@ 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);
+PCM_CODEC(CODEC_ID_ADPCM_CT, adpcm_ct);
 
 #undef PCM_CODEC
 
@@ -1924,7 +1960,7 @@ ReSampleContext *audio_resample_init(int output_channels, int input_channels,
 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
 void audio_resample_close(ReSampleContext *s);
 
-struct AVResampleContext *av_resample_init(int out_rate, int in_rate);
+struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
 void av_resample_close(struct AVResampleContext *c);
@@ -1972,7 +2008,9 @@ int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
 int avpicture_get_size(int pix_fmt, int width, int height);
 void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
 const char *avcodec_get_pix_fmt_name(int pix_fmt);
+void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
 enum PixelFormat avcodec_get_pix_fmt(const char* name);
+unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
 
 #define FF_LOSS_RESOLUTION  0x0001 /* loss due to resolution change */
 #define FF_LOSS_DEPTH       0x0002 /* loss due to color depth change */
@@ -2087,82 +2125,6 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c);
  */
 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
 
-/**
- * Interface for 0.5.0 version
- *
- * do not even think about it's usage for this moment
- */
-
-typedef struct {
-    /// compressed size used from given memory buffer
-    int size;
-    /// I/P/B frame type
-    int frame_type;
-} avc_enc_result_t;
-
-/**
- * Commands
- * order can't be changed - once it was defined
- */
-typedef enum {
-    // general commands
-    AVC_OPEN_BY_NAME = 0xACA000,
-    AVC_OPEN_BY_CODEC_ID,
-    AVC_OPEN_BY_FOURCC,
-    AVC_CLOSE,
-
-    AVC_FLUSH,
-    // pin - struct { uint8_t* src, uint_t src_size }
-    // pout - struct { AVPicture* img, consumed_bytes,
-    AVC_DECODE,
-    // pin - struct { AVPicture* img, uint8_t* dest, uint_t dest_size }
-    // pout - uint_t used_from_dest_size
-    AVC_ENCODE, 
-
-    // query/get video commands
-    AVC_GET_VERSION = 0xACB000,
-    AVC_GET_WIDTH,
-    AVC_GET_HEIGHT,
-    AVC_GET_DELAY,
-    AVC_GET_QUANT_TABLE,
-    // ...
-
-    // query/get audio commands
-    AVC_GET_FRAME_SIZE = 0xABC000,
-
-    // maybe define some simple structure which
-    // might be passed to the user - but they can't
-    // contain any codec specific parts and these
-    // calls are usualy necessary only few times
-
-    // set video commands
-    AVC_SET_WIDTH = 0xACD000,
-    AVC_SET_HEIGHT,
-
-    // set video encoding commands
-    AVC_SET_FRAME_RATE = 0xACD800,
-    AVC_SET_QUALITY,
-    AVC_SET_HURRY_UP,
-
-    // set audio commands
-    AVC_SET_SAMPLE_RATE = 0xACE000,
-    AVC_SET_CHANNELS,
-
-} avc_cmd_t;
-
-/**
- * \param handle  allocated private structure by libavcodec
- *                for initialization pass NULL - will be returned pout
- *                user is supposed to know nothing about its structure
- * \param cmd     type of operation to be performed
- * \param pint    input parameter
- * \param pout    output parameter
- *
- * \returns  command status - eventually for query command it might return
- * integer resulting value
- */
-int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout);
-
 /* frame parsing */
 typedef struct AVCodecParserContext {
     void *priv_data;
@@ -2217,6 +2179,7 @@ extern AVCodecParser mpeg4video_parser;
 extern AVCodecParser h261_parser;
 extern AVCodecParser h263_parser;
 extern AVCodecParser h264_parser;
+extern AVCodecParser mjpeg_parser;
 extern AVCodecParser mpegaudio_parser;
 extern AVCodecParser ac3_parser;