@@ -187,17 +187,6 @@ struct AVCodecParameters;
187187 * @{
188188 */
189189
190- #if FF_API_BUFFER_MIN_SIZE
191- /**
192- * @ingroup lavc_encoding
193- * minimum encoding buffer size
194- * Used to avoid some checks during header writing.
195- * @deprecated Unused: avcodec_receive_packet() does not work
196- * with preallocated packet buffers.
197- */
198- #define AV_INPUT_BUFFER_MIN_SIZE 16384
199- #endif
200-
201190/**
202191 * @ingroup lavc_encoding
203192 */
@@ -234,18 +223,9 @@ typedef struct RcOverride{
234223 * Use qpel MC.
235224 */
236225#define AV_CODEC_FLAG_QPEL (1 << 4)
237- #if FF_API_DROPCHANGED
238- /**
239- * Don't output frames whose parameters differ from first
240- * decoded frame in stream.
241- *
242- * @deprecated callers should implement this functionality in their own code
243- */
244- #define AV_CODEC_FLAG_DROPCHANGED (1 << 5)
245- #endif
246226/**
247227 * Request the encoder to output reconstructed frames, i.e.\ frames that would
248- * be produced by decoding the encoded bistream . These frames may be retrieved
228+ * be produced by decoding the encoded bitstream . These frames may be retrieved
249229 * by calling avcodec_receive_frame() immediately after a successful call to
250230 * avcodec_receive_packet().
251231 *
@@ -515,16 +495,21 @@ typedef struct AVCodecContext {
515495 int flags2 ;
516496
517497 /**
518- * some codecs need / can use extradata like Huffman tables.
519- * MJPEG: Huffman tables
520- * rv10: additional flags
521- * MPEG-4: global headers (they can be in the bitstream or here)
522- * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
523- * than extradata_size to avoid problems if it is read with the bitstream reader.
524- * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
525- * Must be allocated with the av_malloc() family of functions.
526- * - encoding: Set/allocated/freed by libavcodec.
527- * - decoding: Set/allocated/freed by user.
498+ * Out-of-band global headers that may be used by some codecs.
499+ *
500+ * - decoding: Should be set by the caller when available (typically from a
501+ * demuxer) before opening the decoder; some decoders require this to be
502+ * set and will fail to initialize otherwise.
503+ *
504+ * The array must be allocated with the av_malloc() family of functions;
505+ * allocated size must be at least AV_INPUT_BUFFER_PADDING_SIZE bytes
506+ * larger than extradata_size.
507+ *
508+ * - encoding: May be set by the encoder in avcodec_open2() (possibly
509+ * depending on whether the AV_CODEC_FLAG_GLOBAL_HEADER flag is set).
510+ *
511+ * After being set, the array is owned by the codec and freed in
512+ * avcodec_free_context().
528513 */
529514 uint8_t * extradata ;
530515 int extradata_size ;
@@ -565,23 +550,6 @@ typedef struct AVCodecContext {
565550 */
566551 AVRational framerate ;
567552
568- #if FF_API_TICKS_PER_FRAME
569- /**
570- * For some codecs, the time base is closer to the field rate than the frame rate.
571- * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
572- * if no telecine is used ...
573- *
574- * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
575- *
576- * @deprecated
577- * - decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS
578- * - encoding: Set AVCodecContext.framerate instead
579- *
580- */
581- attribute_deprecated
582- int ticks_per_frame ;
583- #endif
584-
585553 /**
586554 * Codec delay.
587555 *
@@ -1648,165 +1616,29 @@ typedef struct AVCodecContext {
16481616 * See the AV_PROFILE_* defines in defs.h.
16491617 */
16501618 int profile ;
1651- #if FF_API_FF_PROFILE_LEVEL
1652- /** @deprecated The following defines are deprecated; use AV_PROFILE_*
1653- * in defs.h instead. */
1654- #define FF_PROFILE_UNKNOWN -99
1655- #define FF_PROFILE_RESERVED -100
1656-
1657- #define FF_PROFILE_AAC_MAIN 0
1658- #define FF_PROFILE_AAC_LOW 1
1659- #define FF_PROFILE_AAC_SSR 2
1660- #define FF_PROFILE_AAC_LTP 3
1661- #define FF_PROFILE_AAC_HE 4
1662- #define FF_PROFILE_AAC_HE_V2 28
1663- #define FF_PROFILE_AAC_LD 22
1664- #define FF_PROFILE_AAC_ELD 38
1665- #define FF_PROFILE_MPEG2_AAC_LOW 128
1666- #define FF_PROFILE_MPEG2_AAC_HE 131
1667-
1668- #define FF_PROFILE_DNXHD 0
1669- #define FF_PROFILE_DNXHR_LB 1
1670- #define FF_PROFILE_DNXHR_SQ 2
1671- #define FF_PROFILE_DNXHR_HQ 3
1672- #define FF_PROFILE_DNXHR_HQX 4
1673- #define FF_PROFILE_DNXHR_444 5
1674-
1675- #define FF_PROFILE_DTS 20
1676- #define FF_PROFILE_DTS_ES 30
1677- #define FF_PROFILE_DTS_96_24 40
1678- #define FF_PROFILE_DTS_HD_HRA 50
1679- #define FF_PROFILE_DTS_HD_MA 60
1680- #define FF_PROFILE_DTS_EXPRESS 70
1681- #define FF_PROFILE_DTS_HD_MA_X 61
1682- #define FF_PROFILE_DTS_HD_MA_X_IMAX 62
1683-
1684-
1685- #define FF_PROFILE_EAC3_DDP_ATMOS 30
1686-
1687- #define FF_PROFILE_TRUEHD_ATMOS 30
1688-
1689- #define FF_PROFILE_MPEG2_422 0
1690- #define FF_PROFILE_MPEG2_HIGH 1
1691- #define FF_PROFILE_MPEG2_SS 2
1692- #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
1693- #define FF_PROFILE_MPEG2_MAIN 4
1694- #define FF_PROFILE_MPEG2_SIMPLE 5
1695-
1696- #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
1697- #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
1698-
1699- #define FF_PROFILE_H264_BASELINE 66
1700- #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
1701- #define FF_PROFILE_H264_MAIN 77
1702- #define FF_PROFILE_H264_EXTENDED 88
1703- #define FF_PROFILE_H264_HIGH 100
1704- #define FF_PROFILE_H264_HIGH_10 110
1705- #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
1706- #define FF_PROFILE_H264_MULTIVIEW_HIGH 118
1707- #define FF_PROFILE_H264_HIGH_422 122
1708- #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
1709- #define FF_PROFILE_H264_STEREO_HIGH 128
1710- #define FF_PROFILE_H264_HIGH_444 144
1711- #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
1712- #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
1713- #define FF_PROFILE_H264_CAVLC_444 44
1714-
1715- #define FF_PROFILE_VC1_SIMPLE 0
1716- #define FF_PROFILE_VC1_MAIN 1
1717- #define FF_PROFILE_VC1_COMPLEX 2
1718- #define FF_PROFILE_VC1_ADVANCED 3
1719-
1720- #define FF_PROFILE_MPEG4_SIMPLE 0
1721- #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
1722- #define FF_PROFILE_MPEG4_CORE 2
1723- #define FF_PROFILE_MPEG4_MAIN 3
1724- #define FF_PROFILE_MPEG4_N_BIT 4
1725- #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
1726- #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
1727- #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
1728- #define FF_PROFILE_MPEG4_HYBRID 8
1729- #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
1730- #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
1731- #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
1732- #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
1733- #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
1734- #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
1735- #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
1736-
1737- #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
1738- #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
1739- #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
1740- #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
1741- #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
1742-
1743- #define FF_PROFILE_VP9_0 0
1744- #define FF_PROFILE_VP9_1 1
1745- #define FF_PROFILE_VP9_2 2
1746- #define FF_PROFILE_VP9_3 3
1747-
1748- #define FF_PROFILE_HEVC_MAIN 1
1749- #define FF_PROFILE_HEVC_MAIN_10 2
1750- #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
1751- #define FF_PROFILE_HEVC_REXT 4
1752- #define FF_PROFILE_HEVC_SCC 9
1753-
1754- #define FF_PROFILE_VVC_MAIN_10 1
1755- #define FF_PROFILE_VVC_MAIN_10_444 33
1756-
1757- #define FF_PROFILE_AV1_MAIN 0
1758- #define FF_PROFILE_AV1_HIGH 1
1759- #define FF_PROFILE_AV1_PROFESSIONAL 2
1760-
1761- #define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
1762- #define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
1763- #define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
1764- #define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
1765- #define FF_PROFILE_MJPEG_JPEG_LS 0xf7
1766-
1767- #define FF_PROFILE_SBC_MSBC 1
1768-
1769- #define FF_PROFILE_PRORES_PROXY 0
1770- #define FF_PROFILE_PRORES_LT 1
1771- #define FF_PROFILE_PRORES_STANDARD 2
1772- #define FF_PROFILE_PRORES_HQ 3
1773- #define FF_PROFILE_PRORES_4444 4
1774- #define FF_PROFILE_PRORES_XQ 5
1775-
1776- #define FF_PROFILE_ARIB_PROFILE_A 0
1777- #define FF_PROFILE_ARIB_PROFILE_C 1
1778-
1779- #define FF_PROFILE_KLVA_SYNC 0
1780- #define FF_PROFILE_KLVA_ASYNC 1
1781-
1782- #define FF_PROFILE_EVC_BASELINE 0
1783- #define FF_PROFILE_EVC_MAIN 1
1784- #endif
17851619
17861620 /**
17871621 * Encoding level descriptor.
17881622 * - encoding: Set by user, corresponds to a specific level defined by the
17891623 * codec, usually corresponding to the profile level, if not specified it
1790- * is set to FF_LEVEL_UNKNOWN .
1624+ * is set to AV_LEVEL_UNKNOWN .
17911625 * - decoding: Set by libavcodec.
17921626 * See AV_LEVEL_* in defs.h.
17931627 */
17941628 int level ;
1795- #if FF_API_FF_PROFILE_LEVEL
1796- /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN
1797- * in defs.h instead. */
1798- #define FF_LEVEL_UNKNOWN -99
1799- #endif
18001629
1630+ #if FF_API_CODEC_PROPS
18011631 /**
18021632 * Properties of the stream that gets decoded
18031633 * - encoding: unused
18041634 * - decoding: set by libavcodec
18051635 */
1636+ attribute_deprecated
18061637 unsigned properties ;
18071638#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001
18081639#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002
18091640#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004
1641+ #endif
18101642
18111643 /**
18121644 * Skip loop filtering for selected frames.
@@ -1895,8 +1727,13 @@ typedef struct AVCodecContext {
18951727 * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
18961728 * [Script Info] and [V4+ Styles] section, plus the [Events] line and
18971729 * the Format line following. It shouldn't include any Dialogue line.
1898- * - encoding: Set/allocated/freed by user (before avcodec_open2())
1899- * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
1730+ *
1731+ * - encoding: May be set by the caller before avcodec_open2() to an array
1732+ * allocated with the av_malloc() family of functions.
1733+ * - decoding: May be set by libavcodec in avcodec_open2().
1734+ *
1735+ * After being set, the array is owned by the codec and freed in
1736+ * avcodec_free_context().
19001737 */
19011738 int subtitle_header_size ;
19021739 uint8_t * subtitle_header ;
@@ -2380,24 +2217,6 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
23802217 */
23812218int avcodec_open2 (AVCodecContext * avctx , const AVCodec * codec , AVDictionary * * options );
23822219
2383- #if FF_API_AVCODEC_CLOSE
2384- /**
2385- * Close a given AVCodecContext and free all the data associated with it
2386- * (but not the AVCodecContext itself).
2387- *
2388- * Calling this function on an AVCodecContext that hasn't been opened will free
2389- * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL
2390- * codec. Subsequent calls will do nothing.
2391- *
2392- * @deprecated Do not use this function. Use avcodec_free_context() to destroy a
2393- * codec context (either open or closed). Opening and closing a codec context
2394- * multiple times is not supported anymore -- use multiple codec contexts
2395- * instead.
2396- */
2397- attribute_deprecated
2398- int avcodec_close (AVCodecContext * avctx );
2399- #endif
2400-
24012220/**
24022221 * Free all allocated data in the given subtitle struct.
24032222 *
@@ -3081,7 +2900,7 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
30812900 *
30822901 * @note for encoders, this function will only do something if the encoder
30832902 * declares support for AV_CODEC_CAP_ENCODER_FLUSH. When called, the encoder
3084- * will drain any remaining packets, and can then be re-used for a different
2903+ * will drain any remaining packets, and can then be reused for a different
30852904 * stream (as opposed to sending a null frame which will leave the encoder
30862905 * in a permanent EOF state after draining). This can be desirable if the
30872906 * cost of tearing down and replacing the encoder instance is high.
@@ -3116,8 +2935,8 @@ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
31162935void av_fast_padded_mallocz (void * ptr , unsigned int * size , size_t min_size );
31172936
31182937/**
3119- * @return a positive value if s is open (i.e. avcodec_open2() was called on it
3120- * with no corresponding avcodec_close()), 0 otherwise.
2938+ * @return a positive value if s is open (i.e. avcodec_open2() was called on it),
2939+ * 0 otherwise.
31212940 */
31222941int avcodec_is_open (AVCodecContext * s );
31232942
0 commit comments