FFmpeg  1.2.12
avcodec.h
Go to the documentation of this file.
1 /*
2  * copyright (c) 2001 Fabrice Bellard
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_AVCODEC_H
22 #define AVCODEC_AVCODEC_H
23 
29 #include <errno.h>
30 #include "libavutil/samplefmt.h"
31 #include "libavutil/avutil.h"
32 #include "libavutil/cpu.h"
33 #include "libavutil/channel_layout.h"
34 #include "libavutil/dict.h"
35 #include "libavutil/log.h"
36 #include "libavutil/pixfmt.h"
37 #include "libavutil/rational.h"
38 
39 #include "libavcodec/version.h"
97 enum AVCodecID {
99 
100  /* video codecs */
271  AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
272  AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
273  AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
274  AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'),
275  AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
276 
277  AV_CODEC_ID_012V = MKBETAG('0','1','2','V'),
278  AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
279  AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
280  AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
281  AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'),
282  AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'),
283  AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'),
284  AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
285  AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'),
286  AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
287  AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'),
288  AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'),
289  AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'),
290  AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'),
291  AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'),
292  AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'),
293 
294  /* various PCM "codecs" */
327 
328  /* various ADPCM codecs */
359  AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
360  AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '),
361  AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '),
362 
363  /* AMR */
366 
367  /* RealAudio codecs*/
370 
371  /* various DPCM codecs */
376 
377  /* audio codecs */
378  AV_CODEC_ID_MP2 = 0x15000,
408  AV_CODEC_ID_GSM_MS, /* as found in WAV */
442  AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
443 #if LIBAVCODEC_VERSION_MAJOR <= 54
444  AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
445 #endif
446  AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
447  AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
448  AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
449  AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
450  AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'),
451  AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'),
452  AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'),
453 
454  /* subtitle codecs */
465  AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
466  AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
467  AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
468  AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
469  AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
470  AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'),
471  AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
472  AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'),
473  AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'),
474  AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'),
475  AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'),
476  AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'),
477 
478  /* other specific kind of codecs (generally used for attachments) */
480  AV_CODEC_ID_TTF = 0x18000,
481  AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
482  AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
483  AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
484  AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
485  AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'),
486 
487  AV_CODEC_ID_PROBE = 0x19000,
488 
494 
495 #if FF_API_CODEC_ID
496 #include "old_codec_ids.h"
497 #endif
498 };
499 
500 #if FF_API_CODEC_ID
501 #define CodecID AVCodecID
502 #endif
503 
509 typedef struct AVCodecDescriptor {
510  enum AVCodecID id;
511  enum AVMediaType type;
517  const char *name;
521  const char *long_name;
525  int props;
527 
532 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
533 
538 #define AV_CODEC_PROP_LOSSY (1 << 1)
539 
542 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
543 
546 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
547 
548 #if FF_API_OLD_DECODE_AUDIO
549 /* in bytes */
550 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
551 #endif
552 
561 #define FF_INPUT_BUFFER_PADDING_SIZE 16
562 
568 #define FF_MIN_BUFFER_SIZE 16384
569 
570 
576  ME_ZERO = 1,
586 };
587 
592  /* We leave some space between them for extensions (drop some
593  * keyframes for intra-only or drop just some bidir frames). */
600 };
601 
611 };
612 
620 };
621 
632 };
633 #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
634 
640 };
641 
656 };
657 
669 };
670 
674 typedef struct RcOverride{
675  int start_frame;
676  int end_frame;
677  int qscale; // If this is 0 then quality_factor will be used instead.
678  float quality_factor;
679 } RcOverride;
680 
681 #define FF_MAX_B_FRAMES 16
682 
683 /* encoding support
684  These flags can be passed in AVCodecContext.flags before initialization.
685  Note: Not everything is supported yet.
686 */
687 
688 #define CODEC_FLAG_QSCALE 0x0002
689 #define CODEC_FLAG_4MV 0x0004
690 #define CODEC_FLAG_QPEL 0x0010
691 #define CODEC_FLAG_GMC 0x0020
692 #define CODEC_FLAG_MV0 0x0040
693 
698 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
699 #define CODEC_FLAG_PASS1 0x0200
700 #define CODEC_FLAG_PASS2 0x0400
701 #define CODEC_FLAG_GRAY 0x2000
702 #define CODEC_FLAG_EMU_EDGE 0x4000
703 #define CODEC_FLAG_PSNR 0x8000
704 #define CODEC_FLAG_TRUNCATED 0x00010000
706 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
707 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
708 #define CODEC_FLAG_LOW_DELAY 0x00080000
709 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
710 #define CODEC_FLAG_BITEXACT 0x00800000
711 /* Fx : Flag for h263+ extra options */
712 #define CODEC_FLAG_AC_PRED 0x01000000
713 #define CODEC_FLAG_LOOP_FILTER 0x00000800
714 #define CODEC_FLAG_INTERLACED_ME 0x20000000
715 #define CODEC_FLAG_CLOSED_GOP 0x80000000
716 #define CODEC_FLAG2_FAST 0x00000001
717 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
718 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
719 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
720 #define CODEC_FLAG2_IGNORE_CROP 0x00010000
721 
722 #if FF_API_MPV_GLOBAL_OPTS
723 #define CODEC_FLAG_CBP_RD 0x04000000
724 #define CODEC_FLAG_QP_RD 0x08000000
725 #define CODEC_FLAG2_STRICT_GOP 0x00000002
726 #define CODEC_FLAG2_SKIP_RD 0x00004000
727 #endif
728 #define CODEC_FLAG2_CHUNKS 0x00008000
729 #define CODEC_FLAG2_SHOW_ALL 0x00400000
730 
731 /* Unsupported options :
732  * Syntax Arithmetic coding (SAC)
733  * Reference Picture Selection
734  * Independent Segment Decoding */
735 /* /Fx */
736 /* codec capabilities */
738 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
739 
744 #define CODEC_CAP_DR1 0x0002
745 #define CODEC_CAP_TRUNCATED 0x0008
746 /* Codec can export data for HW decoding (XvMC). */
747 #define CODEC_CAP_HWACCEL 0x0010
748 
771 #define CODEC_CAP_DELAY 0x0020
772 
776 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
777 
780 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
781 
792 #define CODEC_CAP_SUBFRAMES 0x0100
793 
797 #define CODEC_CAP_EXPERIMENTAL 0x0200
798 
801 #define CODEC_CAP_CHANNEL_CONF 0x0400
802 
806 #define CODEC_CAP_NEG_LINESIZES 0x0800
807 
811 #define CODEC_CAP_FRAME_THREADS 0x1000
812 
815 #define CODEC_CAP_SLICE_THREADS 0x2000
816 
819 #define CODEC_CAP_PARAM_CHANGE 0x4000
820 
823 #define CODEC_CAP_AUTO_THREADS 0x8000
824 
827 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
828 
831 #define CODEC_CAP_INTRA_ONLY 0x40000000
832 
835 #define CODEC_CAP_LOSSLESS 0x80000000
836 
837 //The following defines may change, don't expect compatibility if you use them.
838 #define MB_TYPE_INTRA4x4 0x0001
839 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
840 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
841 #define MB_TYPE_16x16 0x0008
842 #define MB_TYPE_16x8 0x0010
843 #define MB_TYPE_8x16 0x0020
844 #define MB_TYPE_8x8 0x0040
845 #define MB_TYPE_INTERLACED 0x0080
846 #define MB_TYPE_DIRECT2 0x0100 //FIXME
847 #define MB_TYPE_ACPRED 0x0200
848 #define MB_TYPE_GMC 0x0400
849 #define MB_TYPE_SKIP 0x0800
850 #define MB_TYPE_P0L0 0x1000
851 #define MB_TYPE_P1L0 0x2000
852 #define MB_TYPE_P0L1 0x4000
853 #define MB_TYPE_P1L1 0x8000
854 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
855 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
856 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
857 #define MB_TYPE_QUANT 0x00010000
858 #define MB_TYPE_CBP 0x00020000
859 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
860 
866 typedef struct AVPanScan{
872  int id;
873 
879  int width;
880  int height;
881 
887  int16_t position[3][2];
888 }AVPanScan;
890 #define FF_QSCALE_TYPE_MPEG1 0
891 #define FF_QSCALE_TYPE_MPEG2 1
892 #define FF_QSCALE_TYPE_H264 2
893 #define FF_QSCALE_TYPE_VP56 3
895 #define FF_BUFFER_TYPE_INTERNAL 1
896 #define FF_BUFFER_TYPE_USER 2
897 #define FF_BUFFER_TYPE_SHARED 4
898 #define FF_BUFFER_TYPE_COPY 8
900 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
901 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
902 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
903 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
904 
914 
931 
952 
963 
973 
979 
990 
998 };
999 
1022 typedef struct AVPacket {
1032  int64_t pts;
1038  int64_t dts;
1039  uint8_t *data;
1040  int size;
1041  int stream_index;
1045  int flags;
1050  struct {
1051  uint8_t *data;
1052  int size;
1054  } *side_data;
1055  int side_data_elems;
1056 
1061  int duration;
1062  void (*destruct)(struct AVPacket *);
1063  void *priv;
1064  int64_t pos;
1065 
1083  int64_t convergence_duration;
1085 #define AV_PKT_FLAG_KEY 0x0001
1086 #define AV_PKT_FLAG_CORRUPT 0x0002
1093 };
1116 typedef struct AVFrame {
1117 #define AV_NUM_DATA_POINTERS 8
1118 
1125 
1136 
1156 
1162  int width, height;
1163 
1169  int nb_samples;
1170 
1178  int format;
1179 
1185  int key_frame;
1186 
1192  enum AVPictureType pict_type;
1193 
1201 
1208 
1215  int64_t pts;
1216 
1222  int64_t pkt_pts;
1223 
1229  int64_t pkt_dts;
1230 
1243 
1249  int quality;
1250 
1259  int reference;
1260 
1266  int8_t *qscale_table;
1272  int qstride;
1273 
1277  int qscale_type;
1278 
1286 
1299  int16_t (*motion_val[2])[2];
1300 
1307  uint32_t *mb_type;
1308 
1314  short *dct_coeff;
1315 
1322  int8_t *ref_index[2];
1323 
1329  void *opaque;
1330 
1336  uint64_t error[AV_NUM_DATA_POINTERS];
1337 
1344  int type;
1345 
1352  int repeat_pict;
1353 
1359  int interlaced_frame;
1360 
1366  int top_field_first;
1367 
1373  int palette_has_changed;
1374 
1380  int buffer_hints;
1381 
1388 
1400  int64_t reordered_opaque;
1401 
1408 
1414  struct AVCodecContext *owner;
1415 
1421  void *thread_opaque;
1422 
1430 
1437  int sample_rate;
1438 
1445  uint64_t channel_layout;
1446 
1454  int64_t best_effort_timestamp;
1455 
1463  int64_t pkt_pos;
1464 
1473  int64_t pkt_duration;
1474 
1483 
1494 #define FF_DECODE_ERROR_INVALID_BITSTREAM 1
1495 #define FF_DECODE_ERROR_MISSING_REFERENCE 2
1496 
1504  int channels;
1505 
1514  int pkt_size;
1515 } AVFrame;
1516 
1524 int64_t av_frame_get_pkt_duration (const AVFrame *frame);
1525 void av_frame_set_pkt_duration (AVFrame *frame, int64_t val);
1526 int64_t av_frame_get_pkt_pos (const AVFrame *frame);
1527 void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
1528 int64_t av_frame_get_channel_layout (const AVFrame *frame);
1529 void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
1530 int av_frame_get_channels (const AVFrame *frame);
1531 void av_frame_set_channels (AVFrame *frame, int val);
1533 void av_frame_set_sample_rate (AVFrame *frame, int val);
1538 int av_frame_get_pkt_size(const AVFrame *frame);
1539 void av_frame_set_pkt_size(AVFrame *frame, int val);
1540 
1541 struct AVCodecInternal;
1546  AV_FIELD_TT, //< Top coded_first, top displayed first
1547  AV_FIELD_BB, //< Bottom coded first, bottom displayed first
1548  AV_FIELD_TB, //< Top coded first, bottom displayed first
1549  AV_FIELD_BT, //< Bottom coded first, top displayed first
1550 };
1551 
1561 typedef struct AVCodecContext {
1566  const AVClass *av_class;
1567  int log_level_offset;
1568 
1569  enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
1570  const struct AVCodec *codec;
1571  char codec_name[32];
1572  enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
1573 
1587  unsigned int codec_tag;
1588 
1595  unsigned int stream_codec_tag;
1596 
1597 #if FF_API_SUB_ID
1598 
1601  attribute_deprecated int sub_id;
1602 #endif
1603 
1604  void *priv_data;
1605 
1612  struct AVCodecInternal *internal;
1613 
1619  void *opaque;
1620 
1626  int bit_rate;
1627 
1634  int bit_rate_tolerance;
1635 
1642  int global_quality;
1643 
1649 #define FF_COMPRESSION_DEFAULT -1
1650 
1656  int flags;
1657 
1663  int flags2;
1664 
1676  uint8_t *extradata;
1677  int extradata_size;
1678 
1688 
1696  int ticks_per_frame;
1697 
1724  int delay;
1725 
1726 
1727  /* video only */
1735  int width, height;
1736 
1744 #define FF_ASPECT_EXTENDED 15
1745 
1751  int gop_size;
1752 
1760  enum AVPixelFormat pix_fmt;
1761 
1769  int me_method;
1770 
1794  void (*draw_horiz_band)(struct AVCodecContext *s,
1795  const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
1796  int y, int type, int height);
1797 
1807  enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
1808 
1815  int max_b_frames;
1816 
1824  float b_quant_factor;
1825 
1828 #define FF_RC_STRATEGY_XVID 1
1829 
1830  int b_frame_strategy;
1831 
1832 #if FF_API_MPV_GLOBAL_OPTS
1833 
1838  attribute_deprecated int luma_elim_threshold;
1839 
1845  attribute_deprecated int chroma_elim_threshold;
1846 #endif
1847 
1853  float b_quant_offset;
1854 
1861  int has_b_frames;
1862 
1868  int mpeg_quant;
1869 
1877  float i_quant_factor;
1878 
1884  float i_quant_offset;
1885 
1891  float lumi_masking;
1892 
1898  float temporal_cplx_masking;
1899 
1905  float spatial_cplx_masking;
1906 
1912  float p_masking;
1913 
1919  float dark_masking;
1920 
1926  int slice_count;
1933 #define FF_PRED_LEFT 0
1934 #define FF_PRED_PLANE 1
1935 #define FF_PRED_MEDIAN 2
1936 
1942  int *slice_offset;
1943 
1952 
1958  int me_cmp;
1964  int me_sub_cmp;
1970  int mb_cmp;
1977 #define FF_CMP_SAD 0
1978 #define FF_CMP_SSE 1
1979 #define FF_CMP_SATD 2
1980 #define FF_CMP_DCT 3
1981 #define FF_CMP_PSNR 4
1982 #define FF_CMP_BIT 5
1983 #define FF_CMP_RD 6
1984 #define FF_CMP_ZERO 7
1985 #define FF_CMP_VSAD 8
1986 #define FF_CMP_VSSE 9
1987 #define FF_CMP_NSSE 10
1988 #define FF_CMP_W53 11
1989 #define FF_CMP_W97 12
1990 #define FF_CMP_DCTMAX 13
1991 #define FF_CMP_DCT264 14
1992 #define FF_CMP_CHROMA 256
1993 
1999  int dia_size;
2000 
2007 
2013  int pre_me;
2014 
2020  int me_pre_cmp;
2021 
2027  int pre_dia_size;
2028 
2034  int me_subpel_quality;
2035 
2045 #define FF_DTG_AFD_SAME 8
2046 #define FF_DTG_AFD_4_3 9
2047 #define FF_DTG_AFD_16_9 10
2048 #define FF_DTG_AFD_14_9 11
2049 #define FF_DTG_AFD_4_3_SP_14_9 13
2050 #define FF_DTG_AFD_16_9_SP_14_9 14
2051 #define FF_DTG_AFD_SP_4_3 15
2052 
2060  int me_range;
2061 
2068 #define FF_DEFAULT_QUANT_BIAS 999999
2069 
2075  int inter_quant_bias;
2076 
2077 #if FF_API_COLOR_TABLE_ID
2078 
2084  attribute_deprecated int color_table_id;
2085 #endif
2086 
2093 #define SLICE_FLAG_CODED_ORDER 0x0001
2094 #define SLICE_FLAG_ALLOW_FIELD 0x0002
2095 #define SLICE_FLAG_ALLOW_PLANE 0x0004
2096 
2097 
2102  int xvmc_acceleration;
2103 
2110 #define FF_MB_DECISION_SIMPLE 0
2111 #define FF_MB_DECISION_BITS 1
2112 #define FF_MB_DECISION_RD 2
2113 
2114 
2119  uint16_t *intra_matrix;
2120 
2126  uint16_t *inter_matrix;
2127 
2135 
2141  int noise_reduction;
2142 
2143 #if FF_API_INTER_THRESHOLD
2144 
2147  attribute_deprecated int inter_threshold;
2148 #endif
2149 
2150 #if FF_API_MPV_GLOBAL_OPTS
2151 
2154  attribute_deprecated int quantizer_noise_shaping;
2155 #endif
2156 
2164  int me_threshold;
2165 
2171  int mb_threshold;
2172 
2178  int intra_dc_precision;
2179 
2185  int skip_top;
2186 
2192  int skip_bottom;
2193 
2200  float border_masking;
2201 
2207  int mb_lmin;
2208 
2214  int mb_lmax;
2215 
2222 
2228  int bidir_refine;
2229 
2235  int brd_scale;
2236 
2242  int keyint_min;
2243 
2249  int refs;
2250 
2256  int chromaoffset;
2257 
2263  int scenechange_factor;
2264 
2271  int mv0_threshold;
2272 
2278  int b_sensitivity;
2279 
2286 
2293 
2299  enum AVColorSpace colorspace;
2300 
2307 
2314 
2322  int slices;
2323 
2329 
2330  /* audio only */
2331  int sample_rate;
2332  int channels;
2333 
2339  enum AVSampleFormat sample_fmt;
2340 
2341  /* The following data should not be initialized. */
2351  int frame_size;
2352 
2362  int frame_number;
2363 
2368  int block_align;
2369 
2375  int cutoff;
2376 
2377 #if FF_API_REQUEST_CHANNELS
2378 
2384  int request_channels;
2385 #endif
2386 
2392  uint64_t channel_layout;
2393 
2399  uint64_t request_channel_layout;
2400 
2407 
2415 
2476  int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
2477 
2487  void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
2488 
2501  int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
2502 
2503 
2504  /* - encoding parameters */
2505  float qcompress;
2506  float qblur;
2507 
2513  int qmin;
2514 
2520  int qmax;
2521 
2527  int max_qdiff;
2528 
2535  float rc_qsquish;
2536 
2537  float rc_qmod_amp;
2538  int rc_qmod_freq;
2539 
2545  int rc_buffer_size;
2546 
2552  int rc_override_count;
2554 
2560  const char *rc_eq;
2561 
2567  int rc_max_rate;
2568 
2574  int rc_min_rate;
2575 
2576  float rc_buffer_aggressivity;
2577 
2583  float rc_initial_cplx;
2584 
2591 
2598 
2606 #define FF_CODER_TYPE_VLC 0
2607 #define FF_CODER_TYPE_AC 1
2608 #define FF_CODER_TYPE_RAW 2
2609 #define FF_CODER_TYPE_RLE 3
2610 #define FF_CODER_TYPE_DEFLATE 4
2611 
2616  int coder_type;
2617 
2623  int context_model;
2624 
2630  int lmin;
2631 
2637  int lmax;
2638 
2645 
2651  int frame_skip_factor;
2652 
2658  int frame_skip_exp;
2659 
2665  int frame_skip_cmp;
2666 
2672  int trellis;
2673 
2679 
2685 
2691  int64_t timecode_frame_start;
2692 
2693  /* The RTP callback: This function is called */
2694  /* every time the encoder has a packet to send. */
2695  /* It depends on the encoder if the data starts */
2696  /* with a Start Code (it should). H.263 does. */
2697  /* mb_nb contains the number of macroblocks */
2698  /* encoded in the RTP payload. */
2699  void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
2700 
2701  int rtp_payload_size; /* The size of the RTP payload: the coder will */
2702  /* do its best to deliver a chunk with size */
2703  /* below rtp_payload_size, the chunk will start */
2704  /* with a start code on some codecs like H.263. */
2705  /* This doesn't take account of any particular */
2706  /* headers inside the transmitted RTP payload. */
2707 
2708  /* statistics, used for 2-pass encoding */
2709  int mv_bits;
2710  int header_bits;
2711  int i_tex_bits;
2712  int p_tex_bits;
2713  int i_count;
2714  int p_count;
2715  int skip_count;
2716  int misc_bits;
2717 
2723  int frame_bits;
2724 
2730  char *stats_out;
2731 
2738  char *stats_in;
2739 
2746 #define FF_BUG_AUTODETECT 1
2747 #define FF_BUG_OLD_MSMPEG4 2
2748 #define FF_BUG_XVID_ILACE 4
2749 #define FF_BUG_UMP4 8
2750 #define FF_BUG_NO_PADDING 16
2751 #define FF_BUG_AMV 32
2752 #define FF_BUG_AC_VLC 0
2753 #define FF_BUG_QPEL_CHROMA 64
2754 #define FF_BUG_STD_QPEL 128
2755 #define FF_BUG_QPEL_CHROMA2 256
2756 #define FF_BUG_DIRECT_BLOCKSIZE 512
2757 #define FF_BUG_EDGE 1024
2758 #define FF_BUG_HPEL_CHROMA 2048
2759 #define FF_BUG_DC_CLIP 4096
2760 #define FF_BUG_MS 8192
2761 #define FF_BUG_TRUNCATED 16384
2762 
2776 #define FF_COMPLIANCE_VERY_STRICT 2
2777 #define FF_COMPLIANCE_STRICT 1
2778 #define FF_COMPLIANCE_NORMAL 0
2779 #define FF_COMPLIANCE_UNOFFICIAL -1
2780 #define FF_COMPLIANCE_EXPERIMENTAL -2
2781 
2782 
2788 #define FF_EC_GUESS_MVS 1
2789 #define FF_EC_DEBLOCK 2
2790 
2796  int debug;
2797 #define FF_DEBUG_PICT_INFO 1
2798 #define FF_DEBUG_RC 2
2799 #define FF_DEBUG_BITSTREAM 4
2800 #define FF_DEBUG_MB_TYPE 8
2801 #define FF_DEBUG_QP 16
2802 #define FF_DEBUG_MV 32
2803 #define FF_DEBUG_DCT_COEFF 0x00000040
2804 #define FF_DEBUG_SKIP 0x00000080
2805 #define FF_DEBUG_STARTCODE 0x00000100
2806 #define FF_DEBUG_PTS 0x00000200
2807 #define FF_DEBUG_ER 0x00000400
2808 #define FF_DEBUG_MMCO 0x00000800
2809 #define FF_DEBUG_BUGS 0x00001000
2810 #define FF_DEBUG_VIS_QP 0x00002000
2811 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2812 #define FF_DEBUG_BUFFERS 0x00008000
2813 #define FF_DEBUG_THREADS 0x00010000
2814 
2821 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2822 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2823 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2824 
2831 #define AV_EF_CRCCHECK (1<<0)
2832 #define AV_EF_BITSTREAM (1<<1)
2833 #define AV_EF_BUFFER (1<<2)
2834 #define AV_EF_EXPLODE (1<<3)
2836 #define AV_EF_CAREFUL (1<<16)
2837 #define AV_EF_COMPLIANT (1<<17)
2838 #define AV_EF_AGGRESSIVE (1<<18)
2839 
2840 
2848  int64_t reordered_opaque;
2849 
2855  struct AVHWAccel *hwaccel;
2856 
2867  void *hwaccel_context;
2868 
2874  uint64_t error[AV_NUM_DATA_POINTERS];
2875 
2882 #define FF_DCT_AUTO 0
2883 #define FF_DCT_FASTINT 1
2884 #define FF_DCT_INT 2
2885 #define FF_DCT_MMX 3
2886 #define FF_DCT_ALTIVEC 5
2887 #define FF_DCT_FAAN 6
2888 
2895 #define FF_IDCT_AUTO 0
2896 #define FF_IDCT_INT 1
2897 #define FF_IDCT_SIMPLE 2
2898 #define FF_IDCT_SIMPLEMMX 3
2899 #define FF_IDCT_LIBMPEG2MMX 4
2900 #if FF_API_MMI
2901 #define FF_IDCT_MMI 5
2902 #endif
2903 #define FF_IDCT_ARM 7
2904 #define FF_IDCT_ALTIVEC 8
2905 #define FF_IDCT_SH4 9
2906 #define FF_IDCT_SIMPLEARM 10
2907 #define FF_IDCT_IPP 13
2908 #define FF_IDCT_XVIDMMX 14
2909 #define FF_IDCT_SIMPLEARMV5TE 16
2910 #define FF_IDCT_SIMPLEARMV6 17
2911 #define FF_IDCT_SIMPLEVIS 18
2912 #define FF_IDCT_FAAN 20
2913 #define FF_IDCT_SIMPLENEON 22
2914 #define FF_IDCT_SIMPLEALPHA 23
2915 #if FF_API_IDCT
2916 #define FF_IDCT_H264 11
2917 #define FF_IDCT_VP3 12
2918 #define FF_IDCT_CAVS 15
2919 #define FF_IDCT_WMV2 19
2920 #define FF_IDCT_EA 21
2921 #define FF_IDCT_BINK 24
2922 #endif
2923 
2924 #if FF_API_DSP_MASK
2925 
2929  attribute_deprecated unsigned dsp_mask;
2930 #endif
2931 
2938 
2944  int bits_per_raw_sample;
2945 
2951  int lowres;
2952 
2959 
2966  int thread_count;
2967 
2977 #define FF_THREAD_FRAME 1
2978 #define FF_THREAD_SLICE 2
2979 
2980 
2985  int active_thread_type;
2986 
2996 
3006  int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
3007 
3026  int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
3027 
3034  void *thread_opaque;
3035 
3041  int nsse_weight;
3042 
3048  int profile;
3049 #define FF_PROFILE_UNKNOWN -99
3050 #define FF_PROFILE_RESERVED -100
3052 #define FF_PROFILE_AAC_MAIN 0
3053 #define FF_PROFILE_AAC_LOW 1
3054 #define FF_PROFILE_AAC_SSR 2
3055 #define FF_PROFILE_AAC_LTP 3
3056 #define FF_PROFILE_AAC_HE 4
3057 #define FF_PROFILE_AAC_HE_V2 28
3058 #define FF_PROFILE_AAC_LD 22
3059 #define FF_PROFILE_AAC_ELD 38
3061 #define FF_PROFILE_DTS 20
3062 #define FF_PROFILE_DTS_ES 30
3063 #define FF_PROFILE_DTS_96_24 40
3064 #define FF_PROFILE_DTS_HD_HRA 50
3065 #define FF_PROFILE_DTS_HD_MA 60
3067 #define FF_PROFILE_MPEG2_422 0
3068 #define FF_PROFILE_MPEG2_HIGH 1
3069 #define FF_PROFILE_MPEG2_SS 2
3070 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
3071 #define FF_PROFILE_MPEG2_MAIN 4
3072 #define FF_PROFILE_MPEG2_SIMPLE 5
3074 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
3075 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
3077 #define FF_PROFILE_H264_BASELINE 66
3078 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
3079 #define FF_PROFILE_H264_MAIN 77
3080 #define FF_PROFILE_H264_EXTENDED 88
3081 #define FF_PROFILE_H264_HIGH 100
3082 #define FF_PROFILE_H264_HIGH_10 110
3083 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
3084 #define FF_PROFILE_H264_HIGH_422 122
3085 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
3086 #define FF_PROFILE_H264_HIGH_444 144
3087 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
3088 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
3089 #define FF_PROFILE_H264_CAVLC_444 44
3091 #define FF_PROFILE_VC1_SIMPLE 0
3092 #define FF_PROFILE_VC1_MAIN 1
3093 #define FF_PROFILE_VC1_COMPLEX 2
3094 #define FF_PROFILE_VC1_ADVANCED 3
3096 #define FF_PROFILE_MPEG4_SIMPLE 0
3097 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
3098 #define FF_PROFILE_MPEG4_CORE 2
3099 #define FF_PROFILE_MPEG4_MAIN 3
3100 #define FF_PROFILE_MPEG4_N_BIT 4
3101 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
3102 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
3103 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
3104 #define FF_PROFILE_MPEG4_HYBRID 8
3105 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
3106 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
3107 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
3108 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
3109 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
3110 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
3111 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
3112 
3118  int level;
3119 #define FF_LEVEL_UNKNOWN -99
3120 
3127 
3133  enum AVDiscard skip_idct;
3134 
3140  enum AVDiscard skip_frame;
3141 
3152 
3158  int error_rate;
3159 
3167  AVPacket *pkt;
3168 
3175  uint64_t vbv_delay;
3176 
3185 
3194 
3202  int64_t pts_correction_last_pts;
3203  int64_t pts_correction_last_dts;
3204 
3211 
3217  char *sub_charenc;
3218 
3226 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1
3227 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0
3228 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3229 } AVCodecContext;
3230 
3233 
3236 
3240 typedef struct AVProfile {
3241  int profile;
3242  const char *name;
3243 } AVProfile;
3245 typedef struct AVCodecDefault AVCodecDefault;
3246 
3247 struct AVSubtitle;
3248 
3252 typedef struct AVCodec {
3259  const char *name;
3264  const char *long_name;
3265  enum AVMediaType type;
3266  enum AVCodecID id;
3271  int capabilities;
3272  const AVRational *supported_framerates;
3273  const enum AVPixelFormat *pix_fmts;
3274  const int *supported_samplerates;
3275  const enum AVSampleFormat *sample_fmts;
3276  const uint64_t *channel_layouts;
3277  uint8_t max_lowres;
3278  const AVClass *priv_class;
3279  const AVProfile *profiles;
3280 
3281  /*****************************************************************
3282  * No fields below this line are part of the public API. They
3283  * may not be used outside of libavcodec and can be changed and
3284  * removed at will.
3285  * New public fields should be added right above.
3286  *****************************************************************
3287  */
3288  int priv_data_size;
3289  struct AVCodec *next;
3299  int (*init_thread_copy)(AVCodecContext *);
3313  const AVCodecDefault *defaults;
3314 
3318  void (*init_static_data)(struct AVCodec *codec);
3319 
3320  int (*init)(AVCodecContext *);
3321  int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
3322  const struct AVSubtitle *sub);
3333  int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
3334  int *got_packet_ptr);
3335  int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
3336  int (*close)(AVCodecContext *);
3341  void (*flush)(AVCodecContext *);
3342 } AVCodec;
3343 
3347 typedef struct AVHWAccel {
3353  const char *name;
3354 
3360  enum AVMediaType type;
3361 
3367  enum AVCodecID id;
3368 
3374  enum AVPixelFormat pix_fmt;
3375 
3380  int capabilities;
3381 
3382  struct AVHWAccel *next;
3383 
3398  int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3399 
3411  int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3412 
3422  int (*end_frame)(AVCodecContext *avctx);
3423 
3431  int priv_data_size;
3432 } AVHWAccel;
3433 
3445 typedef struct AVPicture {
3447  int linesize[AV_NUM_DATA_POINTERS];
3448 } AVPicture;
3449 
3455  SUBTITLE_NONE,
3457  SUBTITLE_BITMAP,
3458 
3463  SUBTITLE_TEXT,
3464 
3469  SUBTITLE_ASS,
3470 };
3472 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3473 
3474 typedef struct AVSubtitleRect {
3475  int x;
3476  int y;
3477  int w;
3478  int h;
3479  int nb_colors;
3480 
3485  AVPicture pict;
3486  enum AVSubtitleType type;
3487 
3488  char *text;
3489 
3495  char *ass;
3496 
3497  int flags;
3498 } AVSubtitleRect;
3499 
3500 typedef struct AVSubtitle {
3501  uint16_t format; /* 0 = graphics */
3502  uint32_t start_display_time; /* relative to packet pts, in ms */
3503  uint32_t end_display_time; /* relative to packet pts, in ms */
3504  unsigned num_rects;
3505  AVSubtitleRect **rects;
3506  int64_t pts;
3507 } AVSubtitle;
3508 
3514 AVCodec *av_codec_next(const AVCodec *c);
3515 
3519 unsigned avcodec_version(void);
3520 
3524 const char *avcodec_configuration(void);
3525 
3529 const char *avcodec_license(void);
3530 
3540 
3551 void avcodec_register_all(void);
3552 
3553 
3554 #if FF_API_ALLOC_CONTEXT
3555 
3565 AVCodecContext *avcodec_alloc_context(void);
3566 
3570 AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
3571 
3579 void avcodec_get_context_defaults(AVCodecContext *s);
3580 
3584 void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
3585 #endif
3586 
3603 
3614 
3621 const AVClass *avcodec_get_class(void);
3622 
3629 const AVClass *avcodec_get_frame_class(void);
3630 
3638 
3650 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
3651 
3660 
3667 
3679 
3680 #if FF_API_AVCODEC_OPEN
3681 
3711 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
3712 #endif
3713 
3751 
3761 int avcodec_close(AVCodecContext *avctx);
3762 
3768 void avsubtitle_free(AVSubtitle *sub);
3769 
3783 
3792 void av_init_packet(AVPacket *pkt);
3793 
3802 int av_new_packet(AVPacket *pkt, int size);
3803 
3810 void av_shrink_packet(AVPacket *pkt, int size);
3811 
3818 int av_grow_packet(AVPacket *pkt, int grow_by);
3819 
3824 int av_dup_packet(AVPacket *pkt);
3825 
3831 int av_copy_packet(AVPacket *dst, AVPacket *src);
3832 
3838 void av_free_packet(AVPacket *pkt);
3839 
3849  int size);
3850 
3860  int size);
3861 
3871  int *size);
3872 
3874 
3876 
3877 
3894 
3902 
3906 
3914 unsigned avcodec_get_edge_width(void);
3915 
3926 
3937  int linesize_align[AV_NUM_DATA_POINTERS]);
3938 
3939 #if FF_API_OLD_DECODE_AUDIO
3940 
3994 attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
3995  int *frame_size_ptr,
3996  AVPacket *avpkt);
3997 #endif
3998 
4033  int *got_frame_ptr, const AVPacket *avpkt);
4034 
4076 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
4077  int *got_picture_ptr,
4078  const AVPacket *avpkt);
4079 
4097  int *got_sub_ptr,
4098  AVPacket *avpkt);
4099 
4105 typedef struct AVCodecParserContext {
4106  void *priv_data;
4107  struct AVCodecParser *parser;
4108  int64_t frame_offset; /* offset of the current frame */
4109  int64_t cur_offset; /* current offset
4110  (incremented by each av_parser_parse()) */
4111  int64_t next_frame_offset; /* offset of the next frame */
4112  /* video info */
4113  int pict_type; /* XXX: Put it back in AVCodecContext. */
4123  int repeat_pict; /* XXX: Put it back in AVCodecContext. */
4124  int64_t pts; /* pts of the current frame */
4125  int64_t dts; /* dts of the current frame */
4126 
4127  /* private data */
4128  int64_t last_pts;
4129  int64_t last_dts;
4130  int fetch_timestamp;
4132 #define AV_PARSER_PTS_NB 4
4133  int cur_frame_start_index;
4134  int64_t cur_frame_offset[AV_PARSER_PTS_NB];
4135  int64_t cur_frame_pts[AV_PARSER_PTS_NB];
4136  int64_t cur_frame_dts[AV_PARSER_PTS_NB];
4137 
4138  int flags;
4139 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
4140 #define PARSER_FLAG_ONCE 0x0002
4142 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
4143 #define PARSER_FLAG_USE_CODEC_TS 0x1000
4144 
4145  int64_t offset;
4146  int64_t cur_frame_end[AV_PARSER_PTS_NB];
4147 
4154  int key_frame;
4155 
4173  int64_t convergence_duration;
4174 
4175  // Timestamp generation support:
4185  int dts_sync_point;
4186 
4200  int dts_ref_dts_delta;
4201 
4214  int pts_dts_delta;
4215 
4221  int64_t cur_frame_pos[AV_PARSER_PTS_NB];
4222 
4226  int64_t pos;
4227 
4231  int64_t last_pos;
4232 
4238  int duration;
4240 
4241 typedef struct AVCodecParser {
4242  int codec_ids[5]; /* several codec IDs are permitted */
4243  int priv_data_size;
4244  int (*parser_init)(AVCodecParserContext *s);
4245  int (*parser_parse)(AVCodecParserContext *s,
4246  AVCodecContext *avctx,
4247  const uint8_t **poutbuf, int *poutbuf_size,
4248  const uint8_t *buf, int buf_size);
4249  void (*parser_close)(AVCodecParserContext *s);
4250  int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
4251  struct AVCodecParser *next;
4252 } AVCodecParser;
4253 
4255 
4258 
4288  AVCodecContext *avctx,
4289  uint8_t **poutbuf, int *poutbuf_size,
4290  const uint8_t *buf, int buf_size,
4291  int64_t pts, int64_t dts,
4292  int64_t pos);
4293 
4299  AVCodecContext *avctx,
4300  uint8_t **poutbuf, int *poutbuf_size,
4301  const uint8_t *buf, int buf_size, int keyframe);
4303 
4321 
4329 
4330 #if FF_API_OLD_ENCODE_AUDIO
4331 
4355 int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
4356  uint8_t *buf, int buf_size,
4357  const short *samples);
4358 #endif
4359 
4399 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
4400  const AVFrame *frame, int *got_packet_ptr);
4401 
4402 #if FF_API_OLD_ENCODE_VIDEO
4403 
4418 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
4419  const AVFrame *pict);
4420 #endif
4421 
4456 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
4457  const AVFrame *frame, int *got_packet_ptr);
4458 
4459 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
4460  const AVSubtitle *sub);
4461 
4462 
4467 #if FF_API_AVCODEC_RESAMPLE
4468 
4475 struct ReSampleContext;
4476 struct AVResampleContext;
4477 
4478 typedef struct ReSampleContext ReSampleContext;
4479 
4497 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
4498  int output_rate, int input_rate,
4499  enum AVSampleFormat sample_fmt_out,
4500  enum AVSampleFormat sample_fmt_in,
4501  int filter_length, int log2_phase_count,
4502  int linear, double cutoff);
4503 
4505 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
4506 
4514 void audio_resample_close(ReSampleContext *s);
4515 
4516 
4527 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
4528 
4539 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
4540 
4541 
4555 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
4557 void av_resample_close(struct AVResampleContext *c);
4558 
4562 #endif
4563 
4580 int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
4581 
4589 void avpicture_free(AVPicture *picture);
4590 
4597 int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
4598  enum AVPixelFormat pix_fmt, int width, int height);
4599 
4606 int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
4607  int width, int height,
4608  unsigned char *dest, int dest_size);
4609 
4618 
4619 #if FF_API_DEINTERLACE
4620 
4626 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
4627  enum AVPixelFormat pix_fmt, int width, int height);
4628 #endif
4629 
4632 void av_picture_copy(AVPicture *dst, const AVPicture *src,
4633  enum AVPixelFormat pix_fmt, int width, int height);
4634 
4638 int av_picture_crop(AVPicture *dst, const AVPicture *src,
4639  enum AVPixelFormat pix_fmt, int top_band, int left_band);
4640 
4644 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
4645  int padtop, int padbottom, int padleft, int padright, int *color);
4646 
4682 void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
4683 
4691 #define FF_LOSS_RESOLUTION 0x0001
4692 #define FF_LOSS_DEPTH 0x0002
4693 #define FF_LOSS_COLORSPACE 0x0004
4694 #define FF_LOSS_ALPHA 0x0008
4695 #define FF_LOSS_COLORQUANT 0x0010
4696 #define FF_LOSS_CHROMA 0x0020
4716 int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
4717  int has_alpha);
4718 
4719 #if FF_API_FIND_BEST_PIX_FMT
4720 
4747 enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
4748  int has_alpha, int *loss_ptr);
4749 #endif /* FF_API_FIND_BEST_PIX_FMT */
4750 
4769  enum AVPixelFormat src_pix_fmt,
4770  int has_alpha, int *loss_ptr);
4771 
4802 enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
4803  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
4804 
4806 #if AV_HAVE_INCOMPATIBLE_FORK_ABI
4808  enum AVPixelFormat src_pix_fmt,
4809  int has_alpha, int *loss_ptr);
4810 #else
4811 enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
4812  enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
4813 #endif
4814 
4815 
4817 
4823 
4831 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
4832 
4833 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
4834 
4842 const char *av_get_profile_name(const AVCodec *codec, int profile);
4843 
4844 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
4845 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
4846 //FIXME func typedef
4847 
4872  enum AVSampleFormat sample_fmt, const uint8_t *buf,
4873  int buf_size, int align);
4874 
4879 
4881 
4889 
4896 enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
4897 
4907 
4916 int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
4917 
4918 
4919 typedef struct AVBitStreamFilterContext {
4920  void *priv_data;
4921  struct AVBitStreamFilter *filter;
4922  AVCodecParserContext *parser;
4925 
4926 
4927 typedef struct AVBitStreamFilter {
4928  const char *name;
4929  int priv_data_size;
4930  int (*filter)(AVBitStreamFilterContext *bsfc,
4931  AVCodecContext *avctx, const char *args,
4932  uint8_t **poutbuf, int *poutbuf_size,
4933  const uint8_t *buf, int buf_size, int keyframe);
4935  struct AVBitStreamFilter *next;
4937 
4941  AVCodecContext *avctx, const char *args,
4942  uint8_t **poutbuf, int *poutbuf_size,
4943  const uint8_t *buf, int buf_size, int keyframe);
4945 
4947 
4948 /* memory */
4949 
4955 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
4956 
4969 void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
4970 
4978 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
4979 
4984 void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size);
4985 
4993 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
4994 
5007 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
5008 
5017 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
5018 
5023 
5030 
5031 
5035 enum AVLockOp {
5039  AV_LOCK_DESTROY,
5040 };
5041 
5055 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
5056 
5061 
5066 const char *avcodec_get_name(enum AVCodecID id);
5067 
5073 
5077 int av_codec_is_encoder(const AVCodec *codec);
5078 
5082 int av_codec_is_decoder(const AVCodec *codec);
5083 
5088 
5097 
5103 
5108 #endif /* AVCODEC_AVCODEC_H */