avcodec.h
Go to the documentation of this file.
1 /*
2  * copyright (c) 2001 Fabrice Bellard
3  *
4  * This file is part of Libav.
5  *
6  * Libav 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  * Libav 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 Libav; 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/dict.h"
34 #include "libavutil/log.h"
35 #include "libavutil/pixfmt.h"
36 #include "libavutil/rational.h"
37 
38 #include "libavcodec/version.h"
95 enum AVCodecID {
97 
98  /* video codecs */
268 
269  /* various PCM "codecs" */
299 
300  /* various ADPCM codecs */
331 
332  /* AMR */
335 
336  /* RealAudio codecs*/
339 
340  /* various DPCM codecs */
345 
346  /* audio codecs */
347  AV_CODEC_ID_MP2 = 0x15000,
377  AV_CODEC_ID_GSM_MS, /* as found in WAV */
411 
412  /* subtitle codecs */
423 
424  /* other specific kind of codecs (generally used for attachments) */
426  AV_CODEC_ID_TTF = 0x18000,
427 
428  AV_CODEC_ID_PROBE = 0x19000,
429 
435 
436 #if FF_API_CODEC_ID
437 #include "old_codec_ids.h"
438 #endif
439 };
440 
441 #if FF_API_CODEC_ID
442 #define CodecID AVCodecID
443 #endif
444 
450 typedef struct AVCodecDescriptor {
451  enum AVCodecID id;
458  const char *name;
462  const char *long_name;
466  int props;
468 
473 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
474 
479 #define AV_CODEC_PROP_LOSSY (1 << 1)
480 
483 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
484 
485 #if FF_API_OLD_DECODE_AUDIO
486 /* in bytes */
487 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
488 #endif
489 
498 #define FF_INPUT_BUFFER_PADDING_SIZE 8
499 
505 #define FF_MIN_BUFFER_SIZE 16384
506 
507 
513  ME_ZERO = 1,
523 };
524 
529  /* We leave some space between them for extensions (drop some
530  * keyframes for intra-only or drop just some bidir frames). */
537 };
538 
548 };
549 
557 };
558 
569 };
570 
576 };
577 
592 };
593 
605 };
606 
610 typedef struct RcOverride{
613  int qscale; // If this is 0 then quality_factor will be used instead.
615 } RcOverride;
616 
617 #define FF_MAX_B_FRAMES 16
618 
619 /* encoding support
620  These flags can be passed in AVCodecContext.flags before initialization.
621  Note: Not everything is supported yet.
622 */
623 
624 #define CODEC_FLAG_QSCALE 0x0002
625 #define CODEC_FLAG_4MV 0x0004
626 #define CODEC_FLAG_QPEL 0x0010
627 #define CODEC_FLAG_GMC 0x0020
628 #define CODEC_FLAG_MV0 0x0040
629 
634 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
635 #define CODEC_FLAG_PASS1 0x0200
636 #define CODEC_FLAG_PASS2 0x0400
637 #define CODEC_FLAG_GRAY 0x2000
638 #define CODEC_FLAG_EMU_EDGE 0x4000
639 #define CODEC_FLAG_PSNR 0x8000
640 #define CODEC_FLAG_TRUNCATED 0x00010000
642 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
643 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
644 #define CODEC_FLAG_LOW_DELAY 0x00080000
645 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
646 #define CODEC_FLAG_BITEXACT 0x00800000
647 /* Fx : Flag for h263+ extra options */
648 #define CODEC_FLAG_AC_PRED 0x01000000
649 #define CODEC_FLAG_LOOP_FILTER 0x00000800
650 #define CODEC_FLAG_INTERLACED_ME 0x20000000
651 #define CODEC_FLAG_CLOSED_GOP 0x80000000
652 #define CODEC_FLAG2_FAST 0x00000001
653 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
654 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
655 #if FF_API_MPV_GLOBAL_OPTS
656 #define CODEC_FLAG_CBP_RD 0x04000000
657 #define CODEC_FLAG_QP_RD 0x08000000
658 #define CODEC_FLAG2_STRICT_GOP 0x00000002
659 #define CODEC_FLAG2_SKIP_RD 0x00004000
660 #endif
661 #define CODEC_FLAG2_CHUNKS 0x00008000
662 
663 /* Unsupported options :
664  * Syntax Arithmetic coding (SAC)
665  * Reference Picture Selection
666  * Independent Segment Decoding */
667 /* /Fx */
668 /* codec capabilities */
669 
670 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
671 
676 #define CODEC_CAP_DR1 0x0002
677 #define CODEC_CAP_TRUNCATED 0x0008
678 /* Codec can export data for HW decoding (XvMC). */
679 #define CODEC_CAP_HWACCEL 0x0010
680 
703 #define CODEC_CAP_DELAY 0x0020
704 
708 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
709 
712 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
713 
724 #define CODEC_CAP_SUBFRAMES 0x0100
725 
729 #define CODEC_CAP_EXPERIMENTAL 0x0200
730 
733 #define CODEC_CAP_CHANNEL_CONF 0x0400
734 
737 #define CODEC_CAP_NEG_LINESIZES 0x0800
738 
741 #define CODEC_CAP_FRAME_THREADS 0x1000
742 
745 #define CODEC_CAP_SLICE_THREADS 0x2000
746 
749 #define CODEC_CAP_PARAM_CHANGE 0x4000
750 
753 #define CODEC_CAP_AUTO_THREADS 0x8000
754 
757 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
758 
759 //The following defines may change, don't expect compatibility if you use them.
760 #define MB_TYPE_INTRA4x4 0x0001
761 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
762 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
763 #define MB_TYPE_16x16 0x0008
764 #define MB_TYPE_16x8 0x0010
765 #define MB_TYPE_8x16 0x0020
766 #define MB_TYPE_8x8 0x0040
767 #define MB_TYPE_INTERLACED 0x0080
768 #define MB_TYPE_DIRECT2 0x0100 //FIXME
769 #define MB_TYPE_ACPRED 0x0200
770 #define MB_TYPE_GMC 0x0400
771 #define MB_TYPE_SKIP 0x0800
772 #define MB_TYPE_P0L0 0x1000
773 #define MB_TYPE_P1L0 0x2000
774 #define MB_TYPE_P0L1 0x4000
775 #define MB_TYPE_P1L1 0x8000
776 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
777 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
778 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
779 #define MB_TYPE_QUANT 0x00010000
780 #define MB_TYPE_CBP 0x00020000
781 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
782 
788 typedef struct AVPanScan{
794  int id;
795 
801  int width;
802  int height;
803 
809  int16_t position[3][2];
810 }AVPanScan;
811 
812 #define FF_QSCALE_TYPE_MPEG1 0
813 #define FF_QSCALE_TYPE_MPEG2 1
814 #define FF_QSCALE_TYPE_H264 2
815 #define FF_QSCALE_TYPE_VP56 3
816 
817 #define FF_BUFFER_TYPE_INTERNAL 1
818 #define FF_BUFFER_TYPE_USER 2
819 #define FF_BUFFER_TYPE_SHARED 4
820 #define FF_BUFFER_TYPE_COPY 8
821 
822 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
823 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
824 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
825 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
826 
836 
853 
874 };
875 
898 typedef struct AVPacket {
908  int64_t pts;
914  int64_t dts;
916  int size;
921  int flags;
926  struct {
927  uint8_t *data;
928  int size;
930  } *side_data;
932 
937  int duration;
938  void (*destruct)(struct AVPacket *);
939  void *priv;
940  int64_t pos;
941 
960 } AVPacket;
961 #define AV_PKT_FLAG_KEY 0x0001
962 #define AV_PKT_FLAG_CORRUPT 0x0002
963 
969 };
989 typedef struct AVFrame {
990 #define AV_NUM_DATA_POINTERS 8
991 
998 
1009 
1029 
1036 
1043 
1051  int format;
1052 
1059 
1066 
1074 
1081 
1088  int64_t pts;
1089 
1095  int64_t pkt_pts;
1096 
1102  int64_t pkt_dts;
1103 
1116 
1122  int quality;
1123 
1133 
1139  int8_t *qscale_table;
1145  int qstride;
1146 
1151 
1159 
1172  int16_t (*motion_val[2])[2];
1173 
1180  uint32_t *mb_type;
1181 
1187  short *dct_coeff;
1188 
1195  int8_t *ref_index[2];
1196 
1202  void *opaque;
1203 
1210 
1217  int type;
1218 
1226 
1233 
1240 
1247 
1254 
1261 
1274 
1281 
1288 
1295 
1303 
1311 
1318  uint64_t channel_layout;
1319 } AVFrame;
1320 
1321 struct AVCodecInternal;
1322 
1326  AV_FIELD_TT, //< Top coded_first, top displayed first
1327  AV_FIELD_BB, //< Bottom coded first, bottom displayed first
1328  AV_FIELD_TB, //< Top coded first, bottom displayed first
1329  AV_FIELD_BT, //< Bottom coded first, top displayed first
1330 };
1331 
1339 typedef struct AVCodecContext {
1346 
1347  enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
1348  const struct AVCodec *codec;
1349  char codec_name[32];
1350  enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
1351 
1365  unsigned int codec_tag;
1366 
1373  unsigned int stream_codec_tag;
1374 
1375 #if FF_API_SUB_ID
1376 
1379  attribute_deprecated int sub_id;
1380 #endif
1381 
1382  void *priv_data;
1383 
1390  struct AVCodecInternal *internal;
1391 
1397  void *opaque;
1398 
1405 
1413 
1421 
1427 #define FF_COMPRESSION_DEFAULT -1
1428 
1434  int flags;
1435 
1441  int flags2;
1442 
1456 
1466 
1475 
1497  int delay;
1498 
1499 
1500  /* video only */
1509 
1516 
1517 #define FF_ASPECT_EXTENDED 15
1518 
1525 
1534 
1543 
1568  const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
1569  int y, int type, int height);
1570 
1580  enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
1581 
1589 
1598 
1601 #define FF_RC_STRATEGY_XVID 1
1602 
1604 
1605 #if FF_API_MPV_GLOBAL_OPTS
1606 
1611  attribute_deprecated int luma_elim_threshold;
1612 
1618  attribute_deprecated int chroma_elim_threshold;
1619 #endif
1620 
1627 
1635 
1642 
1651 
1658 
1665 
1672 
1679 
1685  float p_masking;
1686 
1693 
1706 #define FF_PRED_LEFT 0
1707 #define FF_PRED_PLANE 1
1708 #define FF_PRED_MEDIAN 2
1709 
1716 
1725 
1731  int me_cmp;
1743  int mb_cmp;
1750 #define FF_CMP_SAD 0
1751 #define FF_CMP_SSE 1
1752 #define FF_CMP_SATD 2
1753 #define FF_CMP_DCT 3
1754 #define FF_CMP_PSNR 4
1755 #define FF_CMP_BIT 5
1756 #define FF_CMP_RD 6
1757 #define FF_CMP_ZERO 7
1758 #define FF_CMP_VSAD 8
1759 #define FF_CMP_VSSE 9
1760 #define FF_CMP_NSSE 10
1761 #define FF_CMP_W53 11
1762 #define FF_CMP_W97 12
1763 #define FF_CMP_DCTMAX 13
1764 #define FF_CMP_DCT264 14
1765 #define FF_CMP_CHROMA 256
1766 
1773 
1780 
1786  int pre_me;
1787 
1794 
1801 
1808 
1818 #define FF_DTG_AFD_SAME 8
1819 #define FF_DTG_AFD_4_3 9
1820 #define FF_DTG_AFD_16_9 10
1821 #define FF_DTG_AFD_14_9 11
1822 #define FF_DTG_AFD_4_3_SP_14_9 13
1823 #define FF_DTG_AFD_16_9_SP_14_9 14
1824 #define FF_DTG_AFD_SP_4_3 15
1825 
1834 
1841 #define FF_DEFAULT_QUANT_BIAS 999999
1842 
1849 
1850 #if FF_API_COLOR_TABLE_ID
1851 
1857  attribute_deprecated int color_table_id;
1858 #endif
1859 
1866 #define SLICE_FLAG_CODED_ORDER 0x0001
1867 #define SLICE_FLAG_ALLOW_FIELD 0x0002
1868 #define SLICE_FLAG_ALLOW_PLANE 0x0004
1869 
1870 
1876 
1883 #define FF_MB_DECISION_SIMPLE 0
1884 #define FF_MB_DECISION_BITS 1
1885 #define FF_MB_DECISION_RD 2
1886 
1887 
1892  uint16_t *intra_matrix;
1893 
1899  uint16_t *inter_matrix;
1900 
1908 
1915 
1916 #if FF_API_INTER_THRESHOLD
1917 
1920  attribute_deprecated int inter_threshold;
1921 #endif
1922 
1923 #if FF_API_MPV_GLOBAL_OPTS
1924 
1927  attribute_deprecated int quantizer_noise_shaping;
1928 #endif
1929 
1938 
1945 
1952 
1959 
1966 
1974 
1980  int mb_lmin;
1981 
1987  int mb_lmax;
1988 
1995 
2002 
2009 
2016 
2022  int refs;
2023 
2030 
2037 
2045 
2052 
2059 
2066 
2073 
2080 
2087 
2095  int slices;
2096 
2102 
2103  /* audio only */
2105  int channels;
2106 
2113 
2114  /* The following data should not be initialized. */
2125 
2136 
2142 
2148  int cutoff;
2149 
2150 #if FF_API_REQUEST_CHANNELS
2151 
2157  int request_channels;
2158 #endif
2159 
2165  uint64_t channel_layout;
2166 
2173 
2180 
2187 
2248  int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
2249 
2260 
2273  int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
2274 
2275 
2276  /* - encoding parameters */
2277  float qcompress;
2278  float qblur;
2279 
2285  int qmin;
2286 
2292  int qmax;
2293 
2300 
2307  float rc_qsquish;
2308 
2311 
2318 
2326 
2332  const char *rc_eq;
2333 
2340 
2347 
2349 
2356 
2363 
2370 
2377 
2378 #define FF_CODER_TYPE_VLC 0
2379 #define FF_CODER_TYPE_AC 1
2380 #define FF_CODER_TYPE_RAW 2
2381 #define FF_CODER_TYPE_RLE 3
2382 #define FF_CODER_TYPE_DEFLATE 4
2383 
2389 
2396 
2402  int lmin;
2403 
2409  int lmax;
2410 
2417 
2424 
2431 
2438 
2444  int trellis;
2445 
2451 
2457 
2464 
2465  /* The RTP callback: This function is called */
2466  /* every time the encoder has a packet to send. */
2467  /* It depends on the encoder if the data starts */
2468  /* with a Start Code (it should). H.263 does. */
2469  /* mb_nb contains the number of macroblocks */
2470  /* encoded in the RTP payload. */
2471  void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
2472 
2473  int rtp_payload_size; /* The size of the RTP payload: the coder will */
2474  /* do its best to deliver a chunk with size */
2475  /* below rtp_payload_size, the chunk will start */
2476  /* with a start code on some codecs like H.263. */
2477  /* This doesn't take account of any particular */
2478  /* headers inside the transmitted RTP payload. */
2479 
2480  /* statistics, used for 2-pass encoding */
2481  int mv_bits;
2485  int i_count;
2486  int p_count;
2489 
2496 
2502  char *stats_out;
2503 
2510  char *stats_in;
2511 
2518 #define FF_BUG_AUTODETECT 1
2519 #define FF_BUG_OLD_MSMPEG4 2
2520 #define FF_BUG_XVID_ILACE 4
2521 #define FF_BUG_UMP4 8
2522 #define FF_BUG_NO_PADDING 16
2523 #define FF_BUG_AMV 32
2524 #define FF_BUG_AC_VLC 0
2525 #define FF_BUG_QPEL_CHROMA 64
2526 #define FF_BUG_STD_QPEL 128
2527 #define FF_BUG_QPEL_CHROMA2 256
2528 #define FF_BUG_DIRECT_BLOCKSIZE 512
2529 #define FF_BUG_EDGE 1024
2530 #define FF_BUG_HPEL_CHROMA 2048
2531 #define FF_BUG_DC_CLIP 4096
2532 #define FF_BUG_MS 8192
2533 #define FF_BUG_TRUNCATED 16384
2534 
2548 #define FF_COMPLIANCE_VERY_STRICT 2
2549 #define FF_COMPLIANCE_STRICT 1
2550 #define FF_COMPLIANCE_NORMAL 0
2551 #define FF_COMPLIANCE_UNOFFICIAL -1
2552 #define FF_COMPLIANCE_EXPERIMENTAL -2
2553 
2554 
2560 #define FF_EC_GUESS_MVS 1
2561 #define FF_EC_DEBLOCK 2
2562 
2568  int debug;
2569 #define FF_DEBUG_PICT_INFO 1
2570 #define FF_DEBUG_RC 2
2571 #define FF_DEBUG_BITSTREAM 4
2572 #define FF_DEBUG_MB_TYPE 8
2573 #define FF_DEBUG_QP 16
2574 #define FF_DEBUG_MV 32
2575 #define FF_DEBUG_DCT_COEFF 0x00000040
2576 #define FF_DEBUG_SKIP 0x00000080
2577 #define FF_DEBUG_STARTCODE 0x00000100
2578 #define FF_DEBUG_PTS 0x00000200
2579 #define FF_DEBUG_ER 0x00000400
2580 #define FF_DEBUG_MMCO 0x00000800
2581 #define FF_DEBUG_BUGS 0x00001000
2582 #define FF_DEBUG_VIS_QP 0x00002000
2583 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2584 #define FF_DEBUG_BUFFERS 0x00008000
2585 #define FF_DEBUG_THREADS 0x00010000
2586 
2593 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2594 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2595 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2596 
2603 #define AV_EF_CRCCHECK (1<<0)
2604 #define AV_EF_BITSTREAM (1<<1)
2605 #define AV_EF_BUFFER (1<<2)
2606 #define AV_EF_EXPLODE (1<<3)
2607 
2616 
2623 
2635 
2642 
2649 #define FF_DCT_AUTO 0
2650 #define FF_DCT_FASTINT 1
2651 #define FF_DCT_INT 2
2652 #define FF_DCT_MMX 3
2653 #define FF_DCT_ALTIVEC 5
2654 #define FF_DCT_FAAN 6
2655 
2662 #define FF_IDCT_AUTO 0
2663 #define FF_IDCT_INT 1
2664 #define FF_IDCT_SIMPLE 2
2665 #define FF_IDCT_SIMPLEMMX 3
2666 #if FF_API_LIBMPEG2
2667 #define FF_IDCT_LIBMPEG2MMX 4
2668 #endif
2669 #if FF_API_MMI
2670 #define FF_IDCT_MMI 5
2671 #endif
2672 #define FF_IDCT_ARM 7
2673 #define FF_IDCT_ALTIVEC 8
2674 #define FF_IDCT_SH4 9
2675 #define FF_IDCT_SIMPLEARM 10
2676 #define FF_IDCT_H264 11
2677 #define FF_IDCT_VP3 12
2678 #define FF_IDCT_IPP 13
2679 #define FF_IDCT_XVIDMMX 14
2680 #define FF_IDCT_CAVS 15
2681 #define FF_IDCT_SIMPLEARMV5TE 16
2682 #define FF_IDCT_SIMPLEARMV6 17
2683 #define FF_IDCT_SIMPLEVIS 18
2684 #define FF_IDCT_WMV2 19
2685 #define FF_IDCT_FAAN 20
2686 #define FF_IDCT_EA 21
2687 #define FF_IDCT_SIMPLENEON 22
2688 #define FF_IDCT_SIMPLEALPHA 23
2689 #define FF_IDCT_BINK 24
2690 
2691 #if FF_API_DSP_MASK
2692 
2696  attribute_deprecated unsigned dsp_mask;
2697 #endif
2698 
2705 
2712 
2719 
2726 
2734 
2744 #define FF_THREAD_FRAME 1
2745 #define FF_THREAD_SLICE 2
2746 
2747 
2753 
2763 
2773  int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
2774 
2793  int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
2794 
2802 
2809 
2815  int profile;
2816 #define FF_PROFILE_UNKNOWN -99
2817 #define FF_PROFILE_RESERVED -100
2818 
2819 #define FF_PROFILE_AAC_MAIN 0
2820 #define FF_PROFILE_AAC_LOW 1
2821 #define FF_PROFILE_AAC_SSR 2
2822 #define FF_PROFILE_AAC_LTP 3
2823 #define FF_PROFILE_AAC_HE 4
2824 #define FF_PROFILE_AAC_HE_V2 28
2825 #define FF_PROFILE_AAC_LD 22
2826 #define FF_PROFILE_AAC_ELD 38
2827 
2828 #define FF_PROFILE_DTS 20
2829 #define FF_PROFILE_DTS_ES 30
2830 #define FF_PROFILE_DTS_96_24 40
2831 #define FF_PROFILE_DTS_HD_HRA 50
2832 #define FF_PROFILE_DTS_HD_MA 60
2833 
2834 #define FF_PROFILE_MPEG2_422 0
2835 #define FF_PROFILE_MPEG2_HIGH 1
2836 #define FF_PROFILE_MPEG2_SS 2
2837 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
2838 #define FF_PROFILE_MPEG2_MAIN 4
2839 #define FF_PROFILE_MPEG2_SIMPLE 5
2840 
2841 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
2842 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
2843 
2844 #define FF_PROFILE_H264_BASELINE 66
2845 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2846 #define FF_PROFILE_H264_MAIN 77
2847 #define FF_PROFILE_H264_EXTENDED 88
2848 #define FF_PROFILE_H264_HIGH 100
2849 #define FF_PROFILE_H264_HIGH_10 110
2850 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
2851 #define FF_PROFILE_H264_HIGH_422 122
2852 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
2853 #define FF_PROFILE_H264_HIGH_444 144
2854 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
2855 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
2856 #define FF_PROFILE_H264_CAVLC_444 44
2857 
2858 #define FF_PROFILE_VC1_SIMPLE 0
2859 #define FF_PROFILE_VC1_MAIN 1
2860 #define FF_PROFILE_VC1_COMPLEX 2
2861 #define FF_PROFILE_VC1_ADVANCED 3
2862 
2863 #define FF_PROFILE_MPEG4_SIMPLE 0
2864 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
2865 #define FF_PROFILE_MPEG4_CORE 2
2866 #define FF_PROFILE_MPEG4_MAIN 3
2867 #define FF_PROFILE_MPEG4_N_BIT 4
2868 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
2869 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
2870 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
2871 #define FF_PROFILE_MPEG4_HYBRID 8
2872 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
2873 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
2874 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
2875 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
2876 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
2877 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
2878 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
2879 
2885  int level;
2886 #define FF_LEVEL_UNKNOWN -99
2887 
2894 
2901 
2908 
2919 
2926 
2935 
2942  uint64_t vbv_delay;
2943 } AVCodecContext;
2944 
2948 typedef struct AVProfile {
2949  int profile;
2950  const char *name;
2951 } AVProfile;
2952 
2954 
2955 struct AVSubtitle;
2956 
2960 typedef struct AVCodec {
2967  const char *name;
2972  const char *long_name;
2981  const enum AVPixelFormat *pix_fmts;
2984  const uint64_t *channel_layouts;
2988 
2989  /*****************************************************************
2990  * No fields below this line are part of the public API. They
2991  * may not be used outside of libavcodec and can be changed and
2992  * removed at will.
2993  * New public fields should be added right above.
2994  *****************************************************************
2995  */
2997  struct AVCodec *next;
3022 
3026  void (*init_static_data)(struct AVCodec *codec);
3027 
3029  int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
3030  const struct AVSubtitle *sub);
3041  int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
3042  int *got_packet_ptr);
3043  int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
3050 } AVCodec;
3051 
3055 typedef struct AVHWAccel {
3061  const char *name;
3062 
3069 
3076 
3083 
3089 
3090  struct AVHWAccel *next;
3091 
3106  int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3107 
3119  int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3120 
3130  int (*end_frame)(AVCodecContext *avctx);
3131 
3140 } AVHWAccel;
3141 
3153 typedef struct AVPicture {
3156 } AVPicture;
3157 
3162 #define AVPALETTE_SIZE 1024
3163 #define AVPALETTE_COUNT 256
3164 
3167 
3169 
3175 
3181 };
3182 
3183 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3184 
3185 typedef struct AVSubtitleRect {
3186  int x;
3187  int y;
3188  int w;
3189  int h;
3191 
3198 
3199  char *text;
3200 
3206  char *ass;
3207  int flags;
3208 } AVSubtitleRect;
3209 
3210 typedef struct AVSubtitle {
3211  uint16_t format; /* 0 = graphics */
3212  uint32_t start_display_time; /* relative to packet pts, in ms */
3213  uint32_t end_display_time; /* relative to packet pts, in ms */
3214  unsigned num_rects;
3216  int64_t pts;
3217 } AVSubtitle;
3218 
3224 AVCodec *av_codec_next(const AVCodec *c);
3225 
3229 unsigned avcodec_version(void);
3230 
3234 const char *avcodec_configuration(void);
3235 
3239 const char *avcodec_license(void);
3240 
3249 void avcodec_register(AVCodec *codec);
3250 
3261 void avcodec_register_all(void);
3262 
3279 
3290 
3297 const AVClass *avcodec_get_class(void);
3298 
3310 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
3311 
3320 
3326 void avcodec_get_frame_defaults(AVFrame *frame);
3327 
3338 void avcodec_free_frame(AVFrame **frame);
3339 
3376 int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
3377 
3387 int avcodec_close(AVCodecContext *avctx);
3388 
3394 void avsubtitle_free(AVSubtitle *sub);
3395 
3408 void av_destruct_packet(AVPacket *pkt);
3409 
3418 void av_init_packet(AVPacket *pkt);
3419 
3428 int av_new_packet(AVPacket *pkt, int size);
3429 
3436 void av_shrink_packet(AVPacket *pkt, int size);
3437 
3444 int av_grow_packet(AVPacket *pkt, int grow_by);
3445 
3450 int av_dup_packet(AVPacket *pkt);
3451 
3457 void av_free_packet(AVPacket *pkt);
3458 
3468  int size);
3469 
3479  int size);
3480 
3490  int *size);
3491 
3508 
3516 
3520 
3528 unsigned avcodec_get_edge_width(void);
3529 
3540 
3551  int linesize_align[AV_NUM_DATA_POINTERS]);
3552 
3553 #if FF_API_OLD_DECODE_AUDIO
3554 
3608 attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
3609  int *frame_size_ptr,
3610  AVPacket *avpkt);
3611 #endif
3612 
3646 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
3647  int *got_frame_ptr, AVPacket *avpkt);
3648 
3691  int *got_picture_ptr,
3692  AVPacket *avpkt);
3693 
3711  int *got_sub_ptr,
3712  AVPacket *avpkt);
3713 
3719 typedef struct AVCodecParserContext {
3720  void *priv_data;
3722  int64_t frame_offset; /* offset of the current frame */
3723  int64_t cur_offset; /* current offset
3724  (incremented by each av_parser_parse()) */
3725  int64_t next_frame_offset; /* offset of the next frame */
3726  /* video info */
3727  int pict_type; /* XXX: Put it back in AVCodecContext. */
3737  int repeat_pict; /* XXX: Put it back in AVCodecContext. */
3738  int64_t pts; /* pts of the current frame */
3739  int64_t dts; /* dts of the current frame */
3740 
3741  /* private data */
3742  int64_t last_pts;
3743  int64_t last_dts;
3745 
3746 #define AV_PARSER_PTS_NB 4
3751 
3752  int flags;
3753 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
3754 #define PARSER_FLAG_ONCE 0x0002
3755 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
3757 
3758  int64_t offset;
3760 
3768 
3787 
3788  // Timestamp generation support:
3799 
3814 
3828 
3835 
3839  int64_t pos;
3840 
3844  int64_t last_pos;
3845 
3853 
3854 typedef struct AVCodecParser {
3855  int codec_ids[5]; /* several codec IDs are permitted */
3859  AVCodecContext *avctx,
3860  const uint8_t **poutbuf, int *poutbuf_size,
3861  const uint8_t *buf, int buf_size);
3863  int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
3865 } AVCodecParser;
3866 
3868 
3871 
3901  AVCodecContext *avctx,
3902  uint8_t **poutbuf, int *poutbuf_size,
3903  const uint8_t *buf, int buf_size,
3904  int64_t pts, int64_t dts,
3905  int64_t pos);
3906 
3912  AVCodecContext *avctx,
3913  uint8_t **poutbuf, int *poutbuf_size,
3914  const uint8_t *buf, int buf_size, int keyframe);
3916 
3934 
3942 
3943 #if FF_API_OLD_ENCODE_AUDIO
3944 
3968 int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
3969  uint8_t *buf, int buf_size,
3970  const short *samples);
3971 #endif
3972 
4011 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
4012  const AVFrame *frame, int *got_packet_ptr);
4013 
4014 #if FF_API_OLD_ENCODE_VIDEO
4015 
4030 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
4031  const AVFrame *pict);
4032 #endif
4033 
4068 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
4069  const AVFrame *frame, int *got_packet_ptr);
4070 
4071 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
4072  const AVSubtitle *sub);
4073 
4074 
4079 #if FF_API_AVCODEC_RESAMPLE
4080 
4087 struct ReSampleContext;
4088 struct AVResampleContext;
4089 
4090 typedef struct ReSampleContext ReSampleContext;
4091 
4109 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
4110  int output_rate, int input_rate,
4111  enum AVSampleFormat sample_fmt_out,
4112  enum AVSampleFormat sample_fmt_in,
4113  int filter_length, int log2_phase_count,
4114  int linear, double cutoff);
4115 
4117 int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
4118 
4126 void audio_resample_close(ReSampleContext *s);
4127 
4128 
4139 struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
4140 
4151 int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
4152 
4153 
4167 void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
4169 void av_resample_close(struct AVResampleContext *c);
4170 
4174 #endif
4175 
4193 
4202 
4224  enum AVPixelFormat pix_fmt, int width, int height);
4225 
4241 int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
4242  int width, int height,
4243  unsigned char *dest, int dest_size);
4244 
4258 
4262 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
4263  enum AVPixelFormat pix_fmt, int width, int height);
4267 void av_picture_copy(AVPicture *dst, const AVPicture *src,
4268  enum AVPixelFormat pix_fmt, int width, int height);
4269 
4273 int av_picture_crop(AVPicture *dst, const AVPicture *src,
4274  enum AVPixelFormat pix_fmt, int top_band, int left_band);
4275 
4279 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
4280  int padtop, int padbottom, int padleft, int padright, int *color);
4281 
4306 void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
4307 
4314 
4315 #define FF_LOSS_RESOLUTION 0x0001
4316 #define FF_LOSS_DEPTH 0x0002
4317 #define FF_LOSS_COLORSPACE 0x0004
4318 #define FF_LOSS_ALPHA 0x0008
4319 #define FF_LOSS_COLORQUANT 0x0010
4320 #define FF_LOSS_CHROMA 0x0020
4339 int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
4340  int has_alpha);
4341 
4342 #if FF_API_FIND_BEST_PIX_FMT
4343 
4368 enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
4369  int has_alpha, int *loss_ptr);
4370 #endif /* FF_API_FIND_BEST_PIX_FMT */
4371 
4390  enum AVPixelFormat src_pix_fmt,
4391  int has_alpha, int *loss_ptr);
4392 
4393 enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
4394 
4400 
4408 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
4409 
4410 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
4411 
4419 const char *av_get_profile_name(const AVCodec *codec, int profile);
4420 
4421 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
4422 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
4423 //FIXME func typedef
4424 
4442  enum AVSampleFormat sample_fmt, const uint8_t *buf,
4443  int buf_size, int align);
4444 
4449 
4451 
4459 
4469 
4478 int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
4479 
4480 
4482  void *priv_data;
4487 
4488 
4489 typedef struct AVBitStreamFilter {
4490  const char *name;
4493  AVCodecContext *avctx, const char *args,
4494  uint8_t **poutbuf, int *poutbuf_size,
4495  const uint8_t *buf, int buf_size, int keyframe);
4499 
4503  AVCodecContext *avctx, const char *args,
4504  uint8_t **poutbuf, int *poutbuf_size,
4505  const uint8_t *buf, int buf_size, int keyframe);
4507 
4509 
4510 /* memory */
4511 
4517 void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
4518 
4531 void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
4532 
4540 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
4541 
4549 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
4550 
4563 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
4564 
4573 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
4574 
4578 void av_register_hwaccel(AVHWAccel *hwaccel);
4579 
4586 
4587 
4591 enum AVLockOp {
4596 };
4597 
4611 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
4612 
4617 
4623 
4627 int av_codec_is_encoder(const AVCodec *codec);
4628 
4632 int av_codec_is_decoder(const AVCodec *codec);
4633 
4638 
4647 
4653 
4658 #endif /* AVCODEC_AVCODEC_H */
codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it ...
Definition: avcodec.h:428
int(* parser_init)(AVCodecParserContext *s)
Definition: avcodec.h:3857
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
Definition: avcodec.h:2248
const struct AVCodec * codec
Definition: avcodec.h:1348
discard all frames except keyframes
Definition: avcodec.h:535
AVSideDataParamChangeFlags
Definition: avcodec.h:964
unsigned int stream_codec_tag
fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + ...
Definition: avcodec.h:1373
int(* start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
Called at the beginning of each frame or field picture.
Definition: avcodec.h:3106
attribute_deprecated int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
Definition: avcodec.h:2718
struct AVCodecParser AVCodecParser
static int16_t * samples
AVPacketSideDataType
Definition: avcodec.h:833
int size
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
Definition: avcodec.h:3155
void av_free_packet(AVPacket *pkt)
Free a packet.
Definition: avpacket.c:153
This structure describes decoded (raw) audio or video data.
Definition: avcodec.h:989
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int, int), void *arg, int *ret, int count)
int qstride
QP store stride.
Definition: avcodec.h:1145
AVPanScan * pan_scan
Pan scan.
Definition: avcodec.h:1260
AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
Definition: utils.c:1496
#define c2
Definition: idct_sh4.c:28
int x
top left corner of pict, undefined when pict is not set
Definition: avcodec.h:3186
int mpeg_quant
0-> h263 quant 1-> mpeg quant
Definition: avcodec.h:1641
int dct_algo
DCT algorithm, see FF_DCT_* below.
Definition: avcodec.h:2648
A dummy id pointing at the start of audio codecs.
Definition: avcodec.h:270
uint64_t error[AV_NUM_DATA_POINTERS]
error
Definition: avcodec.h:2641
mpeg2/4, h264 default
Definition: avcodec.h:585
int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height)
Fill in the AVPicture fields.
Definition: avpicture.c:34
int coded_width
Bitstream width / height, may be different from width/height.
Definition: avcodec.h:1515
int buffer_hints
codec suggestion on buffer type if != 0
Definition: avcodec.h:1253
int capabilities
Hardware accelerated codec capabilities.
Definition: avcodec.h:3088
void(* flush)(AVCodecContext *)
Flush buffers.
Definition: avcodec.h:3049
int av_lockmgr_register(int(*cb)(void **mutex, enum AVLockOp op))
Register a user provided lock manager supporting the operations specified by AVLockOp.
Definition: utils.c:2059
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
Definition: avcodec.h:2259
float qblur
amount of qscale smoothing over time (0.0-1.0)
Definition: avcodec.h:2278
Unlock the mutex.
Definition: avcodec.h:4594
float border_masking
Border processing masking, raises the quantizer for mbs on the borders of the picture.
Definition: avcodec.h:1973
int64_t pos
byte position in stream, -1 if unknown
Definition: avcodec.h:940
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
Definition: avpacket.c:75
int64_t next_frame_offset
Definition: avcodec.h:3725
AVFrame * coded_frame
the picture in the bitstream
Definition: avcodec.h:2725
int id
id
Definition: avcodec.h:794
int qscale_type
Definition: avcodec.h:1150
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
Definition: avcodec.h:1588
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
Definition: avcodec.h:2376
Dummy codec for streams containing only metadata information.
Definition: avcodec.h:434
void * hwaccel_picture_private
hardware accelerator private data (Libav-allocated)
Definition: avcodec.h:1280
int height
Definition: avcodec.h:802
const char * avcodec_configuration(void)
Return the libavcodec build-time configuration.
Definition: utils.c:1708
void * opaque
for some private data of the user
Definition: avcodec.h:1202
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: avcodec.h:2079
int qscale
Definition: avcodec.h:613
struct AVBitStreamFilter * next
Definition: avcodec.h:4497
int repeat_pict
When decoding, this signals how much the picture must be delayed.
Definition: avcodec.h:1225
struct AVCodecContext * owner
the AVCodecContext which ff_thread_get_buffer() was last called on
Definition: avcodec.h:1287
void(* rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb)
Definition: avcodec.h:2471
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
Definition: utils.c:149
int nb_colors
number of colors in pict, undefined when pict is not set
Definition: avcodec.h:3190
int size
Definition: avcodec.h:916
char codec_name[32]
Definition: avcodec.h:1349
int mb_lmin
minimum MB lagrange multipler
Definition: avcodec.h:1980
const char * avcodec_license(void)
Return the libavcodec license.
Definition: utils.c:1713
int codec_ids[5]
Definition: avcodec.h:3855
enhanced predictive zonal search
Definition: avcodec.h:517
void * thread_opaque
used by multithreading to store frame-specific info
Definition: avcodec.h:1294
void void av_register_hwaccel(AVHWAccel *hwaccel)
Register the hardware accelerator hwaccel.
Definition: utils.c:2034
enum AVPixelFormat pix_fmt
Supported pixel format.
Definition: avcodec.h:3082
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
Definition: avcodec.h:1724
int av_picture_crop(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int top_band, int left_band)
Crop image top and left side.
Definition: imgconvert.c:284
void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Definition: imgconvert.c:53
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1533
external API header
int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size)
Copy pixel data from an AVPicture into a buffer.
Definition: avpicture.c:49
unsigned num_rects
Definition: avcodec.h:3214
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer with padding, reusing the given one if large enough.
Definition: utils.c:85
enum AVMediaType type
Type of codec implemented by the hardware accelerator.
Definition: avcodec.h:3068
A dummy ID pointing at the start of various fake codecs.
Definition: avcodec.h:425
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
Definition: avcodec.h:2510
int ildct_cmp
interlaced DCT comparison function
Definition: avcodec.h:1749
enum AVMediaType type
Definition: avcodec.h:2973
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
Put a string representing the codec tag codec_tag in buf.
Definition: utils.c:1557
int rtp_payload_size
Definition: avcodec.h:2473
int(* decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt)
Definition: avcodec.h:3043
AVColorRange
Definition: avcodec.h:571
AVChromaLocation
X X 3 4 X X are luma samples, 1 2 1-6 are possible chroma positions X X 5 6 X 0 is undefined/unknown ...
Definition: avcodec.h:583
int duration
Duration of the current frame.
Definition: avcodec.h:3851
discard all
Definition: avcodec.h:536
int intra_quant_bias
intra quantizer bias
Definition: avcodec.h:1840
int64_t cur_frame_pos[AV_PARSER_PTS_NB]
Position of the packet in file.
Definition: avcodec.h:3834
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of audio.
Definition: utils.c:946
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:2711
void avcodec_register_all(void)
Register all the codecs, parsers and bitstream filters which were enabled at configuration time...
Definition: allcodecs.c:67
int dts_ref_dts_delta
Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base.
Definition: avcodec.h:3813
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)
Decode a subtitle message.
Definition: utils.c:1404
int av_dup_packet(AVPacket *pkt)
Definition: avpacket.c:122
four components are given, that's all.
Definition: avcodec.h:3153
Not part of ABI.
Definition: avcodec.h:547
int profile
profile
Definition: avcodec.h:2815
int lmax
maximum Lagrange multipler
Definition: avcodec.h:2409
int frame_skip_cmp
frame skip comparison function
Definition: avcodec.h:2437
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
Definition: avcodec.h:873
AVCodec.
Definition: avcodec.h:2960
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
Definition: options.c:140
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
Definition: avcodec.h:2141
float i_quant_offset
qscale offset between P and I-frames
Definition: avcodec.h:1657
AVLockOp
Lock operation used by lockmgr.
Definition: avcodec.h:4591
uint64_t vbv_delay
VBV delay coded in the last frame (in periods of a 27 MHz clock).
Definition: avcodec.h:2942
char * text
0 terminated plain UTF-8 text
Definition: avcodec.h:3199
int scenechange_threshold
scene change detection threshold 0 is default, larger means fewer detected scene changes.
Definition: avcodec.h:1907
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
Definition: avcodec.h:2273
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1465
int av_codec_is_decoder(const AVCodec *codec)
Definition: utils.c:125
AVSubtitleRect ** rects
Definition: avcodec.h:3215
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
Definition: avcodec.h:2179
const AVCodecDescriptor * avcodec_descriptor_next(const AVCodecDescriptor *prev)
Iterate over all codec descriptors known to libavcodec.
Definition: codec_desc.c:2197
void av_picture_copy(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height)
Copy image src to dst.
Definition: avpicture.c:119
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align)
Fill audio frame data and linesize.
Definition: utils.c:264
enum AVDiscard skip_frame
Definition: avcodec.h:2907
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
Definition: options.c:197
int av_codec_is_encoder(const AVCodec *codec)
Definition: utils.c:120
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
Definition: utils.c:249
int w
width of pict, undefined when pict is not set
Definition: avcodec.h:3188
struct AVHWAccel * hwaccel
Hardware accelerator in use.
Definition: avcodec.h:2622
float p_masking
p block masking (0-> disabled)
Definition: avcodec.h:1685
int context_model
context model
Definition: avcodec.h:2395
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
Definition: utils.c:72
AVCodecParserContext * parser
Definition: avcodec.h:4484
Public dictionary API.
int(* init_thread_copy)(AVCodecContext *)
If defined, called on thread contexts when they are created.
Definition: avcodec.h:3007
int bit_rate_tolerance
number of bits the bitstream is allowed to diverge from the reference.
Definition: avcodec.h:1412
int mb_lmax
maximum MB lagrange multipler
Definition: avcodec.h:1987
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
Definition: utils.c:597
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:2112
Lock the mutex.
Definition: avcodec.h:4593
uint8_t
void * hwaccel_context
Hardware accelerator context.
Definition: avcodec.h:2634
int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
Definition: parser.c:170
int subtitle_header_size
Definition: avcodec.h:2918
int me_range
maximum motion estimation search range in subpel units If 0 then no limit.
Definition: avcodec.h:1833
uint8_t * data[AV_NUM_DATA_POINTERS]
Definition: avcodec.h:3154
unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt)
Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found.
Definition: raw.c:170
struct AVCodecContext AVCodecContext
main external API structure.
float b_quant_factor
qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q...
Definition: avcodec.h:1597
Not part of ABI.
Definition: avcodec.h:575
int pre_dia_size
ME prepass diamond size & shape.
Definition: avcodec.h:1800
int64_t pts
presentation timestamp in time_base units (time when frame should be shown to user) If AV_NOPTS_VALUE...
Definition: avcodec.h:1088
uint8_t motion_subsample_log2
log2 of the size of the block which a single vector in motion_val represents: (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
Definition: avcodec.h:1302
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1454
const char * name
const AVClass * av_class
information on struct for av_log
Definition: avcodec.h:1344
int scenechange_factor
Multiplied by qscale for each frame and added to scene_change_score.
Definition: avcodec.h:2036
int me_cmp
motion estimation comparison function
Definition: avcodec.h:1731
int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of video.
Definition: utils.c:1166
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition: avcodec.h:553
struct AVCodecParser * next
Definition: avcodec.h:3864
int rc_strategy
obsolete FIXME remove
Definition: avcodec.h:1600
mpeg1, jpeg, h263
Definition: avcodec.h:586
const char data[16]
Definition: mxf.c:66
const char * name
Definition: avcodec.h:4490
int coder_type
coder type
Definition: avcodec.h:2388
uint8_t * data
Definition: avcodec.h:915
int mb_threshold
Macroblock threshold below which the user specified macroblock types will be used.
Definition: avcodec.h:1944
Motion_Est_ID
motion estimation type.
Definition: avcodec.h:512
int interlaced_frame
The content of the picture is interlaced.
Definition: avcodec.h:1232
int(* parser_parse)(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: avcodec.h:3858
int h
height of pict, undefined when pict is not set
Definition: avcodec.h:3189
void avpicture_free(AVPicture *picture)
Free a picture previously allocated by avpicture_alloc().
Definition: avpicture.c:114
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
Definition: avcodec.h:2704
int min_prediction_order
Definition: avcodec.h:2450
float lumi_masking
luminance masking (0-> disabled)
Definition: avcodec.h:1664
char * stats_out
pass1 encoding statistics output buffer
Definition: avcodec.h:2502
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:937
struct AVBitStreamFilterContext * next
Definition: avcodec.h:4485
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
Definition: avcodec.h:2086
float rc_qmod_amp
Definition: avcodec.h:2309
float quality_factor
Definition: avcodec.h:614
hexagon based search
Definition: avcodec.h:519
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
Definition: utils.c:1501
int chromaoffset
chroma qp offset from luma
Definition: avcodec.h:2029
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS])
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
Definition: utils.c:159
void(* destruct)(struct AVPacket *)
Definition: avcodec.h:938
int slice_count
slice count
Definition: avcodec.h:1699
Libavcodec version macros.
int(* close)(AVCodecContext *)
Definition: avcodec.h:3044
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
Definition: utils.c:1437
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: avpacket.c:56
no search, that is use 0,0 vector whenever one is needed
Definition: avcodec.h:513
enum AVCodecID id
Definition: avcodec.h:2974
const uint64_t * channel_layouts
array of support channel layouts, or NULL if unknown. array is terminated by 0
Definition: avcodec.h:2984
AVHWAccel * av_hwaccel_next(AVHWAccel *hwaccel)
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL...
Definition: utils.c:2043
reserved for experiments
Definition: avcodec.h:518
const AVCodecDefault * defaults
Private codec-specific defaults.
Definition: avcodec.h:3021
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:95
int width
width and height of the video frame
Definition: avcodec.h:1035
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
Definition: utils.c:1813
int has_b_frames
Size of the frame reordering buffer in the decoder.
Definition: avcodec.h:1634
int64_t pos
Byte position of currently parsed frame in stream.
Definition: avcodec.h:3839
Create a mutex.
Definition: avcodec.h:4592
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
int priv_data_size
Definition: avcodec.h:3856
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
Definition: utils.c:53
struct AVCodecParser * parser
Definition: avcodec.h:3721
AVAudioServiceType
Definition: avcodec.h:594
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
Definition: avcodec.h:1132
int y
top left corner of pict, undefined when pict is not set
Definition: avcodec.h:3187
discard all bidirectional frames
Definition: avcodec.h:534
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: avcodec.h:852
short * dct_coeff
DCT coefficients.
Definition: avcodec.h:1187
int frame_skip_threshold
frame skip threshold
Definition: avcodec.h:2416
int me_sub_cmp
subpixel motion estimation comparison function
Definition: avcodec.h:1737
int qmax
maximum quantizer
Definition: avcodec.h:2292
AVCodec * av_codec_next(const AVCodec *c)
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec...
Definition: utils.c:101
enum AVSampleFormat request_sample_fmt
Used to request a sample format from the decoder.
Definition: avcodec.h:2186
int active_thread_type
Which multithreading methods are in use by the codec.
Definition: avcodec.h:2752
int avcodec_is_open(AVCodecContext *s)
Definition: utils.c:2146
int error_concealment
error concealment flags
Definition: avcodec.h:2559
int64_t convergence_duration
Time difference in AVStream->time_base units from the pts of this packet to the point at which the ou...
Definition: avcodec.h:959
int capabilities
Codec capabilities.
Definition: avcodec.h:2979
void av_bitstream_filter_close(AVBitStreamFilterContext *bsf)
struct AVCodecParserContext AVCodecParserContext
uint8_t * base[AV_NUM_DATA_POINTERS]
pointer to the first allocated byte of the picture.
Definition: avcodec.h:1073
struct AVCodec AVCodec
AVCodec.
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:348
struct AVSubtitle AVSubtitle
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1434
int rc_max_rate
maximum bitrate
Definition: avcodec.h:2339
int log_level_offset
Definition: avcodec.h:1345
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
Get the type of the given codec.
Definition: utils.c:2132
AVBitStreamFilter * av_bitstream_filter_next(AVBitStreamFilter *f)
const char * name
Name of the codec implementation.
Definition: avcodec.h:2967
int64_t cur_frame_dts[AV_PARSER_PTS_NB]
Definition: avcodec.h:3750
float i_quant_factor
qscale factor between P and I-frames If > 0 then the last p frame quantizer will be used (q= lastp_q*...
Definition: avcodec.h:1650
int side_data_elems
Definition: avcodec.h:931
const char * rc_eq
rate control equation
Definition: avcodec.h:2332
int width
width and height in 1/16 pel
Definition: avcodec.h:801
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Shrink the already allocated side data buffer.
Definition: avpacket.c:205
const char * long_name
A more descriptive name for this codec.
Definition: avcodec.h:462
enum AVCodecID codec_id
Definition: mov_chan.c:432
void * thread_opaque
thread opaque Can be used by execute() to store some per AVCodecContext stuff.
Definition: avcodec.h:2801
struct AVPicture AVPicture
four components are given, that's all.
#define AV_NUM_DATA_POINTERS
Definition: avcodec.h:990
transformed exhaustive search algorithm
Definition: avcodec.h:522
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height)
deinterlace - if not supported return -1
Definition: imgconvert.c:476
functionally identical to above
Definition: avcodec.h:545
AVCodecParser * av_parser_next(AVCodecParser *c)
Definition: parser.c:30
struct AVBitStreamFilter AVBitStreamFilter
int priv_data_size
Size of HW accelerator private data.
Definition: avcodec.h:3139
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:921
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
Definition: codec_desc.c:2187
uint64_t channel_layout
Audio channel layout.
Definition: avcodec.h:2165
uint32_t end_display_time
Definition: avcodec.h:3213
int64_t pts
Same as packet pts, in AV_TIME_BASE.
Definition: avcodec.h:3216
int rc_buffer_size
decoder bitstream buffer size
Definition: avcodec.h:2317
the normal 2^n-1 "JPEG" YUV ranges
Definition: avcodec.h:574
uint64_t channel_layout
Channel layout of the audio data.
Definition: avcodec.h:1318
int props
Codec properties, a combination of AV_CODEC_PROP_* flags.
Definition: avcodec.h:466
int intra_dc_precision
precision of the intra DC coefficient - 8
Definition: avcodec.h:1951
int me_penalty_compensation
Definition: avcodec.h:1994
also ITU-R BT1361
Definition: avcodec.h:551
int(* encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
Definition: avcodec.h:3029
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
Definition: utils.c:618
int dtg_active_format
DTG active format information (additional aspect ratio information only used in DVB MPEG-2 transport ...
Definition: avcodec.h:1817
Not part of ABI.
Definition: avcodec.h:604
the normal 219*2^(n-8) "MPEG" YUV ranges
Definition: avcodec.h:573
int refs
number of reference frames
Definition: avcodec.h:2022
A bitmap, pict will be set.
Definition: avcodec.h:3168
int rc_override_count
ratecontrol override, see RcOverride
Definition: avcodec.h:2324
void(* draw_horiz_band)(struct AVCodecContext *s, const AVFrame *src, int offset[AV_NUM_DATA_POINTERS], int y, int type, int height)
If non NULL, 'draw_horiz_band' is called by the libavcodec decoder to draw a horizontal band...
Definition: avcodec.h:1567
int bit_rate
the average bitrate
Definition: avcodec.h:1404
struct RcOverride RcOverride
static AVFrame * picture
int64_t timecode_frame_start
GOP timecode frame start number, in non drop frame format.
Definition: avcodec.h:2463
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
Definition: avcodec.h:2981
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
Definition: avcodec.h:1065
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
Definition: avcodec.h:2602
AVPicture pict
data+linesize for the bitmap of this subtitle.
Definition: avcodec.h:3196
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:3061
int display_picture_number
picture number in display order
Definition: avcodec.h:1115
iterative search
Definition: avcodec.h:521
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
Definition: utils.c:1770
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
Definition: options.c:126
int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts, int64_t pos)
Parse a packet.
Definition: parser.c:113
int width
picture width / height.
Definition: avcodec.h:1508
Not part of ABI.
Definition: avcodec.h:591
void(* parser_close)(AVCodecParserContext *s)
Definition: avcodec.h:3862
AVBitStreamFilterContext * av_bitstream_filter_init(const char *name)
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
Definition: avcodec.h:2661
int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic)
Definition: utils.c:524
int type
type of the buffer (to keep track of who has to deallocate data[*])
Definition: avcodec.h:1217
int64_t offset
byte offset from starting packet start
Definition: avcodec.h:3758
int priv_data_size
Definition: avcodec.h:2996
int profile
Definition: avcodec.h:2949
void * priv
Definition: avcodec.h:939
float rc_max_available_vbv_use
Ratecontrol attempt to use, at maximum, of what can be used without an underflow. ...
Definition: avcodec.h:2362
float rc_min_vbv_overflow_use
Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow.
Definition: avcodec.h:2369
int64_t convergence_duration
Time difference in stream time base units from the pts of this packet to the point at which the outpu...
Definition: avcodec.h:3786
void av_parser_close(AVCodecParserContext *s)
Definition: parser.c:203
int b_frame_strategy
Definition: avcodec.h:1603
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:2058
void av_register_bitstream_filter(AVBitStreamFilter *bsf)
float rc_qsquish
ratecontrol qmin qmax limiting method 0-> clipping, 1-> use a nice continuous function to limit qscal...
Definition: avcodec.h:2307
int start_frame
Definition: avcodec.h:611
uint16_t format
Definition: avcodec.h:3211
int level
level
Definition: avcodec.h:2885
int quality
quality (between 1 (good) and FF_LAMBDA_MAX (bad))
Definition: avcodec.h:1122
const AVProfile * profiles
array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} ...
Definition: avcodec.h:2987
int64_t reordered_opaque
opaque 64bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
Definition: avcodec.h:2615
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
Definition: avcodec.h:1474
int skip_top
Number of macroblock rows at the top which are skipped.
Definition: avcodec.h:1958
int mb_decision
macroblock decision mode
Definition: avcodec.h:1882
int last_predictor_count
amount of previous MV predictors (2a+1 x 2a+1 square)
Definition: avcodec.h:1779
int max_qdiff
maximum quantizer difference between frames
Definition: avcodec.h:2299
enum AVPixelFormat pix_fmt
Definition: movenc.c:801
int64_t cur_frame_end[AV_PARSER_PTS_NB]
Definition: avcodec.h:3759
static pthread_mutex_t * mutex
Definition: w32pthreads.h:67
int lmin
minimum Lagrange multipler
Definition: avcodec.h:2402
int64_t cur_frame_pts[AV_PARSER_PTS_NB]
Definition: avcodec.h:3749
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:100
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
Definition: codec_desc.c:2206
RcOverride * rc_override
Definition: avcodec.h:2325
int64_t last_pos
Previous frame byte position.
Definition: avcodec.h:3844
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
Definition: avcodec.h:2733
int xvmc_acceleration
XVideo Motion Acceleration.
Definition: avcodec.h:1875
int inter_quant_bias
inter quantizer bias
Definition: avcodec.h:1848
void avcodec_flush_buffers(AVCodecContext *avctx)
Flush buffers, should be called when seeking or when switching to a different stream.
Definition: utils.c:1719
FAKE codec to indicate a MPEG-4 Systems stream (only used by libavformat)
Definition: avcodec.h:432
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
Definition: avcodec.h:1051
uint32_t * mb_type
macroblock type table mb_type_base + mb_width + 2
Definition: avcodec.h:1180
int frame_skip_factor
frame skip factor
Definition: avcodec.h:2423
const char * av_get_profile_name(const AVCodec *codec, int profile)
Return a name for the specified profile, if available.
Definition: utils.c:1690
int frame_size
Number of samples per channel in an audio frame.
Definition: avcodec.h:2124
int pts_dts_delta
Presentation delay of current frame in units of AVCodecContext.time_base.
Definition: avcodec.h:3827
const char * long_name
Descriptive name for the codec, meant to be more human readable than name.
Definition: avcodec.h:2972
float rc_initial_cplx
initial complexity for pass1 ratecontrol
Definition: avcodec.h:2355
int bidir_refine
Definition: avcodec.h:2001
static int width
Definition: utils.c:156
int coded_picture_number
picture number in bitstream order
Definition: avcodec.h:1109
int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
uint64_t error[AV_NUM_DATA_POINTERS]
error
Definition: avcodec.h:1209
AVCodecParserContext * av_parser_init(int codec_id)
Definition: parser.c:41
sample_fmt
Definition: avconv_filter.c:63
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: avcodec.h:561
enum AVMediaType codec_type
Definition: avcodec.h:1347
void(* init_static_data)(struct AVCodec *codec)
Initialize codec static data, called from avcodec_register().
Definition: avcodec.h:3026
int me_threshold
Motion estimation threshold below which no motion estimation is performed, but instead the user speci...
Definition: avcodec.h:1937
const AVRational * supported_framerates
array of supported framerates, or NULL if any, array is terminated by {0,0}
Definition: avcodec.h:2980
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: avcodec.h:543
enum AVCodecID codec_id
Definition: avcodec.h:1350
AVHWAccel.
Definition: avcodec.h:3055
int compression_level
Definition: avcodec.h:1426
int sample_rate
samples per second
Definition: avcodec.h:2104
enum AVDiscard skip_idct
Definition: avcodec.h:2900
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
Definition: avcodec.h:1008
unsigned avcodec_get_edge_width(void)
Return the amount of padding in pixels which the get_buffer callback must provide around the edge of ...
Definition: utils.c:144
int frame_bits
number of bits used for the previously encoded frame
Definition: avcodec.h:2495
Plain text, the text field must be set by the decoder and is authoritative.
Definition: avcodec.h:3174
int debug
debug
Definition: avcodec.h:2568
void av_destruct_packet(AVPacket *pkt)
Default packet destructor.
Definition: avpacket.c:28
main external API structure.
Definition: avcodec.h:1339
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
Definition: utils.c:1515
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
int pre_me
prepass for motion estimation
Definition: avcodec.h:1786
int qmin
minimum quantizer
Definition: avcodec.h:2285
AVColorTransferCharacteristic
Definition: avcodec.h:550
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
Definition: utils.c:1418
AVRational sample_aspect_ratio
sample aspect ratio for the video frame, 0/1 if unknown/unspecified
Definition: avcodec.h:1080
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
Definition: avcodec.h:1365
out nb_samples
Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16.
Definition: avcodec.h:567
int16_t(*[2] motion_val)[2]
motion vector table
Definition: avcodec.h:1172
void avcodec_default_free_buffers(AVCodecContext *s)
Definition: utils.c:1756
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
Definition: utils.c:489
float spatial_cplx_masking
spatial complexity masking (0-> disabled)
Definition: avcodec.h:1678
int extradata_size
Definition: avcodec.h:1455
unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
Encode extradata length to a buffer.
Definition: utils.c:1986
struct AVCodec * next
Definition: avcodec.h:2997
struct AVBitStreamFilter * filter
Definition: avcodec.h:4483
uint16_t * intra_matrix
custom intra quantization matrix
Definition: avcodec.h:1892
int slice_flags
slice flags
Definition: avcodec.h:1865
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
Definition: utils.c:604
int coded_height
Definition: avcodec.h:1515
int64_t reordered_opaque
reordered opaque 64bit (generally an integer or a double precision float PTS but can be anything)...
Definition: avcodec.h:1273
Describe the class of an AVClass context structure.
Definition: log.h:33
int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height)
Allocate memory for a picture.
Definition: avpicture.c:101
AVColorPrimaries
Definition: avcodec.h:539
int sample_rate
Sample rate of the audio data.
Definition: avcodec.h:1310
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
callback to negotiate the pixelFormat
Definition: avcodec.h:1580
float rc_buffer_aggressivity
Definition: avcodec.h:2348
void av_log_missing_feature(void *avc, const char *feature, int want_sample)
Log a generic warning message about a missing feature.
Definition: utils.c:2007
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:2072
rational number numerator/denominator
Definition: rational.h:43
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:2065
const char * name
short name for the profile
Definition: avcodec.h:2950
void av_register_codec_parser(AVCodecParser *parser)
Definition: parser.c:35
AVFieldOrder
Definition: avcodec.h:1323
int palette_has_changed
Tell user application that palette has changed from previous frame.
Definition: avcodec.h:1246
struct AVCodecDescriptor AVCodecDescriptor
This struct describes the properties of a single codec described by an AVCodecID. ...
struct AVPacket AVPacket
This structure stores compressed data.
AVMediaType
Definition: avutil.h:177
discard useless packets like 0 size packets in avi
Definition: avcodec.h:532
int8_t * ref_index[2]
motion reference frame index the order in which these are stored can depend on the codec...
Definition: avcodec.h:1195
struct AVFrame AVFrame
This structure describes decoded (raw) audio or video data.
AVPictureType
Definition: avutil.h:244
const char * name
Name of the codec described by this descriptor.
Definition: avcodec.h:458
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
Definition: utils.c:645
float b_quant_offset
qscale offset between IP and B-frames
Definition: avcodec.h:1626
int frame_skip_exp
frame skip exponent
Definition: avcodec.h:2430
#define AV_PARSER_PTS_NB
Definition: avcodec.h:3746
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
Definition: utils.c:1831
struct AVBitStreamFilterContext AVBitStreamFilterContext
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
Definition: avcodec.h:2277
uint16_t * inter_matrix
custom inter quantization matrix
Definition: avcodec.h:1899
int end_frame
Definition: avcodec.h:612
void(* close)(AVBitStreamFilterContext *bsfc)
Definition: avcodec.h:4496
This struct describes the properties of a single codec described by an AVCodecID. ...
Definition: avcodec.h:450
int64_t pkt_pts
pts copied from the AVPacket that was decoded to produce this frame
Definition: avcodec.h:1095
struct AVSubtitleRect AVSubtitleRect
float dark_masking
darkness masking (0-> disabled)
Definition: avcodec.h:1692
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:1420
int skip_bottom
Number of macroblock rows at the bottom which are skipped.
Definition: avcodec.h:1965
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
Definition: utils.c:1520
float temporal_cplx_masking
temporary complexity masking (0-> disabled)
Definition: avcodec.h:1671
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: avcodec.h:544
Pan Scan area.
Definition: avcodec.h:788
const AVClass * priv_class
AVClass for the private context.
Definition: avcodec.h:2986
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: avcodec.h:997
int8_t * qscale_table
QP table.
Definition: avcodec.h:1139
int rc_qmod_freq
Definition: avcodec.h:2310
int noise_reduction
noise reduction strength
Definition: avcodec.h:1914
int height
Definition: gxfenc.c:72
int(* filter)(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
Definition: avcodec.h:4492
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
Definition: avcodec.h:1524
const OptionDef options[]
Definition: avserver.c:4665
enum AVMediaType type
Definition: avcodec.h:452
int64_t pkt_dts
dts copied from the AVPacket that triggered returning this frame
Definition: avcodec.h:1102
AVPacket * pkt
Current packet as passed into the decoder, to avoid having to pass the packet into every function...
Definition: avcodec.h:2934
discard all non reference
Definition: avcodec.h:533
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Definition: anm.c:72
int mb_cmp
macroblock comparison function (not supported yet)
Definition: avcodec.h:1743
int(* split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Definition: avcodec.h:3863
Free mutex resources.
Definition: avcodec.h:4595
rational numbers
raw UTF-8 text
Definition: avcodec.h:416
struct AVHWAccel * next
Definition: avcodec.h:3090
int nsse_weight
noise vs.
Definition: avcodec.h:2808
uint32_t start_display_time
Definition: avcodec.h:3212
int prediction_method
prediction method (needed for huffyuv)
Definition: avcodec.h:1705
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:49
AVProfile.
Definition: avcodec.h:2948
int workaround_bugs
Work around bugs in encoders which sometimes cannot be detected automatically.
Definition: avcodec.h:2517
enum AVCodecID id
Codec implemented by the hardware accelerator.
Definition: avcodec.h:3075
int64_t cur_frame_offset[AV_PARSER_PTS_NB]
Definition: avcodec.h:3748
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
Definition: avpacket.c:83
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
Definition: avpacket.c:42
enum AVDiscard skip_loop_filter
Definition: avcodec.h:2893
int thread_safe_callbacks
Set by the client if its custom get_buffer() callback can be called synchronously from another thread...
Definition: avcodec.h:2762
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
Set the fields of the given AVCodecContext to default values corresponding to the given codec (defaul...
Definition: options.c:80
static const uint8_t color[]
Definition: log.c:52
int trellis
trellis RD quantization
Definition: avcodec.h:2444
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
Definition: utils.c:1572
int slices
Number of slices.
Definition: avcodec.h:2095
int16_t position[3][2]
position of the top left corner in 1/16 pel for up to 3 fields/frames
Definition: avcodec.h:809
void * priv_data
Definition: avcodec.h:1382
int cutoff
Audio cutoff bandwidth (0 means "automatic")
Definition: avcodec.h:2148
int(* update_thread_context)(AVCodecContext *dst, const AVCodecContext *src)
Copy necessary context variables from a previous thread context to the current one.
Definition: avcodec.h:3015
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
Definition: avcodec.h:430
Formatted text, the ass field must be set by the decoder and is authoritative.
Definition: avcodec.h:3180
int64_t frame_offset
Definition: avcodec.h:3722
enum AVCodecID id
Definition: avcodec.h:451
pixel format definitions
int dia_size
ME diamond size & shape.
Definition: avcodec.h:1772
int b_sensitivity
Adjust sensitivity of b_frame_strategy 1.
Definition: avcodec.h:2051
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
Definition: avcodec.h:2773
int top_field_first
If the content is interlaced, is top field displayed first.
Definition: avcodec.h:1239
uneven multi-hexagon search
Definition: avcodec.h:520
as in Berlin toast format
Definition: avcodec.h:365
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
Definition: avcodec.h:2793
int channels
number of audio channels
Definition: avcodec.h:2105
int error_rate
Simulates errors in the bitstream to test error concealment.
Definition: avcodec.h:2925
const int * supported_samplerates
array of supported audio samplerates, or NULL if unknown, array is terminated by 0 ...
Definition: avcodec.h:2982
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color)
Pad image.
Definition: imgconvert.c:307
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
Definition: avpicture.c:85
unsigned avcodec_version(void)
Return the LIBAVCODEC_VERSION_INT constant.
Definition: utils.c:1703
char * ass
0 terminated ASS/SSA compatible event line.
Definition: avcodec.h:3206
int key_frame
1 -> keyframe, 0-> not
Definition: avcodec.h:1058
struct AVPacket::@11 * side_data
Additional packet data that can be provided by the container.
uint8_t * mbskip_table
mbskip_table[mb]>=1 if MB didn't change stride= mb_width = (width+15)>>4
Definition: avcodec.h:1158
int mv0_threshold
Note: Value depends upon the compare function used for fullpel ME.
Definition: avcodec.h:2044
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)
Decode the video frame of size avpkt->size from avpkt->data into picture.
Definition: utils.c:1268
int flags2
CODEC_FLAG2_*.
Definition: avcodec.h:1441
void avcodec_free_frame(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: utils.c:630
AVDiscard
Definition: avcodec.h:528
struct AVProfile AVProfile
AVProfile.
Not part of ABI.
Definition: avcodec.h:568
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
Find the best pixel format to convert to given a certain source pixel format.
Definition: imgconvert.c:157
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:914
void avcodec_register(AVCodec *codec)
Register the codec codec and initialize libavcodec.
Definition: utils.c:130
int * slice_offset
slice offsets in the frame in bytes
Definition: avcodec.h:1715
int frame_number
Frame counter, set by libavcodec.
Definition: avcodec.h:2135
int repeat_pict
This field is used for proper frame duration computation in lavf.
Definition: avcodec.h:3737
int height
Definition: avcodec.h:1035
int max_prediction_order
Definition: avcodec.h:2456
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: avcodec.h:540
enum AVFieldOrder field_order
Field order.
Definition: avcodec.h:2101
AVColorSpace
Definition: avcodec.h:559
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
Definition: avpacket.c:190
int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)
Definition: utils.c:451
enum AVPacketSideDataType type
Definition: avcodec.h:929
enum AVSampleFormat * sample_fmts
array of supported sample formats, or NULL if unknown, array is terminated by -1
Definition: avcodec.h:2983
attribute_deprecated uint8_t max_lowres
maximum value for lowres supported by the decoder
Definition: avcodec.h:2985
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: avcodec.h:564
int nb_channels
int me_method
Motion estimation algorithm used for video coding.
Definition: avcodec.h:1542
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
Definition: avpacket.c:165
int debug_mv
debug
Definition: avcodec.h:2592
int stream_index
Definition: avcodec.h:917
int(* decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
Callback for each slice.
Definition: avcodec.h:3119
int rc_min_rate
minimum bitrate
Definition: avcodec.h:2346
int(* init)(AVCodecContext *)
Definition: avcodec.h:3028
enum AVSubtitleType type
Definition: avcodec.h:3197
also ITU-R BT470BG
Definition: avcodec.h:554
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: avcodec.h:1028
int(* end_frame)(AVCodecContext *avctx)
Called at the end of each frame or field picture.
Definition: avcodec.h:3130
uint64_t request_channel_layout
Request decoder to use this channel layout if it can (0 for default)
Definition: avcodec.h:2172
int me_pre_cmp
motion estimation prepass comparison function
Definition: avcodec.h:1793
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63
This structure stores compressed data.
Definition: avcodec.h:898
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)
Definition: utils.c:1211
int(* encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode data to an AVPacket.
Definition: avcodec.h:3041
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
Definition: avcodec.h:3767
int delay
Codec delay.
Definition: avcodec.h:1497
int me_subpel_quality
subpel ME quality
Definition: avcodec.h:1807
int nb_samples
number of audio samples (per channel) described by this frame
Definition: avcodec.h:1042
int strict_std_compliance
strictly follow the standard (MPEG4, ...).
Definition: avcodec.h:2547
int dts_sync_point
Synchronization point for start of timestamp generation.
Definition: avcodec.h:3798
Not part of ABI.
Definition: avcodec.h:556
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:908
A dummy ID pointing at the start of subtitle codecs.
Definition: avcodec.h:413
void * opaque
Private data of the user, can be used to carry app specific stuff.
Definition: avcodec.h:1397
struct AVHWAccel AVHWAccel
AVHWAccel.
int thread_type
Which multithreading methods to use.
Definition: avcodec.h:2743
AVSubtitleType
Definition: avcodec.h:3165
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
Definition: utils.c:567
discard nothing
Definition: avcodec.h:531
uint8_t * subtitle_header
Header containing style information for text subtitles.
Definition: avcodec.h:2917
int keyint_min
minimum GOP size
Definition: avcodec.h:2015
struct AVPanScan AVPanScan
Pan Scan area.
int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Decode the audio frame of size avpkt->size from avpkt->data into frame.
Definition: utils.c:1362
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above ...
Definition: avcodec.h:565