X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favcodec.h;h=ca062eda916d4e3fcde9d572d5914aa8695df061;hb=e37f161e66e042d6c2c7470c4d9881df9427fc4a;hp=eb6826bcb03991c28773cf31eeec9e21f4f59aac;hpb=b58dbb5b031c33cdb88f13cc533f623e82cdbcbd;p=ffmpeg diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index eb6826bcb03..ca062eda916 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1,20 +1,20 @@ /* * copyright (c) 2001 Fabrice Bellard * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -34,6 +34,7 @@ #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "libavutil/rational.h" +#include "libavutil/audioconvert.h" #include "libavcodec/version.h" /** @@ -78,7 +79,8 @@ * * If you add a codec ID to this list, add it so that * 1. no value of a existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs. + * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. + * This ensures that 2 forks can independantly add CodecIDs without producing conflicts. */ enum CodecID { CODEC_ID_NONE, @@ -246,14 +248,23 @@ enum CodecID { CODEC_ID_WMV3IMAGE, CODEC_ID_VC1IMAGE, #if LIBAVCODEC_VERSION_MAJOR == 53 - CODEC_ID_G723_1, - CODEC_ID_G729, + CODEC_ID_G723_1_DEPRECATED, + CODEC_ID_G729_DEPRECATED, #endif - CODEC_ID_UTVIDEO, + CODEC_ID_UTVIDEO_DEPRECATED, CODEC_ID_BMV_VIDEO, CODEC_ID_VBLE, CODEC_ID_DXTORY, CODEC_ID_V410, + CODEC_ID_XWD, + CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), + CODEC_ID_UTVIDEO = 0x800, + CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), + CODEC_ID_AVRP = MKBETAG('A','V','R','P'), + + CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), + CODEC_ID_V308 = MKBETAG('V','3','0','8'), + CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), /* various PCM "codecs" */ CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -316,6 +327,7 @@ enum CodecID { CODEC_ID_ADPCM_EA_MAXIS_XA, CODEC_ID_ADPCM_IMA_ISS, CODEC_ID_ADPCM_G722, + CODEC_ID_ADPCM_IMA_APC, /* AMR */ CODEC_ID_AMR_NB = 0x12000, @@ -344,10 +356,6 @@ enum CodecID { CODEC_ID_MACE3, CODEC_ID_MACE6, CODEC_ID_VMDAUDIO, -#if LIBAVCODEC_VERSION_MAJOR == 53 - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, -#endif CODEC_ID_FLAC, CODEC_ID_MP3ADU, CODEC_ID_MP3ON4, @@ -390,12 +398,18 @@ enum CodecID { CODEC_ID_QDMC, CODEC_ID_CELT, #if LIBAVCODEC_VERSION_MAJOR > 53 - CODEC_ID_G723_1, - CODEC_ID_G729, + CODEC_ID_G723_1_DEPRECATED, + CODEC_ID_G729_DEPRECATED, CODEC_ID_8SVX_EXP, CODEC_ID_8SVX_FIB, #endif CODEC_ID_BMV_AUDIO, + CODEC_ID_G729 = 0x15800, + CODEC_ID_G723_1= 0x15801, + CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), + CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), + CODEC_ID_SONIC = MKBETAG('S','O','N','C'), + CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), /* subtitle codecs */ CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -408,10 +422,14 @@ enum CodecID { CODEC_ID_HDMV_PGS_SUBTITLE, CODEC_ID_DVB_TELETEXT, CODEC_ID_SRT, + CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), /* other specific kind of codecs (generally used for attachments) */ CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. CODEC_ID_TTF = 0x18000, + CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), + CODEC_ID_XBIN = MKBETAG('X','B','I','N'), + CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it @@ -422,66 +440,6 @@ enum CodecID { CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. }; -#if FF_API_OLD_SAMPLE_FMT -#define SampleFormat AVSampleFormat - -#define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE -#define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8 -#define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16 -#define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32 -#define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT -#define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL -#define SAMPLE_FMT_NB AV_SAMPLE_FMT_NB -#endif - -#if FF_API_OLD_AUDIOCONVERT -#include "libavutil/audioconvert.h" - -/* Audio channel masks */ -#define CH_FRONT_LEFT AV_CH_FRONT_LEFT -#define CH_FRONT_RIGHT AV_CH_FRONT_RIGHT -#define CH_FRONT_CENTER AV_CH_FRONT_CENTER -#define CH_LOW_FREQUENCY AV_CH_LOW_FREQUENCY -#define CH_BACK_LEFT AV_CH_BACK_LEFT -#define CH_BACK_RIGHT AV_CH_BACK_RIGHT -#define CH_FRONT_LEFT_OF_CENTER AV_CH_FRONT_LEFT_OF_CENTER -#define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER -#define CH_BACK_CENTER AV_CH_BACK_CENTER -#define CH_SIDE_LEFT AV_CH_SIDE_LEFT -#define CH_SIDE_RIGHT AV_CH_SIDE_RIGHT -#define CH_TOP_CENTER AV_CH_TOP_CENTER -#define CH_TOP_FRONT_LEFT AV_CH_TOP_FRONT_LEFT -#define CH_TOP_FRONT_CENTER AV_CH_TOP_FRONT_CENTER -#define CH_TOP_FRONT_RIGHT AV_CH_TOP_FRONT_RIGHT -#define CH_TOP_BACK_LEFT AV_CH_TOP_BACK_LEFT -#define CH_TOP_BACK_CENTER AV_CH_TOP_BACK_CENTER -#define CH_TOP_BACK_RIGHT AV_CH_TOP_BACK_RIGHT -#define CH_STEREO_LEFT AV_CH_STEREO_LEFT -#define CH_STEREO_RIGHT AV_CH_STEREO_RIGHT - -/** Channel mask value used for AVCodecContext.request_channel_layout - to indicate that the user requests the channel order of the decoder output - to be the native codec channel order. */ -#define CH_LAYOUT_NATIVE AV_CH_LAYOUT_NATIVE - -/* Audio channel convenience macros */ -#define CH_LAYOUT_MONO AV_CH_LAYOUT_MONO -#define CH_LAYOUT_STEREO AV_CH_LAYOUT_STEREO -#define CH_LAYOUT_2_1 AV_CH_LAYOUT_2_1 -#define CH_LAYOUT_SURROUND AV_CH_LAYOUT_SURROUND -#define CH_LAYOUT_4POINT0 AV_CH_LAYOUT_4POINT0 -#define CH_LAYOUT_2_2 AV_CH_LAYOUT_2_2 -#define CH_LAYOUT_QUAD AV_CH_LAYOUT_QUAD -#define CH_LAYOUT_5POINT0 AV_CH_LAYOUT_5POINT0 -#define CH_LAYOUT_5POINT1 AV_CH_LAYOUT_5POINT1 -#define CH_LAYOUT_5POINT0_BACK AV_CH_LAYOUT_5POINT0_BACK -#define CH_LAYOUT_5POINT1_BACK AV_CH_LAYOUT_5POINT1_BACK -#define CH_LAYOUT_7POINT0 AV_CH_LAYOUT_7POINT0 -#define CH_LAYOUT_7POINT1 AV_CH_LAYOUT_7POINT1 -#define CH_LAYOUT_7POINT1_WIDE AV_CH_LAYOUT_7POINT1_WIDE -#define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX -#endif - #if FF_API_OLD_DECODE_AUDIO /* in bytes */ #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio @@ -494,7 +452,7 @@ enum CodecID { * Note: If the first 23 bits of the additional bytes are not 0, then damaged * MPEG bitstreams could cause overread and segfault. */ -#define FF_INPUT_BUFFER_PADDING_SIZE 8 +#define FF_INPUT_BUFFER_PADDING_SIZE 16 /** * minimum encoding buffer size @@ -546,6 +504,7 @@ enum AVColorTransferCharacteristic{ AVCOL_TRC_UNSPECIFIED=2, AVCOL_TRC_GAMMA22 =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM AVCOL_TRC_GAMMA28 =5, ///< also ITU-R BT470BG + AVCOL_TRC_SMPTE240M =7, AVCOL_TRC_NB , ///< Not part of ABI }; @@ -557,6 +516,7 @@ enum AVColorSpace{ AVCOL_SPC_BT470BG =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 AVCOL_SPC_SMPTE170M =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above AVCOL_SPC_SMPTE240M =7, + AVCOL_SPC_YCGCO =8, AVCOL_SPC_NB , ///< Not part of ABI }; @@ -583,20 +543,6 @@ enum AVChromaLocation{ AVCHROMA_LOC_NB , ///< Not part of ABI }; -#if FF_API_FLAC_GLOBAL_OPTS -/** - * LPC analysis type - */ -enum AVLPCType { - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB , ///< Not part of ABI -}; -#endif - enum AVAudioServiceType { AV_AUDIO_SERVICE_TYPE_MAIN = 0, AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, @@ -658,50 +604,10 @@ typedef struct RcOverride{ #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding. #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. +#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!! #define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. -/** - * @defgroup deprecated_flags Deprecated codec flags - * Use corresponding private codec options instead. - * @{ - */ -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC -#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC -#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning. -#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan. -#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector -#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000 -#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data. -#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table. -#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. -#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer. -#endif -#if FF_API_MJPEG_GLOBAL_OPTS -#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). -#endif -#if FF_API_X264_GLOBAL_OPTS -#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references. -#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames -#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock -#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform -#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip -#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters -#define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization -#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only) -#define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations. -#define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined. -#define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes. -#endif -#if FF_API_SNOW_GLOBAL_OPTS -#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). -#endif -#if FF_API_LAME_GLOBAL_OPTS -#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible -#endif -/** - * @} - */ +#define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe /* Unsupported options : * Syntax Arithmetic coding (SAC) @@ -717,18 +623,31 @@ typedef struct RcOverride{ * assume the buffer was allocated by avcodec_default_get_buffer. */ #define CODEC_CAP_DR1 0x0002 -#if FF_API_PARSE_FRAME -/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */ -#define CODEC_CAP_PARSE_ONLY 0x0004 -#endif #define CODEC_CAP_TRUNCATED 0x0008 /* Codec can export data for HW decoding (XvMC). */ #define CODEC_CAP_HWACCEL 0x0010 /** - * Codec has a nonzero delay and needs to be fed with avpkt->data=NULL, + * Encoder or decoder requires flushing with NULL input at the end in order to + * give the complete and correct output. + * + * NOTE: If this flag is not set, the codec is guaranteed to never be fed with + * with NULL data. The user can still send NULL data to the public encode + * or decode function, but libavcodec will not pass it along to the codec + * unless this flag is set. + * + * Decoders: + * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. If this is not set, the codec is guaranteed to never be fed - * with NULL data. + * returns frames. + * + * Encoders: + * The encoder needs to be fed with NULL data at the end of encoding until the + * encoder no longer returns data. + * + * NOTE: For encoders implementing the AVCodec.encode2() function, setting this + * flag also means that the encoder must set the pts and duration for + * each output packet. If this flag is not set, the pts and duration will + * be determined by libavcodec from the input frame. */ #define CODEC_CAP_DELAY 0x0020 /** @@ -761,10 +680,12 @@ typedef struct RcOverride{ * Codec should fill in channel configuration and samplerate instead of container */ #define CODEC_CAP_CHANNEL_CONF 0x0400 + /** * Codec is able to deal with negative linesizes */ #define CODEC_CAP_NEG_LINESIZES 0x0800 + /** * Codec supports frame-level multithreading. */ @@ -777,6 +698,18 @@ typedef struct RcOverride{ * Codec supports changed parameters at any point. */ #define CODEC_CAP_PARAM_CHANGE 0x4000 +/** + * Codec supports avctx->thread_count == 0 (auto). + */ +#define CODEC_CAP_AUTO_THREADS 0x8000 +/** + * Audio encoder supports receiving a different number of samples in each call. + */ +#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000 +/** + * Codec is lossless. + */ +#define CODEC_CAP_LOSSLESS 0x80000000 //The following defines may change, don't expect compatibility if you use them. #define MB_TYPE_INTRA4x4 0x0001 @@ -841,17 +774,6 @@ typedef struct AVPanScan{ #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. -#if FF_API_OLD_FF_PICT_TYPES -/* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */ -#define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra -#define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted -#define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted -#define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4 -#define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra -#define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted -#define FF_BI_TYPE AV_PICTURE_TYPE_BI -#endif - #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content. @@ -953,16 +875,15 @@ enum AVSideDataParamChangeFlags { /** * Audio Video Frame. * New fields can be added to the end of AVFRAME with minor version - * bumps. Removal, reordering and changes to existing fields require + * bumps. Similarly fields that are marked as to be only accessed by + * av_opt_ptr() can be reordered. This allows 2 forks to add fields + * without breaking compatibility with each other. + * Removal, reordering and changes in the remaining cases require * a major version bump. - * sizeof(AVFrame) must not be used outside libav*. + * sizeof(AVFrame) must not be used outside libavcodec. */ typedef struct AVFrame { -#if FF_API_DATA_POINTERS -#define AV_NUM_DATA_POINTERS 4 -#else #define AV_NUM_DATA_POINTERS 8 -#endif /** * pointer to the picture/channel planes. * This might be different from the first allocated byte @@ -1031,13 +952,6 @@ typedef struct AVFrame { */ int quality; -#if FF_API_AVFRAME_AGE - /** - * @deprecated unused - */ - attribute_deprecated int age; -#endif - /** * is this picture used as reference * The values for this are the same as the MpegEncContext.picture_structure @@ -1198,7 +1112,7 @@ typedef struct AVFrame { int64_t reordered_opaque; /** - * hardware accelerator private data (Libav-allocated) + * hardware accelerator private data (FFmpeg-allocated) * - encoding: unused * - decoding: Set by libavcodec */ @@ -1265,6 +1179,41 @@ typedef struct AVFrame { * - decoding: Read by user. */ AVRational sample_aspect_ratio; + + /** + * width and height of the video frame + * - encoding: unused + * - decoding: Read by user. + */ + int width, height; + + /** + * format of the frame, -1 if unknown or unset + * Values correspond to enum PixelFormat for video frames, + * enum AVSampleFormat for audio) + * - encoding: unused + * - decoding: Read by user. + */ + int format; + + /** + * frame timestamp estimated using various heuristics, in stream time base + * Code outside libavcodec should access this field using: + * av_opt_ptr(avcodec_get_frame_class(), frame, "best_effort_timestamp"); + * - encoding: unused + * - decoding: set by libavcodec, read by user. + */ + int64_t best_effort_timestamp; + + /** + * reordered pos from the last AVPacket that has been input into the decoder + * Code outside libavcodec should access this field using: + * av_opt_ptr(avcodec_get_frame_class(), frame, "pkt_pos"); + * - encoding: unused + * - decoding: Read by user. + */ + int64_t pkt_pos; + } AVFrame; struct AVCodecInternal; @@ -1283,6 +1232,8 @@ enum AVFieldOrder { * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major * version bump. + * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user + * applications. * sizeof(AVCodecContext) must not be used outside libav*. */ typedef struct AVCodecContext { @@ -1430,10 +1381,12 @@ typedef struct AVCodecContext { int frame_number; ///< audio or video frame number /** - * Number of frames the decoded output will be delayed relative to - * the encoded input. + * Encoding: Number of frames delay there will be from the encoder input to + * the decoder output. (we assume the decoder matches the spec) + * Decoding: Number of frames delay in addition to what a standard decoder + * as specified in the spec would produce. * - encoding: Set by libavcodec. - * - decoding: unused + * - decoding: Set by libavcodec. */ int delay; @@ -1612,21 +1565,6 @@ typedef struct AVCodecContext { */ float b_quant_offset; -#if FF_API_ER - /** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - */ - attribute_deprecated int error_recognition; -#define FF_ER_CAREFUL 1 -#define FF_ER_COMPLIANT 2 -#define FF_ER_AGGRESSIVE 3 -#define FF_ER_VERY_AGGRESSIVE 4 -#define FF_ER_EXPLODE 5 -#endif /* FF_API_ER */ - /** * Called at the beginning of each frame to get a buffer for it. * @@ -1709,16 +1647,6 @@ typedef struct AVCodecContext { */ int block_align; -#if FF_API_PARSE_FRAME - /** - * If true, only parsing is done. The frame data is returned. - * Only MPEG audio decoders support this now. - * - encoding: unused - * - decoding: Set by user - */ - attribute_deprecated int parse_only; -#endif - /** * 0-> h263 quant 1-> mpeg quant * - encoding: Set by user. @@ -2142,22 +2070,6 @@ typedef struct AVCodecContext { */ int color_table_id; -#if FF_API_INTERNAL_CONTEXT - /** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - */ - attribute_deprecated int internal_buffer_count; - - /** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - */ - attribute_deprecated void *internal_buffer; -#endif - /** * Global quality for codecs which cannot change it per frame. * This should be proportional to MPEG-1/2/4 qscale. @@ -2264,15 +2176,6 @@ typedef struct AVCodecContext { */ int lmax; -#if FF_API_PALETTE_CONTROL - /** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - */ - struct AVPaletteControl *palctrl; -#endif - /** * noise reduction strength * - encoding: Set by user. @@ -2322,19 +2225,6 @@ typedef struct AVCodecContext { */ int error_rate; -#if FF_API_ANTIALIAS_ALGO - /** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - */ - attribute_deprecated int antialias_algo; -#define FF_AA_AUTO 0 -#define FF_AA_FASTINT 1 //not implemented yet -#define FF_AA_INT 2 -#define FF_AA_FLOAT 3 -#endif - /** * quantizer noise shaping * - encoding: Set by user. @@ -2593,24 +2483,6 @@ typedef struct AVCodecContext { */ int brd_scale; -#if FF_API_X264_GLOBAL_OPTS - /** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'crf' libx264 private option - */ - attribute_deprecated float crf; - - /** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'cqp' libx264 private option - */ - attribute_deprecated int cqp; -#endif - /** * minimum GOP size * - encoding: Set by user. @@ -2632,15 +2504,6 @@ typedef struct AVCodecContext { */ int chromaoffset; -#if FF_API_X264_GLOBAL_OPTS - /** - * Influence how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int bframebias; -#endif - /** * trellis RD quantization * - encoding: Set by user. @@ -2648,50 +2511,6 @@ typedef struct AVCodecContext { */ int trellis; -#if FF_API_X264_GLOBAL_OPTS - /** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated float complexityblur; - - /** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int deblockalpha; - - /** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int deblockbeta; - - /** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int partitions; -#define X264_PART_I4X4 0x001 /* Analyze i4x4 */ -#define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */ -#define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */ -#define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */ -#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */ - - /** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int directpred; -#endif - /** * Audio cutoff bandwidth (0 means "automatic") * - encoding: Set by user. @@ -2740,47 +2559,10 @@ typedef struct AVCodecContext { */ int max_prediction_order; -#if FF_API_FLAC_GLOBAL_OPTS - /** - * @name FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - */ - - /** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int lpc_coeff_precision; - - /** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int prediction_order_method; - /** - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int min_partition_order; - - /** - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int max_partition_order; - /** - * @} - */ -#endif - - /** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user. - * - decoding: unused + * GOP timecode frame start number + * - encoding: Set by user, in non drop frame format + * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) */ int64_t timecode_frame_start; @@ -2794,17 +2576,6 @@ typedef struct AVCodecContext { int request_channels; #endif -#if FF_API_DRC_SCALE - /** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - * @deprecated use AC3 decoder private option instead. - */ - attribute_deprecated float drc_scale; -#endif - /** * opaque 64bit number (generally a PTS) that will be reordered and * output in AVFrame.reordered_opaque @@ -2824,7 +2595,7 @@ typedef struct AVCodecContext { /** * Audio channel layout. * - encoding: set by user. - * - decoding: set by libavcodec. + * - decoding: set by user, may be overwritten by libavcodec. */ uint64_t channel_layout; @@ -2869,8 +2640,8 @@ typedef struct AVCodecContext { * Hardware accelerator context. * For some hardware accelerators, a global context needs to be * provided by the user. In that case, this holds display-dependent - * data Libav cannot instantiate itself. Please refer to the - * Libav HW accelerator documentation to know how to fill this + * data FFmpeg cannot instantiate itself. Please refer to the + * FFmpeg HW accelerator documentation to know how to fill this * is. e.g. for VA API, this is a struct vaapi_context. * - encoding: unused * - decoding: Set by user @@ -2932,87 +2703,8 @@ typedef struct AVCodecContext { */ int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); -#if FF_API_X264_GLOBAL_OPTS - /** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int weighted_p_pred; - - /** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int aq_mode; - - /** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated float aq_strength; - - /** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated float psy_rd; - - /** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated float psy_trellis; - - /** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int rc_lookahead; - - /** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated float crf_max; -#endif - int log_level_offset; -#if FF_API_FLAC_GLOBAL_OPTS - /** - * Determine which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated enum AVLPCType lpc_type; - - /** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int lpc_passes; -#endif - /** * Number of slices. * Indicates number of picture subdivisions. Used for parallelized @@ -3042,19 +2734,6 @@ typedef struct AVCodecContext { */ AVPacket *pkt; -#if FF_API_INTERNAL_CONTEXT - /** - * Whether this is a copy of the context which had init() called on it. - * This is used by multithreading - shared tables and picture pointers - * should be freed from the original context only. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - * - * @deprecated this field has been moved to an internal context - */ - attribute_deprecated int is_copy; -#endif - /** * Which multithreading methods to use. * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, @@ -3100,9 +2779,10 @@ typedef struct AVCodecContext { enum AVAudioServiceType audio_service_type; /** - * Used to request a sample format from the decoder. - * - encoding: unused. + * desired sample format + * - encoding: Not used. * - decoding: Set by user. + * Decoder will decode to this format if it can. */ enum AVSampleFormat request_sample_fmt; @@ -3117,6 +2797,10 @@ typedef struct AVCodecContext { #define AV_EF_BUFFER (1<<2) #define AV_EF_EXPLODE (1<<3) +#define AV_EF_CAREFUL (1<<16) +#define AV_EF_COMPLIANT (1<<17) +#define AV_EF_AGGRESSIVE (1<<18) + /** * Private context used for internal data. * @@ -3130,6 +2814,17 @@ typedef struct AVCodecContext { * - decoding: Set by libavcodec */ enum AVFieldOrder field_order; + + /** + * Current statistics for PTS correction. + * - decoding: maintained and used by libavcodec, not intended to be used by user apps + * - encoding: unused + */ + int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far + int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far + int64_t pts_correction_last_pts; /// PTS of the last frame + int64_t pts_correction_last_dts; /// DTS of the last frame + } AVCodecContext; /** @@ -3214,6 +2909,19 @@ typedef struct AVCodec { * Initialize codec static data, called from avcodec_register(). */ void (*init_static_data)(struct AVCodec *codec); + + /** + * Encode data to an AVPacket. + * + * @param avctx codec context + * @param avpkt output AVPacket (may contain a user-provided buffer) + * @param[in] frame AVFrame containing the raw data to be encoded + * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a + * non-empty packet was returned in avpkt. + * @return 0 on success, negative error code on failure + */ + int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, + int *got_packet_ptr); } AVCodec; /** @@ -3317,29 +3025,6 @@ typedef struct AVPicture { #define AVPALETTE_SIZE 1024 #define AVPALETTE_COUNT 256 -#if FF_API_PALETTE_CONTROL -/** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - */ -typedef struct AVPaletteControl { - - /* Demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0. */ - int palette_changed; - - /* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from an IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled. */ - unsigned int palette[AVPALETTE_COUNT]; - -} AVPaletteControl attribute_deprecated; -#endif enum AVSubtitleType { SUBTITLE_NONE, @@ -3472,6 +3157,11 @@ uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size); +int av_packet_merge_side_data(AVPacket *pkt); + +int av_packet_split_side_data(AVPacket *pkt); + + /* resample.c */ struct ReSampleContext; @@ -3629,13 +3319,11 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); -#if FF_API_GET_PIX_FMT_NAME /** - * @deprecated Deprecated in favor of av_get_pix_fmt_name(). + * Get the name of a codec. + * @return a static string identifying the codec; never NULL */ -attribute_deprecated -const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); -#endif +const char *avcodec_get_name(enum CodecID id); void avcodec_set_dimensions(AVCodecContext *s, int width, int height); @@ -3677,7 +3365,8 @@ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_ta * @param[in] dst_pix_fmt destination pixel format * @param[in] src_pix_fmt source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur. + * @return Combination of flags informing you what kind of losses will occur + * (maximum loss for an invalid dst_pix_fmt). */ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt, int has_alpha); @@ -3692,9 +3381,11 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ * The pixel formats from which it chooses one, are determined by the * pix_fmt_mask parameter. * + * Note, only the first 64 pixel formats will fit in pix_fmt_mask. + * * @code * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); + * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); * @endcode * @@ -3707,18 +3398,39 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); -#if FF_API_GET_ALPHA_INFO -#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ -#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ - /** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants + * Find the best pixel format to convert to given a certain source pixel + * format and a selection of two destination pixel formats. 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_fmt2() selects which of + * the given pixel formats should be used to suffer the least amount of loss. + * + * If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be + * returned. + * + * @code + * src_pix_fmt = PIX_FMT_YUV420P; + * dst_pix_fmt1= PIX_FMT_RGB24; + * dst_pix_fmt2= PIX_FMT_GRAY8; + * dst_pix_fmt3= PIX_FMT_RGB8; + * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. + * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); + * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); + * @endcode + * + * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from + * @param[in] dst_pix_fmt2 The other of the two destination pixel formats 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[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. + * NULL or value of zero means we care about all losses. Out: the loss + * that occurs when converting from src to selected dst pixel format. + * @return The best pixel format to convert to or -1 if none was found. */ -attribute_deprecated -int img_get_alpha_info(const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height); -#endif +enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2, + enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); + /* deinterlace a picture */ /* deinterlace - if not supported return -1 */ @@ -3749,15 +3461,6 @@ const char *avcodec_configuration(void); */ const char *avcodec_license(void); -#if FF_API_AVCODEC_INIT -/** - * @deprecated this function is called automatically from avcodec_register() - * and avcodec_register_all(), there is no need to call it manually - */ -attribute_deprecated -void avcodec_init(void); -#endif - /** * Register the codec codec and initialize libavcodec. * @@ -3934,14 +3637,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); -#if FF_API_THREAD_INIT -/** - * @deprecated Set s->thread_count before calling avcodec_open2() instead of calling this. - */ -attribute_deprecated -int avcodec_thread_init(AVCodecContext *s, int thread_count); -#endif - int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); //FIXME func typedef @@ -4038,6 +3733,11 @@ int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that * no overreading happens for damaged MPEG streams. * + * @warning You must not provide a custom get_buffer() when using + * avcodec_decode_audio3(). Doing so will override it with + * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, + * which does allow the application to provide a custom get_buffer(). + * * @note You might have to align the input buffer avpkt->data and output buffer * samples. The alignment requirements depend on the CPU: On some CPUs it isn't * necessary at all, on others it won't work at all if not aligned and on others @@ -4147,7 +3847,7 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, */ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, - AVPacket *avpkt); + const AVPacket *avpkt); /** * Decode a subtitle message. @@ -4176,13 +3876,16 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, */ void avsubtitle_free(AVSubtitle *sub); +#if FF_API_OLD_ENCODE_AUDIO /** * Encode an audio frame from samples into buf. * + * @deprecated Use avcodec_encode_audio2 instead. + * * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for PCM audio the user will know how much space is needed - * because it depends on the value passed in buf_size as described - * below. In that case a lower value can be used. + * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user + * will know how much space is needed because it depends on the value passed + * in buf_size as described below. In that case a lower value can be used. * * @param avctx the codec context * @param[out] buf the output buffer @@ -4190,13 +3893,79 @@ void avsubtitle_free(AVSubtitle *sub); * @param[in] samples the input buffer containing the samples * The number of samples read from this buffer is frame_size*channels, * both of which are defined in avctx. - * For PCM audio the number of samples read from samples is equal to - * buf_size * input_sample_size / output_sample_size. + * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of + * samples read from samples is equal to: + * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) + * This also implies that av_get_bits_per_sample() must not return 0 for these + * codecs. * @return On error a negative value is returned, on success zero or the number * of bytes used to encode the data read from the input buffer. */ -int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, - const short *samples); +int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx, + uint8_t *buf, int buf_size, + const short *samples); +#endif + +/** + * Encode a frame of audio. + * + * Takes input samples from frame and writes the next output packet, if + * available, to avpkt. The output packet does not necessarily contain data for + * the most recent frame, as encoders can delay, split, and combine input frames + * internally as needed. + * + * @param avctx codec context + * @param avpkt output AVPacket. + * The user can supply an output buffer by setting + * avpkt->data and avpkt->size prior to calling the + * function, but if the size of the user-provided data is not + * large enough, encoding will fail. All other AVPacket fields + * will be reset by the encoder using av_init_packet(). If + * avpkt->data is NULL, the encoder will allocate it. + * The encoder will set avpkt->size to the size of the + * output packet. + * @param[in] frame AVFrame containing the raw audio data to be encoded. + * May be NULL when flushing an encoder that has the + * CODEC_CAP_DELAY capability set. + * There are 2 codec capabilities that affect the allowed + * values of frame->nb_samples. + * If CODEC_CAP_SMALL_LAST_FRAME is set, then only the final + * frame may be smaller than avctx->frame_size, and all other + * frames must be equal to avctx->frame_size. + * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame + * can have any number of samples. + * If neither is set, frame->nb_samples must be equal to + * avctx->frame_size for all frames. + * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the + * output packet is non-empty, and to 0 if it is + * empty. If the function returns an error, the + * packet can be assumed to be invalid, and the + * value of got_packet_ptr is undefined and should + * not be used. + * @return 0 on success, negative error code on failure + */ +int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, + const AVFrame *frame, int *got_packet_ptr); + +/** + * Fill audio frame data and linesize. + * AVFrame extended_data channel pointers are allocated if necessary for + * planar audio. + * + * @param frame the AVFrame + * frame->nb_samples must be set prior to calling the + * function. This function fills in frame->data, + * frame->extended_data, frame->linesize[0]. + * @param nb_channels channel count + * @param sample_fmt sample format + * @param buf buffer to use for frame data + * @param buf_size size of buffer + * @param align plane size sample alignment + * @return 0 on success, negative error code on failure + */ +int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, + enum AVSampleFormat sample_fmt, const uint8_t *buf, + int buf_size, int align); /** * Encode a video frame from pict into buf. @@ -4238,18 +4007,6 @@ void avcodec_default_free_buffers(AVCodecContext *s); /* misc useful functions */ -#if FF_API_OLD_FF_PICT_TYPES -/** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - * @deprecated Use av_get_picture_type_char() instead. - */ -attribute_deprecated -char av_get_pict_type_char(int pict_type); -#endif - /** * Return codec bits per sample. * @@ -4258,14 +4015,6 @@ char av_get_pict_type_char(int pict_type); */ int av_get_bits_per_sample(enum CodecID codec_id); -#if FF_API_OLD_SAMPLE_FMT -/** - * @deprecated Use av_get_bytes_per_sample() instead. - */ -attribute_deprecated -int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt); -#endif - /* frame parsing */ typedef struct AVCodecParserContext { void *priv_data; @@ -4507,6 +4256,15 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size); */ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size); +/** + * Same behaviour av_fast_malloc but the buffer has additional + * FF_INPUT_PADDING_SIZE at the end which will will always be 0. + * + * In addition the whole buffer will initially and after resizes + * be 0-initialized so that no uninitialized data will ever appear. + */ +void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size); + /** * Copy image src to dst. Wraps av_picture_data_copy() above. */ @@ -4536,7 +4294,7 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v); /** * Log a generic warning message about a missing feature. This function is - * intended to be used internally by Libav (libavcodec, libavformat, etc.) + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct @@ -4550,7 +4308,7 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample); /** * Log a generic warning message asking for a sample. This function is - * intended to be used internally by Libav (libavcodec, libavformat, etc.) + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct @@ -4587,7 +4345,7 @@ enum AVLockOp { * lockmgr should store/get a pointer to a user allocated mutex. It's * NULL upon AV_LOCK_CREATE and != NULL for all other ops. * - * @param cb User defined callback. Note: Libav may invoke calls to this + * @param cb User defined callback. Note: FFmpeg may invoke calls to this * callback during the call to av_lockmgr_register(). * Thus, the application must be prepared to handle that. * If cb is set to NULL the lockmgr will be unregistered. @@ -4609,4 +4367,12 @@ enum AVMediaType avcodec_get_type(enum CodecID codec_id); */ const AVClass *avcodec_get_class(void); +/** + * Get the AVClass for AVFrame. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *avcodec_get_frame_class(void); + #endif /* AVCODEC_AVCODEC_H */