* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef FFMPEG_AVCODEC_H
-#define FFMPEG_AVCODEC_H
+#ifndef AVCODEC_AVCODEC_H
+#define AVCODEC_AVCODEC_H
/**
* @file avcodec.h
#include "libavutil/avutil.h"
-#define LIBAVCODEC_VERSION_MAJOR 51
-#define LIBAVCODEC_VERSION_MINOR 69
+#define LIBAVCODEC_VERSION_MAJOR 52
+#define LIBAVCODEC_VERSION_MINOR 6
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
CODEC_ID_CMV,
CODEC_ID_MOTIONPIXELS,
CODEC_ID_TGV,
+ CODEC_ID_TGQ,
/* various PCM "codecs" */
CODEC_ID_PCM_S16LE= 0x10000,
CODEC_ID_MP2= 0x15000,
CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
CODEC_ID_AAC,
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- CODEC_ID_MPEG4AAC,
-#endif
CODEC_ID_AC3,
CODEC_ID_DTS,
CODEC_ID_VORBIS,
CODEC_ID_WMAPRO,
CODEC_ID_WMALOSSLESS,
CODEC_ID_ATRAC3P,
+ CODEC_ID_EAC3,
+ CODEC_ID_SIPR,
/* subtitle codecs */
CODEC_ID_DVD_SUBTITLE= 0x17000,
* stream (only used by libavformat) */
};
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/* CODEC_ID_MP3LAME is obsolete */
-#define CODEC_ID_MP3LAME CODEC_ID_MP3
-#define CODEC_ID_MPEG4AAC CODEC_ID_AAC
-#endif
-
enum CodecType {
CODEC_TYPE_UNKNOWN = -1,
CODEC_TYPE_VIDEO,
};
/**
- * Currently unused, may be used if 24/32 bits samples are ever supported.
* all in native-endian format
*/
enum SampleFormat {
SAMPLE_FMT_NONE = -1,
SAMPLE_FMT_U8, ///< unsigned 8 bits
SAMPLE_FMT_S16, ///< signed 16 bits
- SAMPLE_FMT_S24, ///< signed 24 bits @deprecated Deprecated in favor of SAMPLE_FMT_S32
SAMPLE_FMT_S32, ///< signed 32 bits
SAMPLE_FMT_FLT, ///< float
SAMPLE_FMT_DBL, ///< double
SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec
};
+/* Audio channel masks */
+#define CH_FRONT_LEFT 0x00000001
+#define CH_FRONT_RIGHT 0x00000002
+#define CH_FRONT_CENTER 0x00000004
+#define CH_LOW_FREQUENCY 0x00000008
+#define CH_BACK_LEFT 0x00000010
+#define CH_BACK_RIGHT 0x00000020
+#define CH_FRONT_LEFT_OF_CENTER 0x00000040
+#define CH_FRONT_RIGHT_OF_CENTER 0x00000080
+#define CH_BACK_CENTER 0x00000100
+#define CH_SIDE_LEFT 0x00000200
+#define CH_SIDE_RIGHT 0x00000400
+#define CH_TOP_CENTER 0x00000800
+#define CH_TOP_FRONT_LEFT 0x00001000
+#define CH_TOP_FRONT_CENTER 0x00002000
+#define CH_TOP_FRONT_RIGHT 0x00004000
+#define CH_TOP_BACK_LEFT 0x00008000
+#define CH_TOP_BACK_CENTER 0x00010000
+#define CH_TOP_BACK_RIGHT 0x00020000
+#define CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
+#define CH_STEREO_RIGHT 0x40000000 ///< See CH_STEREO_LEFT.
+
+/* Audio channel convenience macros */
+#define CH_LAYOUT_MONO (CH_FRONT_CENTER)
+#define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT)
+#define CH_LAYOUT_SURROUND (CH_LAYOUT_STEREO|CH_FRONT_CENTER)
+#define CH_LAYOUT_QUAD (CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT)
+#define CH_LAYOUT_5POINT0 (CH_LAYOUT_SURROUND|CH_SIDE_LEFT|CH_SIDE_RIGHT)
+#define CH_LAYOUT_5POINT1 (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
+#define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
+#define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_SURROUND|CH_LOW_FREQUENCY|\
+ CH_BACK_LEFT|CH_BACK_RIGHT|\
+ CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
+#define CH_LAYOUT_STEREO_DOWNMIX (CH_STEREO_LEFT|CH_STEREO_RIGHT)
+
/* in bytes */
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan.
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-#define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< Use trellis quantization.
-#endif
#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
/* Fx : Flag for h263+ extra options */
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-#define CODEC_FLAG_H263P_AIC 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction (remove this)
-#endif
#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector
#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
FF_COMMON_FRAME
} AVFrame;
-#define DEFAULT_FRAME_RATE_BASE 1001000
-
/**
* main external API structure.
* New fields can be added to the end with minor version bumps.
void *priv_data;
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- /* unused, FIXME remove*/
- int rtp_mode;
-#endif
-
int rtp_payload_size; /* The size of the RTP payload: the coder will */
/* do its best to deliver a chunk with size */
/* below rtp_payload_size, the chunk will start */
float b_quant_offset;
/**
- * Error resilience; higher values will detect more errors but may
+ * Error recognization; higher values will detect more errors but may
* misdetect some more or less valid parts as errors.
* - encoding: unused
* - decoding: Set by user.
*/
- int error_resilience;
+ int error_recognition;
#define FF_ER_CAREFUL 1
#define FF_ER_COMPLIANT 2
#define FF_ER_AGGRESSIVE 3
*/
float dark_masking;
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- /* for binary compatibility */
- int unused;
-#endif
-
/**
* IDCT algorithm, see FF_IDCT_* below.
* - encoding: Set by user.
#define FF_IDCT_SIMPLEVIS 18
#define FF_IDCT_WMV2 19
#define FF_IDCT_FAAN 20
+#define FF_IDCT_EA 21
/**
* slice count
#define FF_MM_SSE3 0x0040 ///< Prescott SSE3 functions
#define FF_MM_SSSE3 0x0080 ///< Conroe SSSE3 functions
#define FF_MM_IWMMXT 0x0100 ///< XScale IWMMXT
+#define FF_MM_ALTIVEC 0x0001 ///< standard AltiVec
/**
* bits per sample/pixel from the demuxer (needed for huffyuv).
* - encoding: Set by libavcodec.
* - decoding: Set by user.
*/
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- int bits_per_sample;
-#else
int bits_per_coded_sample;
-#endif
/**
* prediction method (needed for huffyuv)
/**
* sample aspect ratio (0 if unknown)
+ * That is the width of a pixel divided by the height of the pixel.
* Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
* - encoding: Set by user.
* - decoding: Set by libavcodec.
* - encoding: Set by libavcodec, user can override.
* - decoding: Set by libavcodec, user can override.
*/
- int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
+ int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
/**
* thread opaque
#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */
/**
- * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal)
+ * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
* - encoding: Set by user.
* - decoding: unused
*/
*/
int64_t timecode_frame_start;
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* Decoder should decode to this many channels if it can (0 for default)
* - encoding: unused
* - decoding: Set by user.
+ * @deprecated Deprecated in favor of request_channel_layout.
*/
int request_channels;
+#endif
/**
* Percentage of dynamic range compression to be applied by the decoder.
* - decoding: set by libavcodec.
*/
int bits_per_raw_sample;
+
+ /**
+ * Audio channel layout.
+ * - encoding: set by user.
+ * - decoding: set by libavcodec.
+ */
+ int64_t channel_layout;
+
+ /**
+ * Request decoder to use this channel layout if it can (0 for default)
+ * - encoding: unused
+ * - decoding: Set by user.
+ */
+ int64_t request_channel_layout;
+
+ /**
+ * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
+ * - encoding: Set by user.
+ * - decoding: unused.
+ */
+ float rc_max_available_vbv_use;
+
+ /**
+ * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
+ * - encoding: Set by user.
+ * - decoding: unused.
+ */
+ float rc_min_vbv_overflow_use;
} AVCodecContext;
/**
const char *long_name;
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum SampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
+ const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
} AVCodec;
/**
void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
void av_resample_close(struct AVResampleContext *c);
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/* YUV420 format is assumed ! */
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated;
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated ImgReSampleContext *img_resample_init(int output_width, int output_height,
- int input_width, int input_height);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
- int iwidth, int iheight,
- int topBand, int bottomBand,
- int leftBand, int rightBand,
- int padtop, int padbottom,
- int padleft, int padright);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated void img_resample(struct ImgReSampleContext *s,
- AVPicture *output, const AVPicture *input);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated void img_resample_close(struct ImgReSampleContext *s);
-
-#endif
-
/**
* Allocate memory for a picture. Call avpicture_free to free it.
*
* @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
* @return The best pixel format to convert to or -1 if none was found.
*/
-int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
+int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
int has_alpha, int *loss_ptr);
int img_get_alpha_info(const AVPicture *src,
int pix_fmt, int width, int height);
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/**
- * convert among pixel formats
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated int img_convert(AVPicture *dst, int dst_pix_fmt,
- const AVPicture *src, int pix_fmt,
- int width, int height);
-#endif
-
/* deinterlace a picture */
/* deinterlace - if not supported return -1 */
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
/* external high level API */
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-extern AVCodec *first_avcodec;
-#endif
AVCodec *av_codec_next(AVCodec *c);
/**
*/
unsigned avcodec_version(void);
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/* returns LIBAVCODEC_BUILD constant */
-attribute_deprecated unsigned avcodec_build(void);
-#endif
-
/**
* Initializes libavcodec.
*
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);
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
+int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
+int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
//FIXME func typedef
/**
*/
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-/**
- * @deprecated Use avcodec_decode_audio2() instead.
- */
-attribute_deprecated int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- const uint8_t *buf, int buf_size);
-
/**
* Decodes an audio frame from \p buf into \p samples.
* The avcodec_decode_audio2() function decodes an audio frame from the input
struct AVCodecParser *next;
} AVCodecParser;
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-extern AVCodecParser *av_first_parser;
-#endif
AVCodecParser *av_parser_next(AVCodecParser *c);
void av_register_codec_parser(AVCodecParser *parser);
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
int padtop, int padbottom, int padleft, int padright, int *color);
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated void img_copy(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated int img_crop(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int top_band, int left_band);
-
-/**
- * @deprecated Use the software scaler (swscale) instead.
- */
-attribute_deprecated int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
- int padtop, int padbottom, int padleft, int padright, int *color);
-#endif
-
-extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
+unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
/**
* Parses \p str and put in \p width_ptr and \p height_ptr the detected values.
#define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
-#endif /* FFMPEG_AVCODEC_H */
+#endif /* AVCODEC_AVCODEC_H */