AV_CODEC_ID_MSZH,
AV_CODEC_ID_ZLIB,
AV_CODEC_ID_QTRLE,
-#if FF_API_SNOW
- AV_CODEC_ID_SNOW,
-#endif
AV_CODEC_ID_TSCC,
AV_CODEC_ID_ULTI,
AV_CODEC_ID_QDRAW,
AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
-
-#if FF_API_CODEC_ID
-#include "old_codec_ids.h"
-#endif
};
-#if FF_API_CODEC_ID
-#define CodecID AVCodecID
-#endif
-
/**
* This struct describes the properties of a single codec described by an
* AVCodecID.
ME_X1, ///< reserved for experiments
ME_HEX, ///< hexagon based search
ME_UMH, ///< uneven multi-hexagon search
-#if FF_API_SNOW
- ME_ITER, ///< iterative search
-#endif
ME_TESA, ///< transformed exhaustive search algorithm
};
Note: Not everything is supported yet.
*/
+/**
+ * Allow decoders to produce frames with data planes that are not aligned
+ * to CPU requirements (e.g. due to cropping).
+ */
+#define CODEC_FLAG_UNALIGNED 0x0001
#define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale.
#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
/**
* picture width / height.
* - encoding: MUST be set by user.
- * - decoding: Set by libavcodec.
- * Note: For compatibility it is possible to set this instead of
- * coded_width/height before decoding.
+ * - decoding: May be set by the user before opening the decoder if known e.g.
+ * from the container. Some decoders will require the dimensions
+ * to be set by the caller. During decoding, the decoder may
+ * overwrite those values as required.
*/
int width, height;
/**
- * Bitstream width / height, may be different from width/height.
+ * Bitstream width / height, may be different from width/height e.g. when
+ * the decoded frame is cropped before being output.
* - encoding: unused
- * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
+ * - decoding: May be set by the user before opening the decoder if known
+ * e.g. from the container. During decoding, the decoder may
+ * overwrite those values as required.
*/
int coded_width, coded_height;
#define FF_CMP_VSAD 8
#define FF_CMP_VSSE 9
#define FF_CMP_NSSE 10
-#if FF_API_SNOW
-#define FF_CMP_W53 11
-#define FF_CMP_W97 12
-#endif
#define FF_CMP_DCTMAX 13
#define FF_CMP_DCT264 14
#define FF_CMP_CHROMA 256
/**
* This callback is called at the beginning of each frame to get data
* buffer(s) for it. There may be one contiguous buffer for all the data or
- * there may be a buffer per each data plane or anything in between. Each
- * buffer must be reference-counted using the AVBuffer API.
+ * there may be a buffer per each data plane or anything in between. What
+ * this means is, you may set however many entries in buf[] you feel necessary.
+ * Each buffer must be reference-counted using the AVBuffer API (see description
+ * of buf[] below).
*
* The following fields will be set in the frame before this callback is
* called:
* extended_data must be allocated with av_malloc() and will be freed in
* av_frame_unref().
* * otherwise exended_data must point to data
- * - buf[] must contain references to the buffers that contain the frame
- * data.
+ * - buf[] must contain one or more pointers to AVBufferRef structures. Each of
+ * the frame's data and extended_data pointers must be contained in these. That
+ * is, one AVBufferRef for each allocated chunk of memory, not necessarily one
+ * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(),
+ * and av_buffer_ref().
* - extended_buf and nb_extended_buf must be allocated with av_malloc() by
* this callback and filled with the extra buffers if there are more
* buffers than buf[] can hold. extended_buf will be freed in
#define FF_IDCT_INT 1
#define FF_IDCT_SIMPLE 2
#define FF_IDCT_SIMPLEMMX 3
-#if FF_API_LIBMPEG2
-#define FF_IDCT_LIBMPEG2MMX 4
-#endif
-#if FF_API_MMI
-#define FF_IDCT_MMI 5
-#endif
#define FF_IDCT_ARM 7
#define FF_IDCT_ALTIVEC 8
#define FF_IDCT_SH4 9
#define FF_IDCT_FAAN 20
#define FF_IDCT_SIMPLENEON 22
#define FF_IDCT_SIMPLEALPHA 23
-#if FF_API_IDCT
-#define FF_IDCT_H264 11
-#define FF_IDCT_VP3 12
-#define FF_IDCT_CAVS 15
-#define FF_IDCT_WMV2 19
-#define FF_IDCT_EA 21
-#define FF_IDCT_BINK 24
-#endif
-
-#if FF_API_DSP_MASK
- /**
- * Unused.
- * @deprecated use av_set_cpu_flags_mask() instead.
- */
- attribute_deprecated unsigned dsp_mask;
-#endif
/**
* bits per sample/pixel from the demuxer (needed for huffyuv).
*/
int bits_per_raw_sample;
+#if FF_API_LOWRES
/**
* low resolution decoding, 1-> 1/2 size, 2->1/4 size
* - encoding: unused
* - decoding: Set by user.
+ *
+ * @deprecated use decoder private options instead
*/
attribute_deprecated int lowres;
+#endif
/**
* the picture in the bitstream
#define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0
+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1
+#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2
+#define FF_PROFILE_JPEG2000_DCINEMA_2K 3
+#define FF_PROFILE_JPEG2000_DCINEMA_4K 4
+
/**
* level
* - encoding: Set by user.
*
* @param avctx the codec context
* @param[out] frame The AVFrame in which to store decoded audio samples.
- * Decoders request a buffer of a particular size by setting
- * AVFrame.nb_samples prior to calling get_buffer(). The
- * decoder may, however, only utilize part of the buffer by
- * setting AVFrame.nb_samples to a smaller value in the
- * output frame.
+ * The decoder will allocate a buffer for the decoded frame by
+ * calling the AVCodecContext.get_buffer2() callback.
+ * When AVCodecContext.refcounted_frames is set to 1, the frame is
+ * reference counted and the returned reference belongs to the
+ * caller. The caller must release the frame using av_frame_unref()
+ * when the frame is no longer needed. The caller may safely write
+ * to the frame if av_frame_is_writable() returns 1.
+ * When AVCodecContext.refcounted_frames is set to 0, the returned
+ * reference belongs to the decoder and is valid only until the
+ * next call to this function or until closing the decoder.
+ * The caller may not write to it.
* @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
* non-zero.
* @param[in] avpkt The input AVPacket containing the input buffer.
*
* @param avctx the codec context
* @param[out] picture The AVFrame in which the decoded video frame will be stored.
- * Use avcodec_alloc_frame to get an AVFrame, the codec will
- * allocate memory for the actual bitmap.
- * with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit.
- * with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder
- * decodes and the decoder tells the user once it does not need the data anymore,
- * the user app can at this point free/reuse/keep the memory as it sees fit.
+ * Use av_frame_alloc() to get an AVFrame. The codec will
+ * allocate memory for the actual bitmap by calling the
+ * AVCodecContext.get_buffer2() callback.
+ * When AVCodecContext.refcounted_frames is set to 1, the frame is
+ * reference counted and the returned reference belongs to the
+ * caller. The caller must release the frame using av_frame_unref()
+ * when the frame is no longer needed. The caller may safely write
+ * to the frame if av_frame_is_writable() returns 1.
+ * When AVCodecContext.refcounted_frames is set to 0, the returned
+ * reference belongs to the decoder and is valid only until the
+ * next call to this function or until closing the decoder. The
+ * caller may not write to it.
*
* @param[in] avpkt The input AVpacket containing the input buffer.
* You can create such packet with av_init_packet() and by then setting
* For all other types, this is in units of AVCodecContext.time_base.
*/
int duration;
+
+ enum AVFieldOrder field_order;
} AVCodecParserContext;
typedef struct AVCodecParser {
* @}
*/
-#if FF_API_AVCODEC_RESAMPLE
-/**
- * @defgroup lavc_resample Audio resampling
- * @ingroup libavc
- * @deprecated use libavresample instead
- *
- * @{
- */
-struct ReSampleContext;
-struct AVResampleContext;
-
-typedef struct ReSampleContext ReSampleContext;
-
-/**
- * Initialize audio resampling context.
- *
- * @param output_channels number of output channels
- * @param input_channels number of input channels
- * @param output_rate output sample rate
- * @param input_rate input sample rate
- * @param sample_fmt_out requested output sample format
- * @param sample_fmt_in input sample format
- * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency
- * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
- * @param linear if 1 then the used FIR filter will be linearly interpolated
- between the 2 closest, if 0 the closest will be used
- * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
- * @return allocated ReSampleContext, NULL if error occurred
- */
-attribute_deprecated
-ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
- int output_rate, int input_rate,
- enum AVSampleFormat sample_fmt_out,
- enum AVSampleFormat sample_fmt_in,
- int filter_length, int log2_phase_count,
- int linear, double cutoff);
-
-attribute_deprecated
-int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
-
-/**
- * Free resample context.
- *
- * @param s a non-NULL pointer to a resample context previously
- * created with av_audio_resample_init()
- */
-attribute_deprecated
-void audio_resample_close(ReSampleContext *s);
-
-
-/**
- * Initialize an audio resampler.
- * Note, if either rate is not an integer then simply scale both rates up so they are.
- * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
- * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
- * @param linear If 1 then the used FIR filter will be linearly interpolated
- between the 2 closest, if 0 the closest will be used
- * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
- */
-attribute_deprecated
-struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
-
-/**
- * Resample an array of samples using a previously configured context.
- * @param src an array of unconsumed samples
- * @param consumed the number of samples of src which have been consumed are returned here
- * @param src_size the number of unconsumed samples available
- * @param dst_size the amount of space in samples available in dst
- * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
- * @return the number of samples written in dst or -1 if an error occurred
- */
-attribute_deprecated
-int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
-
-
-/**
- * Compensate samplerate/timestamp drift. The compensation is done by changing
- * the resampler parameters, so no audible clicks or similar distortions occur
- * @param compensation_distance distance in output samples over which the compensation should be performed
- * @param sample_delta number of output samples which should be output less
- *
- * example: av_resample_compensate(c, 10, 500)
- * here instead of 510 samples only 500 samples would be output
- *
- * note, due to rounding the actual compensation might be slightly different,
- * especially if the compensation_distance is large and the in_rate used during init is small
- */
-attribute_deprecated
-void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
-attribute_deprecated
-void av_resample_close(struct AVResampleContext *c);
-
-/**
- * @}
- */
-#endif
-
/**
* @addtogroup lavc_picture
* @{
int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
int has_alpha);
-#if FF_API_FIND_BEST_PIX_FMT
-/**
- * @deprecated use avcodec_find_best_pix_fmt2() instead.
- *
- * Find the best pixel format to convert to given a certain source pixel
- * format. When converting from one pixel format to another, information loss
- * may occur. For example, when converting from RGB24 to GRAY, the color
- * information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
- * the given pixel formats should be used to suffer the least amount of loss.
- * The pixel formats from which it chooses one, are determined by the
- * pix_fmt_mask parameter.
- *
- * @code
- * src_pix_fmt = AV_PIX_FMT_YUV420P;
- * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) || (1 << AV_PIX_FMT_RGB24);
- * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
- * @endcode
- *
- * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @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.
- */
-attribute_deprecated
-enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
-#endif /* FF_API_FIND_BEST_PIX_FMT */
-
/**
* Find the best pixel format to convert to given a certain source pixel
* format. When converting from one pixel format to another, information loss
*/
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
+#if FF_API_MISSING_SAMPLE
/**
* Log a generic warning message about a missing feature. This function is
* intended to be used internally by Libav (libavcodec, libavformat, etc.)
* If want_sample is non-zero, additional verbage will be added to the log
* message which tells the user how to report samples to the development
* mailing list.
+ * @deprecated Use avpriv_report_missing_feature() instead.
*/
+attribute_deprecated
void av_log_missing_feature(void *avc, const char *feature, int want_sample);
/**
* @param[in] avc a pointer to an arbitrary struct of which the first field is
* a pointer to an AVClass struct
* @param[in] msg string containing an optional message, or NULL if no message
+ * @deprecated Use avpriv_request_sample() instead.
*/
+attribute_deprecated
void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
+#endif /* FF_API_MISSING_SAMPLE */
/**
* Register the hardware accelerator hwaccel.