Libav
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 
30 #include <errno.h>
31 #include "libavutil/samplefmt.h"
32 #include "libavutil/attributes.h"
33 #include "libavutil/avutil.h"
34 #include "libavutil/buffer.h"
35 #include "libavutil/cpu.h"
36 #include "libavutil/dict.h"
37 #include "libavutil/frame.h"
38 #include "libavutil/log.h"
39 #include "libavutil/pixfmt.h"
40 #include "libavutil/rational.h"
41 
42 #include "version.h"
43 
44 #if FF_API_FAST_MALLOC
45 // to provide fast_*alloc
46 #include "libavutil/mem.h"
47 #endif
48 
105 enum AVCodecID {
107 
108  /* video codecs */
111 #if FF_API_XVMC
112  AV_CODEC_ID_MPEG2VIDEO_XVMC,
113 #endif /* FF_API_XVMC */
296 
297  /* various PCM "codecs" */
329 
330  /* various ADPCM codecs */
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 */
410 #if FF_API_VOXWARE
412 #endif
447 
448  /* subtitle codecs */
459 
460  /* other specific kind of codecs (generally used for attachments) */
462  AV_CODEC_ID_TTF = 0x18000,
463 
464  AV_CODEC_ID_PROBE = 0x19000,
465 
471 };
472 
478 typedef struct AVCodecDescriptor {
479  enum AVCodecID id;
486  const char *name;
490  const char *long_name;
494  int props;
496 
501 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
502 
507 #define AV_CODEC_PROP_LOSSY (1 << 1)
508 
511 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
512 
521 #define AV_CODEC_PROP_REORDER (1 << 3)
522 
531 #define FF_INPUT_BUFFER_PADDING_SIZE 8
532 
538 #define FF_MIN_BUFFER_SIZE 16384
539 
540 
546  ME_ZERO = 1,
555 };
556 
561  /* We leave some space between them for extensions (drop some
562  * keyframes for intra-only or drop just some bidir frames). */
569 };
570 
582 };
583 
587 typedef struct RcOverride{
590  int qscale; // If this is 0 then quality_factor will be used instead.
592 } RcOverride;
593 
594 #if FF_API_MAX_BFRAMES
595 
598 #define FF_MAX_B_FRAMES 16
599 #endif
600 
601 /* encoding support
602  These flags can be passed in AVCodecContext.flags before initialization.
603  Note: Not everything is supported yet.
604 */
605 
610 #define CODEC_FLAG_UNALIGNED 0x0001
611 #define CODEC_FLAG_QSCALE 0x0002
612 #define CODEC_FLAG_4MV 0x0004
613 #define CODEC_FLAG_OUTPUT_CORRUPT 0x0008
614 #define CODEC_FLAG_QPEL 0x0010
615 #if FF_API_GMC
616 
619 #define CODEC_FLAG_GMC 0x0020
620 #endif
621 #if FF_API_MV0
622 
626 #define CODEC_FLAG_MV0 0x0040
627 #endif
628 #if FF_API_INPUT_PRESERVED
629 
633 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
634 #endif
635 #define CODEC_FLAG_PASS1 0x0200
636 #define CODEC_FLAG_PASS2 0x0400
637 #define CODEC_FLAG_GRAY 0x2000
638 #if FF_API_EMU_EDGE
639 
643 #define CODEC_FLAG_EMU_EDGE 0x4000
644 #endif
645 #define CODEC_FLAG_PSNR 0x8000
646 #define CODEC_FLAG_TRUNCATED 0x00010000
648 #if FF_API_NORMALIZE_AQP
649 
653 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
654 #endif
655 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
656 #define CODEC_FLAG_LOW_DELAY 0x00080000
657 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
658 #define CODEC_FLAG_BITEXACT 0x00800000
659 /* Fx : Flag for h263+ extra options */
660 #define CODEC_FLAG_AC_PRED 0x01000000
661 #define CODEC_FLAG_LOOP_FILTER 0x00000800
662 #define CODEC_FLAG_INTERLACED_ME 0x20000000
663 #define CODEC_FLAG_CLOSED_GOP 0x80000000
664 #define CODEC_FLAG2_FAST 0x00000001
665 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
666 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
667 #define CODEC_FLAG2_IGNORE_CROP 0x00010000
668 
669 #define CODEC_FLAG2_CHUNKS 0x00008000
670 
671 /* Unsupported options :
672  * Syntax Arithmetic coding (SAC)
673  * Reference Picture Selection
674  * Independent Segment Decoding */
675 /* /Fx */
676 /* codec capabilities */
677 
678 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
679 
684 #define CODEC_CAP_DR1 0x0002
685 #define CODEC_CAP_TRUNCATED 0x0008
686 #if FF_API_XVMC
687 /* Codec can export data for HW decoding (XvMC). */
688 #define CODEC_CAP_HWACCEL 0x0010
689 #endif /* FF_API_XVMC */
690 
713 #define CODEC_CAP_DELAY 0x0020
714 
718 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
719 #if FF_API_CAP_VDPAU
720 
723 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
724 #endif
725 
736 #define CODEC_CAP_SUBFRAMES 0x0100
737 
741 #define CODEC_CAP_EXPERIMENTAL 0x0200
742 
745 #define CODEC_CAP_CHANNEL_CONF 0x0400
746 #if FF_API_NEG_LINESIZES
747 
750 #define CODEC_CAP_NEG_LINESIZES 0x0800
751 #endif
752 
755 #define CODEC_CAP_FRAME_THREADS 0x1000
756 
759 #define CODEC_CAP_SLICE_THREADS 0x2000
760 
763 #define CODEC_CAP_PARAM_CHANGE 0x4000
764 
767 #define CODEC_CAP_AUTO_THREADS 0x8000
768 
771 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
772 
773 #if FF_API_MB_TYPE
774 //The following defines may change, don't expect compatibility if you use them.
775 #define MB_TYPE_INTRA4x4 0x0001
776 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
777 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
778 #define MB_TYPE_16x16 0x0008
779 #define MB_TYPE_16x8 0x0010
780 #define MB_TYPE_8x16 0x0020
781 #define MB_TYPE_8x8 0x0040
782 #define MB_TYPE_INTERLACED 0x0080
783 #define MB_TYPE_DIRECT2 0x0100 //FIXME
784 #define MB_TYPE_ACPRED 0x0200
785 #define MB_TYPE_GMC 0x0400
786 #define MB_TYPE_SKIP 0x0800
787 #define MB_TYPE_P0L0 0x1000
788 #define MB_TYPE_P1L0 0x2000
789 #define MB_TYPE_P0L1 0x4000
790 #define MB_TYPE_P1L1 0x8000
791 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
792 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
793 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
794 #define MB_TYPE_QUANT 0x00010000
795 #define MB_TYPE_CBP 0x00020000
796 //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
797 #endif
798 
804 typedef struct AVPanScan{
810  int id;
811 
817  int width;
818  int height;
819 
825  int16_t position[3][2];
826 }AVPanScan;
827 
828 #if FF_API_QSCALE_TYPE
829 #define FF_QSCALE_TYPE_MPEG1 0
830 #define FF_QSCALE_TYPE_MPEG2 1
831 #define FF_QSCALE_TYPE_H264 2
832 #define FF_QSCALE_TYPE_VP56 3
833 #endif
834 
835 #if FF_API_GET_BUFFER
836 #define FF_BUFFER_TYPE_INTERNAL 1
837 #define FF_BUFFER_TYPE_USER 2
838 #define FF_BUFFER_TYPE_SHARED 4
839 #define FF_BUFFER_TYPE_COPY 8
840 
841 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
842 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
843 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
844 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
845 #endif
846 
850 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
851 
861 
878 
899 
905 
914 
920 };
921 
922 typedef struct AVPacketSideData {
924  int size;
927 
950 typedef struct AVPacket {
966  int64_t pts;
972  int64_t dts;
974  int size;
979  int flags;
986 
991  int duration;
992 #if FF_API_DESTRUCT_PACKET
994  void (*destruct)(struct AVPacket *);
996  void *priv;
997 #endif
998  int64_t pos;
999 
1018 } AVPacket;
1019 #define AV_PKT_FLAG_KEY 0x0001
1020 #define AV_PKT_FLAG_CORRUPT 0x0002
1021 
1027 };
1032 struct AVCodecInternal;
1033 
1037  AV_FIELD_TT, //< Top coded_first, top displayed first
1038  AV_FIELD_BB, //< Bottom coded first, bottom displayed first
1039  AV_FIELD_TB, //< Top coded first, bottom displayed first
1040  AV_FIELD_BT, //< Bottom coded first, top displayed first
1041 };
1042 
1050 typedef struct AVCodecContext {
1057 
1058  enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
1059  const struct AVCodec *codec;
1060 #if FF_API_CODEC_NAME
1061 
1065  char codec_name[32];
1066 #endif
1067  enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
1068 
1082  unsigned int codec_tag;
1083 
1090  unsigned int stream_codec_tag;
1091 
1092  void *priv_data;
1093 
1100  struct AVCodecInternal *internal;
1101 
1107  void *opaque;
1108 
1115 
1123 
1131 
1137 #define FF_COMPRESSION_DEFAULT -1
1138 
1144  int flags;
1145 
1151  int flags2;
1152 
1166 
1176 
1185 
1212  int delay;
1213 
1214 
1215  /* video only */
1225 
1235 
1236 #if FF_API_ASPECT_EXTENDED
1237 #define FF_ASPECT_EXTENDED 15
1238 #endif
1239 
1246 
1255 
1264 
1289  const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
1290  int y, int type, int height);
1291 
1301  enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
1302 
1310 
1319 
1322 #define FF_RC_STRATEGY_XVID 1
1323 
1325 
1332 
1340 
1347 
1356 
1363 
1370 
1377 
1384 
1390  float p_masking;
1391 
1398 
1411 #define FF_PRED_LEFT 0
1412 #define FF_PRED_PLANE 1
1413 #define FF_PRED_MEDIAN 2
1414 
1421 
1430 
1436  int me_cmp;
1448  int mb_cmp;
1455 #define FF_CMP_SAD 0
1456 #define FF_CMP_SSE 1
1457 #define FF_CMP_SATD 2
1458 #define FF_CMP_DCT 3
1459 #define FF_CMP_PSNR 4
1460 #define FF_CMP_BIT 5
1461 #define FF_CMP_RD 6
1462 #define FF_CMP_ZERO 7
1463 #define FF_CMP_VSAD 8
1464 #define FF_CMP_VSSE 9
1465 #define FF_CMP_NSSE 10
1466 #define FF_CMP_DCTMAX 13
1467 #define FF_CMP_DCT264 14
1468 #define FF_CMP_CHROMA 256
1469 
1476 
1483 
1489  int pre_me;
1490 
1497 
1504 
1511 
1512 #if FF_API_AFD
1513 
1523 #define FF_DTG_AFD_SAME 8
1524 #define FF_DTG_AFD_4_3 9
1525 #define FF_DTG_AFD_16_9 10
1526 #define FF_DTG_AFD_14_9 11
1527 #define FF_DTG_AFD_4_3_SP_14_9 13
1528 #define FF_DTG_AFD_16_9_SP_14_9 14
1529 #define FF_DTG_AFD_SP_4_3 15
1530 #endif /* FF_API_AFD */
1531 
1540 
1547 #define FF_DEFAULT_QUANT_BIAS 999999
1548 
1555 
1562 #define SLICE_FLAG_CODED_ORDER 0x0001
1563 #define SLICE_FLAG_ALLOW_FIELD 0x0002
1564 #define SLICE_FLAG_ALLOW_PLANE 0x0004
1565 
1566 #if FF_API_XVMC
1567 
1573  attribute_deprecated int xvmc_acceleration;
1574 #endif /* FF_API_XVMC */
1575 
1582 #define FF_MB_DECISION_SIMPLE 0
1583 #define FF_MB_DECISION_BITS 1
1584 #define FF_MB_DECISION_RD 2
1585 
1586 
1591  uint16_t *intra_matrix;
1592 
1598  uint16_t *inter_matrix;
1599 
1607 
1614 
1623 
1630 
1637 
1644 
1651 
1659 
1665  int mb_lmin;
1666 
1672  int mb_lmax;
1673 
1680 
1687 
1694 
1701 
1707  int refs;
1708 
1715 
1716 #if FF_API_UNUSED_MEMBERS
1717 
1723 #endif
1724 
1732 
1739 
1746 
1753 
1760 
1767 
1774 
1782  int slices;
1783 
1789 
1790  /* audio only */
1792  int channels;
1793 
1800 
1801  /* The following data should not be initialized. */
1812 
1823 
1829 
1835  int cutoff;
1836 
1837 #if FF_API_REQUEST_CHANNELS
1838 
1845 #endif
1846 
1852  uint64_t channel_layout;
1853 
1860 
1867 
1874 
1875 #if FF_API_GET_BUFFER
1876 
1939  int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
1940 
1954 
1968  int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
1969 #endif
1970 
2049  int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
2050 
2063 
2064  /* - encoding parameters */
2065  float qcompress;
2066  float qblur;
2067 
2073  int qmin;
2074 
2080  int qmax;
2081 
2088 
2095  float rc_qsquish;
2096 
2099 
2106 
2114 
2120  const char *rc_eq;
2121 
2128 
2135 
2137 
2144 
2151 
2158 
2165 
2166 #define FF_CODER_TYPE_VLC 0
2167 #define FF_CODER_TYPE_AC 1
2168 #define FF_CODER_TYPE_RAW 2
2169 #define FF_CODER_TYPE_RLE 3
2170 #if FF_API_UNUSED_MEMBERS
2171 #define FF_CODER_TYPE_DEFLATE 4
2172 #endif /* FF_API_UNUSED_MEMBERS */
2173 
2179 
2186 
2192  int lmin;
2193 
2199  int lmax;
2200 
2207 
2214 
2221 
2228 
2234  int trellis;
2235 
2241 
2247 
2254 
2255  /* The RTP callback: This function is called */
2256  /* every time the encoder has a packet to send. */
2257  /* It depends on the encoder if the data starts */
2258  /* with a Start Code (it should). H.263 does. */
2259  /* mb_nb contains the number of macroblocks */
2260  /* encoded in the RTP payload. */
2261  void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
2262 
2263  int rtp_payload_size; /* The size of the RTP payload: the coder will */
2264  /* do its best to deliver a chunk with size */
2265  /* below rtp_payload_size, the chunk will start */
2266  /* with a start code on some codecs like H.263. */
2267  /* This doesn't take account of any particular */
2268  /* headers inside the transmitted RTP payload. */
2269 
2270  /* statistics, used for 2-pass encoding */
2271  int mv_bits;
2275  int i_count;
2276  int p_count;
2279 
2286 
2292  char *stats_out;
2293 
2300  char *stats_in;
2301 
2308 #define FF_BUG_AUTODETECT 1
2309 #if FF_API_OLD_MSMPEG4
2310 #define FF_BUG_OLD_MSMPEG4 2
2311 #endif
2312 #define FF_BUG_XVID_ILACE 4
2313 #define FF_BUG_UMP4 8
2314 #define FF_BUG_NO_PADDING 16
2315 #define FF_BUG_AMV 32
2316 #if FF_API_AC_VLC
2317 #define FF_BUG_AC_VLC 0
2318 #endif
2319 #define FF_BUG_QPEL_CHROMA 64
2320 #define FF_BUG_STD_QPEL 128
2321 #define FF_BUG_QPEL_CHROMA2 256
2322 #define FF_BUG_DIRECT_BLOCKSIZE 512
2323 #define FF_BUG_EDGE 1024
2324 #define FF_BUG_HPEL_CHROMA 2048
2325 #define FF_BUG_DC_CLIP 4096
2326 #define FF_BUG_MS 8192
2327 #define FF_BUG_TRUNCATED 16384
2328 
2342 #define FF_COMPLIANCE_VERY_STRICT 2
2343 #define FF_COMPLIANCE_STRICT 1
2344 #define FF_COMPLIANCE_NORMAL 0
2345 #define FF_COMPLIANCE_UNOFFICIAL -1
2346 #define FF_COMPLIANCE_EXPERIMENTAL -2
2347 
2348 
2354 #define FF_EC_GUESS_MVS 1
2355 #define FF_EC_DEBLOCK 2
2356 
2362  int debug;
2363 #define FF_DEBUG_PICT_INFO 1
2364 #define FF_DEBUG_RC 2
2365 #define FF_DEBUG_BITSTREAM 4
2366 #define FF_DEBUG_MB_TYPE 8
2367 #define FF_DEBUG_QP 16
2368 #if FF_API_DEBUG_MV
2369 
2372 #define FF_DEBUG_MV 32
2373 #endif
2374 #define FF_DEBUG_DCT_COEFF 0x00000040
2375 #define FF_DEBUG_SKIP 0x00000080
2376 #define FF_DEBUG_STARTCODE 0x00000100
2377 #if FF_API_UNUSED_MEMBERS
2378 #define FF_DEBUG_PTS 0x00000200
2379 #endif /* FF_API_UNUSED_MEMBERS */
2380 #define FF_DEBUG_ER 0x00000400
2381 #define FF_DEBUG_MMCO 0x00000800
2382 #define FF_DEBUG_BUGS 0x00001000
2383 #if FF_API_DEBUG_MV
2384 #define FF_DEBUG_VIS_QP 0x00002000
2385 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2386 #endif
2387 #define FF_DEBUG_BUFFERS 0x00008000
2388 #define FF_DEBUG_THREADS 0x00010000
2389 
2390 #if FF_API_DEBUG_MV
2391 
2396 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2397 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2398 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2399 #endif
2400 
2407 
2414 #define AV_EF_CRCCHECK (1<<0)
2415 #define AV_EF_BITSTREAM (1<<1)
2416 #define AV_EF_BUFFER (1<<2)
2417 #define AV_EF_EXPLODE (1<<3)
2418 
2426 
2433 
2445 
2452 
2459 #define FF_DCT_AUTO 0
2460 #define FF_DCT_FASTINT 1
2461 #if FF_API_UNUSED_MEMBERS
2462 #define FF_DCT_INT 2
2463 #endif /* FF_API_UNUSED_MEMBERS */
2464 #define FF_DCT_MMX 3
2465 #define FF_DCT_ALTIVEC 5
2466 #define FF_DCT_FAAN 6
2467 
2474 #define FF_IDCT_AUTO 0
2475 #define FF_IDCT_INT 1
2476 #define FF_IDCT_SIMPLE 2
2477 #define FF_IDCT_SIMPLEMMX 3
2478 #define FF_IDCT_ARM 7
2479 #define FF_IDCT_ALTIVEC 8
2480 #if FF_API_ARCH_SH4
2481 #define FF_IDCT_SH4 9
2482 #endif
2483 #define FF_IDCT_SIMPLEARM 10
2484 #if FF_API_UNUSED_MEMBERS
2485 #define FF_IDCT_IPP 13
2486 #endif /* FF_API_UNUSED_MEMBERS */
2487 #define FF_IDCT_XVID 14
2488 #if FF_API_IDCT_XVIDMMX
2489 #define FF_IDCT_XVIDMMX 14
2490 #endif /* FF_API_IDCT_XVIDMMX */
2491 #define FF_IDCT_SIMPLEARMV5TE 16
2492 #define FF_IDCT_SIMPLEARMV6 17
2493 #if FF_API_ARCH_SPARC
2494 #define FF_IDCT_SIMPLEVIS 18
2495 #endif
2496 #define FF_IDCT_FAAN 20
2497 #define FF_IDCT_SIMPLENEON 22
2498 #if FF_API_ARCH_ALPHA
2499 #define FF_IDCT_SIMPLEALPHA 23
2500 #endif
2501 
2508 
2515 
2516 #if FF_API_LOWRES
2517 
2525 #endif
2526 
2533 
2541 
2551 #define FF_THREAD_FRAME 1
2552 #define FF_THREAD_SLICE 2
2553 
2554 
2560 
2570 
2580  int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
2581 
2600  int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
2601 
2602 #if FF_API_THREAD_OPAQUE
2603 
2608 #endif
2609 
2616 
2622  int profile;
2623 #define FF_PROFILE_UNKNOWN -99
2624 #define FF_PROFILE_RESERVED -100
2625 
2626 #define FF_PROFILE_AAC_MAIN 0
2627 #define FF_PROFILE_AAC_LOW 1
2628 #define FF_PROFILE_AAC_SSR 2
2629 #define FF_PROFILE_AAC_LTP 3
2630 #define FF_PROFILE_AAC_HE 4
2631 #define FF_PROFILE_AAC_HE_V2 28
2632 #define FF_PROFILE_AAC_LD 22
2633 #define FF_PROFILE_AAC_ELD 38
2634 #define FF_PROFILE_MPEG2_AAC_LOW 128
2635 #define FF_PROFILE_MPEG2_AAC_HE 131
2636 
2637 #define FF_PROFILE_DTS 20
2638 #define FF_PROFILE_DTS_ES 30
2639 #define FF_PROFILE_DTS_96_24 40
2640 #define FF_PROFILE_DTS_HD_HRA 50
2641 #define FF_PROFILE_DTS_HD_MA 60
2642 
2643 #define FF_PROFILE_MPEG2_422 0
2644 #define FF_PROFILE_MPEG2_HIGH 1
2645 #define FF_PROFILE_MPEG2_SS 2
2646 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
2647 #define FF_PROFILE_MPEG2_MAIN 4
2648 #define FF_PROFILE_MPEG2_SIMPLE 5
2649 
2650 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
2651 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
2652 
2653 #define FF_PROFILE_H264_BASELINE 66
2654 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2655 #define FF_PROFILE_H264_MAIN 77
2656 #define FF_PROFILE_H264_EXTENDED 88
2657 #define FF_PROFILE_H264_HIGH 100
2658 #define FF_PROFILE_H264_HIGH_10 110
2659 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
2660 #define FF_PROFILE_H264_HIGH_422 122
2661 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
2662 #define FF_PROFILE_H264_HIGH_444 144
2663 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
2664 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
2665 #define FF_PROFILE_H264_CAVLC_444 44
2666 
2667 #define FF_PROFILE_VC1_SIMPLE 0
2668 #define FF_PROFILE_VC1_MAIN 1
2669 #define FF_PROFILE_VC1_COMPLEX 2
2670 #define FF_PROFILE_VC1_ADVANCED 3
2671 
2672 #define FF_PROFILE_MPEG4_SIMPLE 0
2673 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
2674 #define FF_PROFILE_MPEG4_CORE 2
2675 #define FF_PROFILE_MPEG4_MAIN 3
2676 #define FF_PROFILE_MPEG4_N_BIT 4
2677 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
2678 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
2679 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
2680 #define FF_PROFILE_MPEG4_HYBRID 8
2681 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
2682 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
2683 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
2684 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
2685 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
2686 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
2687 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
2688 
2689 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0
2690 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1
2691 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2
2692 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
2693 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
2694 
2695 
2696 #define FF_PROFILE_HEVC_MAIN 1
2697 #define FF_PROFILE_HEVC_MAIN_10 2
2698 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
2699 
2705  int level;
2706 #define FF_LEVEL_UNKNOWN -99
2707 
2714 
2721 
2728 
2739 
2740 #if FF_API_ERROR_RATE
2741 
2747 #endif
2748 
2749 #if FF_API_CODEC_PKT
2750 
2755 #endif
2756 
2763  uint64_t vbv_delay;
2764 
2779 } AVCodecContext;
2780 
2784 typedef struct AVProfile {
2785  int profile;
2786  const char *name;
2787 } AVProfile;
2788 
2789 typedef struct AVCodecDefault AVCodecDefault;
2790 
2791 struct AVSubtitle;
2792 
2796 typedef struct AVCodec {
2803  const char *name;
2808  const char *long_name;
2817  const enum AVPixelFormat *pix_fmts;
2820  const uint64_t *channel_layouts;
2821 #if FF_API_LOWRES
2823 #endif
2826 
2827  /*****************************************************************
2828  * No fields below this line are part of the public API. They
2829  * may not be used outside of libavcodec and can be changed and
2830  * removed at will.
2831  * New public fields should be added right above.
2832  *****************************************************************
2833  */
2835  struct AVCodec *next;
2860 
2864  void (*init_static_data)(struct AVCodec *codec);
2865 
2867  int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
2868  const struct AVSubtitle *sub);
2879  int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
2880  int *got_packet_ptr);
2881  int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
2888 } AVCodec;
2889 
2893 typedef struct AVHWAccel {
2899  const char *name;
2900 
2907 
2914 
2921 
2927 
2928  /*****************************************************************
2929  * No fields below this line are part of the public API. They
2930  * may not be used outside of libavcodec and can be changed and
2931  * removed at will.
2932  * New public fields should be added right above.
2933  *****************************************************************
2934  */
2935  struct AVHWAccel *next;
2936 
2940  int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame);
2941 
2956  int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
2957 
2969  int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
2970 
2980  int (*end_frame)(AVCodecContext *avctx);
2981 
2990 
2998  int (*init)(AVCodecContext *avctx);
2999 
3006  int (*uninit)(AVCodecContext *avctx);
3007 
3013 } AVHWAccel;
3014 
3026 typedef struct AVPicture {
3029 } AVPicture;
3030 
3035 #define AVPALETTE_SIZE 1024
3036 #define AVPALETTE_COUNT 256
3037 
3040 
3042 
3048 
3054 };
3055 
3056 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3057 
3058 typedef struct AVSubtitleRect {
3059  int x;
3060  int y;
3061  int w;
3062  int h;
3064 
3071 
3072  char *text;
3073 
3079  char *ass;
3080  int flags;
3081 } AVSubtitleRect;
3082 
3083 typedef struct AVSubtitle {
3084  uint16_t format; /* 0 = graphics */
3085  uint32_t start_display_time; /* relative to packet pts, in ms */
3086  uint32_t end_display_time; /* relative to packet pts, in ms */
3087  unsigned num_rects;
3089  int64_t pts;
3090 } AVSubtitle;
3091 
3097 AVCodec *av_codec_next(const AVCodec *c);
3098 
3102 unsigned avcodec_version(void);
3103 
3107 const char *avcodec_configuration(void);
3108 
3112 const char *avcodec_license(void);
3113 
3122 void avcodec_register(AVCodec *codec);
3123 
3134 void avcodec_register_all(void);
3135 
3151 
3156 void avcodec_free_context(AVCodecContext **avctx);
3157 
3168 
3175 const AVClass *avcodec_get_class(void);
3176 
3188 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
3189 
3190 #if FF_API_AVFRAME_LAVC
3191 
3195 AVFrame *avcodec_alloc_frame(void);
3196 
3205 void avcodec_get_frame_defaults(AVFrame *frame);
3206 
3220 void avcodec_free_frame(AVFrame **frame);
3221 #endif
3222 
3259 int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
3260 
3270 int avcodec_close(AVCodecContext *avctx);
3271 
3277 void avsubtitle_free(AVSubtitle *sub);
3278 
3288 #if FF_API_DESTRUCT_PACKET
3289 
3294 void av_destruct_packet(AVPacket *pkt);
3295 #endif
3296 
3305 void av_init_packet(AVPacket *pkt);
3306 
3315 int av_new_packet(AVPacket *pkt, int size);
3316 
3323 void av_shrink_packet(AVPacket *pkt, int size);
3324 
3331 int av_grow_packet(AVPacket *pkt, int grow_by);
3332 
3346 int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
3347 
3352 int av_dup_packet(AVPacket *pkt);
3353 
3359 void av_free_packet(AVPacket *pkt);
3360 
3370  int size);
3371 
3381  int size);
3382 
3392  int *size);
3393 
3401 
3418 int av_packet_ref(AVPacket *dst, AVPacket *src);
3419 
3428 void av_packet_unref(AVPacket *pkt);
3429 
3438 void av_packet_move_ref(AVPacket *dst, AVPacket *src);
3439 
3452 int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
3453 
3465 void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);
3466 
3483 
3491 
3492 #if FF_API_GET_BUFFER
3496 #endif
3497 
3504 
3505 #if FF_API_EMU_EDGE
3506 
3517 unsigned avcodec_get_edge_width(void);
3518 #endif
3519 
3528 
3537  int linesize_align[AV_NUM_DATA_POINTERS]);
3538 
3587 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
3588  int *got_frame_ptr, AVPacket *avpkt);
3589 
3630 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
3631  int *got_picture_ptr,
3632  AVPacket *avpkt);
3633 
3651  int *got_sub_ptr,
3652  AVPacket *avpkt);
3653 
3661  AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field
3662  AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
3663  AV_PICTURE_STRUCTURE_FRAME, //< coded as frame
3664 };
3665 
3666 typedef struct AVCodecParserContext {
3667  void *priv_data;
3669  int64_t frame_offset; /* offset of the current frame */
3670  int64_t cur_offset; /* current offset
3671  (incremented by each av_parser_parse()) */
3672  int64_t next_frame_offset; /* offset of the next frame */
3673  /* video info */
3674  int pict_type; /* XXX: Put it back in AVCodecContext. */
3684  int repeat_pict; /* XXX: Put it back in AVCodecContext. */
3685  int64_t pts; /* pts of the current frame */
3686  int64_t dts; /* dts of the current frame */
3687 
3688  /* private data */
3689  int64_t last_pts;
3690  int64_t last_dts;
3692 
3693 #define AV_PARSER_PTS_NB 4
3698 
3699  int flags;
3700 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
3701 #define PARSER_FLAG_ONCE 0x0002
3702 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
3704 
3705  int64_t offset;
3707 
3715 
3734 
3735  // Timestamp generation support:
3746 
3761 
3775 
3782 
3786  int64_t pos;
3787 
3791  int64_t last_pos;
3792 
3799 
3801 
3811 
3820 
3821 typedef struct AVCodecParser {
3822  int codec_ids[5]; /* several codec IDs are permitted */
3826  AVCodecContext *avctx,
3827  const uint8_t **poutbuf, int *poutbuf_size,
3828  const uint8_t *buf, int buf_size);
3830  int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
3832 } AVCodecParser;
3833 
3835 
3838 
3868  AVCodecContext *avctx,
3869  uint8_t **poutbuf, int *poutbuf_size,
3870  const uint8_t *buf, int buf_size,
3871  int64_t pts, int64_t dts,
3872  int64_t pos);
3873 
3879  AVCodecContext *avctx,
3880  uint8_t **poutbuf, int *poutbuf_size,
3881  const uint8_t *buf, int buf_size, int keyframe);
3883 
3901 
3909 
3948 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
3949  const AVFrame *frame, int *got_packet_ptr);
3950 
3985 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
3986  const AVFrame *frame, int *got_packet_ptr);
3987 
3988 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
3989  const AVSubtitle *sub);
3990 
3991 
4012 int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
4013 
4021 void avpicture_free(AVPicture *picture);
4022 
4043 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
4044  enum AVPixelFormat pix_fmt, int width, int height);
4045 
4061 int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
4062  int width, int height,
4063  unsigned char *dest, int dest_size);
4064 
4078 
4079 #if FF_API_DEINTERLACE
4080 
4086 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
4087  enum AVPixelFormat pix_fmt, int width, int height);
4088 #endif
4089 
4092 void av_picture_copy(AVPicture *dst, const AVPicture *src,
4093  enum AVPixelFormat pix_fmt, int width, int height);
4094 
4098 int av_picture_crop(AVPicture *dst, const AVPicture *src,
4099  enum AVPixelFormat pix_fmt, int top_band, int left_band);
4100 
4104 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
4105  int padtop, int padbottom, int padleft, int padright, int *color);
4106 
4131 void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
4132 
4139 
4140 #define FF_LOSS_RESOLUTION 0x0001
4141 #define FF_LOSS_DEPTH 0x0002
4142 #define FF_LOSS_COLORSPACE 0x0004
4143 #define FF_LOSS_ALPHA 0x0008
4144 #define FF_LOSS_COLORQUANT 0x0010
4145 #define FF_LOSS_CHROMA 0x0020
4164 int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
4165  int has_alpha);
4166 
4185  enum AVPixelFormat src_pix_fmt,
4186  int has_alpha, int *loss_ptr);
4187 
4188 enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
4189 
4194 #if FF_API_SET_DIMENSIONS
4195 
4200 #endif
4201 
4211 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
4212 
4213 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
4214 
4222 const char *av_get_profile_name(const AVCodec *codec, int profile);
4223 
4224 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
4225 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
4226 //FIXME func typedef
4227 
4245  enum AVSampleFormat sample_fmt, const uint8_t *buf,
4246  int buf_size, int align);
4247 
4258 
4266 
4276 
4285 int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
4286 
4287 
4289  void *priv_data;
4294 
4295 
4296 typedef struct AVBitStreamFilter {
4297  const char *name;
4300  AVCodecContext *avctx, const char *args,
4301  uint8_t **poutbuf, int *poutbuf_size,
4302  const uint8_t *buf, int buf_size, int keyframe);
4306 
4310  AVCodecContext *avctx, const char *args,
4311  uint8_t **poutbuf, int *poutbuf_size,
4312  const uint8_t *buf, int buf_size, int keyframe);
4314 
4316 
4317 /* memory */
4318 
4326 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
4327 
4335 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
4336 
4337 #if FF_API_MISSING_SAMPLE
4338 
4352 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
4353 
4364 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
4365 #endif /* FF_API_MISSING_SAMPLE */
4366 
4370 void av_register_hwaccel(AVHWAccel *hwaccel);
4371 
4377 AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel);
4378 
4379 
4383 enum AVLockOp {
4388 };
4389 
4403 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
4404 
4409 
4415 
4419 int av_codec_is_encoder(const AVCodec *codec);
4420 
4424 int av_codec_is_decoder(const AVCodec *codec);
4425 
4430 
4439 
4445 
4450 #endif /* AVCODEC_AVCODEC_H */
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
callback to negotiate the pixelFormat
Definition: avcodec.h:1301
codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it ...
Definition: avcodec.h:464
const struct AVCodec * codec
Definition: avcodec.h:1059
discard all frames except keyframes
Definition: avcodec.h:567
AVSideDataParamChangeFlags
Definition: avcodec.h:1022
unsigned int stream_codec_tag
fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A')...
Definition: avcodec.h:1090
attribute_deprecated int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
Definition: avcodec.h:2524
#define AV_NUM_DATA_POINTERS
Definition: frame.h:136
AVPacketSideDataType
Definition: avcodec.h:858
int size
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
Definition: avcodec.h:3028
void av_free_packet(AVPacket *pkt)
Free a packet.
Definition: avpacket.c:243
This structure describes decoded (raw) audio or video data.
Definition: frame.h:135
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int, int), void *arg, int *ret, int count)
AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
Definition: utils.c:1761
int x
top left corner of pict, undefined when pict is not set
Definition: avcodec.h:3059
int mpeg_quant
0-> h263 quant 1-> mpeg quant
Definition: avcodec.h:1346
int dct_algo
DCT algorithm, see FF_DCT_* below.
Definition: avcodec.h:2458
A dummy id pointing at the start of audio codecs.
Definition: avcodec.h:298
attribute_deprecated 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:455
uint64_t error[AV_NUM_DATA_POINTERS]
error
Definition: avcodec.h:2451
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 e.g.
Definition: avcodec.h:1234
int capabilities
Hardware accelerated codec capabilities.
Definition: avcodec.h:2926
void(* parser_close)(AVCodecParserContext *s)
Definition: avcodec.h:3829
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:2282
float qblur
amount of qscale smoothing over time (0.0-1.0)
Definition: avcodec.h:2066
Unlock the mutex.
Definition: avcodec.h:4386
float border_masking
Border processing masking, raises the quantizer for mbs on the borders of the picture.
Definition: avcodec.h:1658
memory handling functions
int64_t pos
byte position in stream, -1 if unknown
Definition: avcodec.h:998
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
Definition: avpacket.c:101
attribute_deprecated int request_channels
Decoder should decode to this many channels if it can (0 for default)
Definition: avcodec.h:1844
int64_t next_frame_offset
Definition: avcodec.h:3672
AVFrame * coded_frame
the picture in the bitstream
Definition: avcodec.h:2532
int id
id
Definition: avcodec.h:810
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:1309
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
Definition: avcodec.h:2164
Dummy codec for streams containing only metadata information.
Definition: avcodec.h:470
int height
Definition: avcodec.h:818
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Definition: avcodec.h:919
const char * avcodec_configuration(void)
Return the libavcodec build-time configuration.
Definition: utils.c:1976
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: avcodec.h:1766
int qscale
Definition: avcodec.h:590
enum AVFieldOrder field_order
Definition: avcodec.h:3800
struct AVBitStreamFilter * next
Definition: avcodec.h:4304
int nb_colors
number of colors in pict, undefined when pict is not set
Definition: avcodec.h:3063
int size
Definition: avcodec.h:974
int mb_lmin
minimum MB lagrange multipler
Definition: avcodec.h:1665
const char * avcodec_license(void)
Return the libavcodec license.
Definition: utils.c:1981
int codec_ids[5]
Definition: avcodec.h:3822
enhanced predictive zonal search
Definition: avcodec.h:550
enum AVPixelFormat pix_fmt
Supported pixel format.
Definition: avcodec.h:2920
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:1429
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:255
void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Definition: imgconvert.c:42
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1254
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:3087
int(* split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Definition: avcodec.h:3830
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:59
enum AVMediaType type
Type of codec implemented by the hardware accelerator.
Definition: avcodec.h:2906
A dummy ID pointing at the start of various fake codecs.
Definition: avcodec.h:461
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
Definition: avcodec.h:2300
int ildct_cmp
interlaced DCT comparison function
Definition: avcodec.h:1454
attribute_deprecated void * thread_opaque
Definition: avcodec.h:2607
enum AVMediaType type
Definition: avcodec.h:2809
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:1822
int rtp_payload_size
Definition: avcodec.h:2263
int duration
Duration of the current frame.
Definition: avcodec.h:3798
discard all
Definition: avcodec.h:568
int intra_quant_bias
intra quantizer bias
Definition: avcodec.h:1546
int64_t cur_frame_pos[AV_PARSER_PTS_NB]
Position of the packet in file.
Definition: avcodec.h:3781
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of audio.
Definition: utils.c:1314
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:2514
void avcodec_register_all(void)
Register all the codecs, parsers and bitstream filters which were enabled at configuration time...
Definition: allcodecs.c:68
int dts_ref_dts_delta
Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base.
Definition: avcodec.h:3760
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)
Decode a subtitle message.
Definition: utils.c:1677
attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
Definition: utils.c:840
int av_dup_packet(AVPacket *pkt)
Definition: avpacket.c:190
four components are given, that's all.
Definition: avcodec.h:3026
int(* alloc_frame)(AVCodecContext *avctx, AVFrame *frame)
Allocate a custom buffer.
Definition: avcodec.h:2940
int profile
profile
Definition: avcodec.h:2622
int lmax
maximum Lagrange multipler
Definition: avcodec.h:2199
int frame_skip_cmp
frame skip comparison function
Definition: avcodec.h:2227
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
Definition: avcodec.h:898
AVCodec.
Definition: avcodec.h:2796
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
Definition: options.c:154
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
Definition: avcodec.h:1828
float i_quant_offset
qscale offset between P and I-frames
Definition: avcodec.h:1362
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:1288
AVLockOp
Lock operation used by lockmgr.
Definition: avcodec.h:4383
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:322
uint64_t vbv_delay
VBV delay coded in the last frame (in periods of a 27 MHz clock).
Definition: avcodec.h:2763
char * text
0 terminated plain UTF-8 text
Definition: avcodec.h:3072
attribute_deprecated 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:120
int scenechange_threshold
scene change detection threshold 0 is default, larger means fewer detected scene changes.
Definition: avcodec.h:1606
Macro definitions for various function/variable attributes.
attribute_deprecated 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:2239
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1175
int av_codec_is_decoder(const AVCodec *codec)
Definition: utils.c:100
AVSubtitleRect ** rects
Definition: avcodec.h:3088
int(* uninit)(AVCodecContext *avctx)
Uninitialize the hwaccel private data.
Definition: avcodec.h:3006
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
Definition: avcodec.h:1866
const AVCodecDescriptor * avcodec_descriptor_next(const AVCodecDescriptor *prev)
Iterate over all codec descriptors known to libavcodec.
Definition: codec_desc.c:2363
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:296
enum AVDiscard skip_frame
Definition: avcodec.h:2727
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
Definition: options.c:217
int av_codec_is_encoder(const AVCodec *codec)
Definition: utils.c:95
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:281
int w
width of pict, undefined when pict is not set
Definition: avcodec.h:3061
struct AVHWAccel * hwaccel
Hardware accelerator in use.
Definition: avcodec.h:2432
float p_masking
p block masking (0-> disabled)
Definition: avcodec.h:1390
int context_model
context model
Definition: avcodec.h:2185
AVCodecParserContext * parser
Definition: avcodec.h:4291
attribute_deprecated char codec_name[32]
Definition: avcodec.h:1065
Public dictionary API.
int bit_rate_tolerance
number of bits the bitstream is allowed to diverge from the reference.
Definition: avcodec.h:1122
int mb_lmax
maximum MB lagrange multipler
Definition: avcodec.h:1672
enum AVPictureStructure picture_structure
Indicate whether a picture is coded as a frame, top field or bottom field.
Definition: avcodec.h:3810
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
Definition: utils.c:882
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:1799
Lock the mutex.
Definition: avcodec.h:4385
uint8_t
void * hwaccel_context
Hardware accelerator context.
Definition: avcodec.h:2444
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:174
int subtitle_header_size
Definition: avcodec.h:2738
int me_range
maximum motion estimation search range in subpel units If 0 then no limit.
Definition: avcodec.h:1539
uint8_t * data[AV_NUM_DATA_POINTERS]
Definition: avcodec.h:3027
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:344
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:175
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: avcodec.h:913
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:1318
int pre_dia_size
ME prepass diamond size & shape.
Definition: avcodec.h:1503
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
Initialize a reference-counted packet from av_malloc()ed data.
Definition: avpacket.c:142
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1164
const char * name
const AVClass * av_class
information on struct for av_log
Definition: avcodec.h:1055
int me_cmp
motion estimation comparison function
Definition: avcodec.h:1436
int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of video.
Definition: utils.c:1412
struct AVCodecParser * next
Definition: avcodec.h:3831
int rc_strategy
obsolete FIXME remove
Definition: avcodec.h:1321
const char data[16]
Definition: mxf.c:70
const char * name
Definition: avcodec.h:4297
int coder_type
coder type
Definition: avcodec.h:2178
uint8_t * data
Definition: avcodec.h:973
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
Definition: avpacket.c:379
static int flags
Definition: log.c:44
int mb_threshold
Macroblock threshold below which the user specified macroblock types will be used.
Definition: avcodec.h:1629
attribute_deprecated void(* destruct)(struct AVPacket *)
Definition: avcodec.h:994
Motion_Est_ID
motion estimation type.
Definition: avcodec.h:545
uint8_t * data
Definition: avcodec.h:923
AVColorRange
MPEG vs JPEG YUV range.
Definition: pixfmt.h:362
int(* init)(AVCodecContext *avctx)
Initialize the hwaccel private data.
Definition: avcodec.h:2998
int h
height of pict, undefined when pict is not set
Definition: avcodec.h:3062
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:2507
int min_prediction_order
Definition: avcodec.h:2240
float lumi_masking
luminance masking (0-> disabled)
Definition: avcodec.h:1369
char * stats_out
pass1 encoding statistics output buffer
Definition: avcodec.h:2292
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:306
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:991
struct AVBitStreamFilterContext * next
Definition: avcodec.h:4292
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
Definition: avcodec.h:1773
float rc_qmod_amp
Definition: avcodec.h:2097
float quality_factor
Definition: avcodec.h:591
hexagon based search
Definition: avcodec.h:552
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
Definition: utils.c:1766
int chromaoffset
chroma qp offset from luma
Definition: avcodec.h:1714
const OptionDef options[]
Definition: avconv_opt.c:2187
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:186
int slice_count
slice count
Definition: avcodec.h:1404
attribute_deprecated void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
Definition: utils.c:127
Libavcodec version macros.
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:1710
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: avpacket.c:81
no search, that is use 0,0 vector whenever one is needed
Definition: avcodec.h:546
enum AVCodecID id
Definition: avcodec.h:2810
const uint64_t * channel_layouts
array of support channel layouts, or NULL if unknown. array is terminated by 0
Definition: avcodec.h:2820
reserved for experiments
Definition: avcodec.h:551
const AVCodecDefault * defaults
Private codec-specific defaults.
Definition: avcodec.h:2859
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:105
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
Definition: utils.c:2043
int has_b_frames
Size of the frame reordering buffer in the decoder.
Definition: avcodec.h:1339
int64_t pos
Byte position of currently parsed frame in stream.
Definition: avcodec.h:3786
Create a mutex.
Definition: avcodec.h:4384
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst)
Convert valid timing fields (timestamps / durations) in a packet from one timebase to another...
Definition: avpacket.c:385
int priv_data_size
Definition: avcodec.h:3823
struct AVCodecParser * parser
Definition: avcodec.h:3668
AVAudioServiceType
Definition: avcodec.h:571
int y
top left corner of pict, undefined when pict is not set
Definition: avcodec.h:3060
discard all bidirectional frames
Definition: avcodec.h:566
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: avcodec.h:877
int frame_skip_threshold
frame skip threshold
Definition: avcodec.h:2206
int me_sub_cmp
subpixel motion estimation comparison function
Definition: avcodec.h:1442
void av_packet_free_side_data(AVPacket *pkt)
Convenience function to free all the side data stored.
Definition: avpacket.c:234
int qmax
maximum quantizer
Definition: avcodec.h:2080
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:75
enum AVSampleFormat request_sample_fmt
Used to request a sample format from the decoder.
Definition: avcodec.h:1873
int active_thread_type
Which multithreading methods are in use by the codec.
Definition: avcodec.h:2559
int avcodec_is_open(AVCodecContext *s)
Definition: utils.c:2389
int error_concealment
error concealment flags
Definition: avcodec.h:2353
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:1017
int capabilities
Codec capabilities.
Definition: avcodec.h:2815
void av_bitstream_filter_close(AVBitStreamFilterContext *bsf)
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:379
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
Definition: avcodec.h:956
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1144
int rc_max_rate
maximum bitrate
Definition: avcodec.h:2127
int log_level_offset
Definition: avcodec.h:1056
enum AVPacketSideDataType type
Definition: avcodec.h:925
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
Get the type of the given codec.
Definition: utils.c:2375
const char * name
Name of the codec implementation.
Definition: avcodec.h:2803
int64_t cur_frame_dts[AV_PARSER_PTS_NB]
Definition: avcodec.h:3697
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:1355
int side_data_elems
Definition: avcodec.h:985
const char * rc_eq
rate control equation
Definition: avcodec.h:2120
int width
width and height in 1/16 pel
Definition: avcodec.h:817
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Shrink the already allocated side data buffer.
Definition: avpacket.c:302
const char * long_name
A more descriptive name for this codec.
Definition: avcodec.h:490
int(* parser_parse)(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: avcodec.h:3825
AVCodecParser * av_parser_next(const AVCodecParser *c)
Definition: parser.c:32
enum AVCodecID codec_id
Definition: mov_chan.c:432
transformed exhaustive search algorithm
Definition: avcodec.h:554
#define av_printf_format(fmtpos, attrpos)
Definition: attributes.h:117
int priv_data_size
Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data.
Definition: avcodec.h:3012
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:979
reference-counted frame API
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
Definition: codec_desc.c:2353
uint64_t channel_layout
Audio channel layout.
Definition: avcodec.h:1852
uint32_t end_display_time
Definition: avcodec.h:3086
int64_t pts
Same as packet pts, in AV_TIME_BASE.
Definition: avcodec.h:3089
int rc_buffer_size
decoder bitstream buffer size
Definition: avcodec.h:2105
int props
Codec properties, a combination of AV_CODEC_PROP_* flags.
Definition: avcodec.h:494
int intra_dc_precision
precision of the intra DC coefficient - 8
Definition: avcodec.h:1636
int me_penalty_compensation
Definition: avcodec.h:1679
AVBitStreamFilter * av_bitstream_filter_next(const AVBitStreamFilter *f)
Not part of ABI.
Definition: avcodec.h:581
int refs
number of reference frames
Definition: avcodec.h:1707
attribute_deprecated int scenechange_factor
Multiplied by qscale for each frame and added to scene_change_score.
Definition: avcodec.h:1722
A bitmap, pict will be set.
Definition: avcodec.h:3041
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
Definition: avpacket.c:318
int rc_override_count
ratecontrol override, see RcOverride
Definition: avcodec.h:2112
int bit_rate
the average bitrate
Definition: avcodec.h:1114
int64_t timecode_frame_start
GOP timecode frame start number, in non drop frame format.
Definition: avcodec.h:2253
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
Definition: avcodec.h:2817
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
Definition: avcodec.h:2406
AVPicture pict
data+linesize for the bitmap of this subtitle.
Definition: avcodec.h:3069
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:2899
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
Definition: utils.c:1998
void(* close)(AVBitStreamFilterContext *bsfc)
Definition: avcodec.h:4303
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
Definition: options.c:124
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:120
int width
picture width / height.
Definition: avcodec.h:1224
AVBitStreamFilterContext * av_bitstream_filter_init(const char *name)
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
Definition: avcodec.h:2473
int64_t offset
byte offset from starting packet start
Definition: avcodec.h:3705
int priv_data_size
Definition: avcodec.h:2834
int profile
Definition: avcodec.h:2785
float rc_max_available_vbv_use
Ratecontrol attempt to use, at maximum, of what can be used without an underflow. ...
Definition: avcodec.h:2150
float rc_min_vbv_overflow_use
Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow.
Definition: avcodec.h:2157
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:3733
void av_parser_close(AVCodecParserContext *s)
Definition: parser.c:207
int b_frame_strategy
Definition: avcodec.h:1324
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:1745
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:2095
int start_frame
Definition: avcodec.h:588
int side_data_only_packets
Encoding only.
Definition: avcodec.h:2778
uint16_t format
Definition: avcodec.h:3084
int level
level
Definition: avcodec.h:2705
attribute_deprecated void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
Definition: avcodec.h:1953
const AVProfile * profiles
array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} ...
Definition: avcodec.h:2825
attribute_deprecated int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
Definition: avcodec.h:1939
int64_t reordered_opaque
opaque 64bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
Definition: avcodec.h:2425
int refcounted_frames
If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...
Definition: avcodec.h:2062
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
Definition: avcodec.h:1184
int skip_top
Number of macroblock rows at the top which are skipped.
Definition: avcodec.h:1643
int mb_decision
macroblock decision mode
Definition: avcodec.h:1581
int last_predictor_count
amount of previous MV predictors (2a+1 x 2a+1 square)
Definition: avcodec.h:1482
int max_qdiff
maximum quantizer difference between frames
Definition: avcodec.h:2087
enum AVPixelFormat pix_fmt
Definition: movenc.c:843
int64_t cur_frame_end[AV_PARSER_PTS_NB]
Definition: avcodec.h:3706
static pthread_mutex_t * mutex
Definition: w32pthreads.h:69
int lmin
minimum Lagrange multipler
Definition: avcodec.h:2192
int64_t cur_frame_pts[AV_PARSER_PTS_NB]
Definition: avcodec.h:3696
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:110
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
Definition: codec_desc.c:2372
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:4299
RcOverride * rc_override
Definition: avcodec.h:2113
int64_t last_pos
Previous frame byte position.
Definition: avcodec.h:3791
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
Definition: avcodec.h:2540
int inter_quant_bias
inter quantizer bias
Definition: avcodec.h:1554
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal decoder state / flush internal buffers.
Definition: utils.c:1987
FAKE codec to indicate a MPEG-4 Systems stream (only used by libavformat)
Definition: avcodec.h:468
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:2853
int frame_skip_factor
frame skip factor
Definition: avcodec.h:2213
const char * av_get_profile_name(const AVCodec *codec, int profile)
Return a name for the specified profile, if available.
Definition: utils.c:1958
int frame_size
Number of samples per channel in an audio frame.
Definition: avcodec.h:1811
int pts_dts_delta
Presentation delay of current frame in units of AVCodecContext.time_base.
Definition: avcodec.h:3774
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:2600
attribute_deprecated void av_destruct_packet(AVPacket *pkt)
Default packet destructor.
Definition: avpacket.c:32
const char * long_name
Descriptive name for the codec, meant to be more human readable than name.
Definition: avcodec.h:2808
float rc_initial_cplx
initial complexity for pass1 ratecontrol
Definition: avcodec.h:2143
int bidir_refine
Definition: avcodec.h:1686
static int width
Definition: utils.c:156
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)
attribute_deprecated void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
AVCodecParserContext * av_parser_init(int codec_id)
Definition: parser.c:46
sample_fmt
Definition: avconv_filter.c:68
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
Definition: utils.c:509
void(* rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb)
Definition: avcodec.h:2261
enum AVMediaType codec_type
Definition: avcodec.h:1058
int me_threshold
Motion estimation threshold below which no motion estimation is performed, but instead the user speci...
Definition: avcodec.h:1622
const AVRational * supported_framerates
array of supported framerates, or NULL if any, array is terminated by {0,0}
Definition: avcodec.h:2816
attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic)
Definition: utils.c:845
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:61
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer...
Definition: options.c:139
int(* end_frame)(AVCodecContext *avctx)
Called at the end of each frame or field picture.
Definition: avcodec.h:2980
enum AVCodecID codec_id
Definition: avcodec.h:1067
AVHWAccel.
Definition: avcodec.h:2893
int compression_level
Definition: avcodec.h:1136
int sample_rate
samples per second
Definition: avcodec.h:1791
enum AVDiscard skip_idct
Definition: avcodec.h:2720
int frame_bits
number of bits used for the previously encoded frame
Definition: avcodec.h:2285
attribute_deprecated AVPacket * pkt
Definition: avcodec.h:2754
Plain text, the text field must be set by the decoder and is authoritative.
Definition: avcodec.h:3047
int debug
debug
Definition: avcodec.h:2362
main external API structure.
Definition: avcodec.h:1050
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
Definition: utils.c:1780
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: avpacket.c:346
int pre_me
prepass for motion estimation
Definition: avcodec.h:1489
int qmin
minimum quantizer
Definition: avcodec.h:2073
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
Definition: utils.c:1691
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
Definition: avcodec.h:1082
float spatial_cplx_masking
spatial complexity masking (0-> disabled)
Definition: avcodec.h:1383
int extradata_size
Definition: avcodec.h:1165
int(* close)(AVCodecContext *)
Definition: avcodec.h:2882
unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
Encode extradata length to a buffer.
Definition: utils.c:2216
struct AVCodec * next
Definition: avcodec.h:2835
struct AVBitStreamFilter * filter
Definition: avcodec.h:4290
uint16_t * intra_matrix
custom intra quantization matrix
Definition: avcodec.h:1591
int slice_flags
slice flags
Definition: avcodec.h:1561
int coded_height
Definition: avcodec.h:1234
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
int(* get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags)
This callback is called at the beginning of each frame to get data buffer(s) for it.
Definition: avcodec.h:2049
float rc_buffer_aggressivity
Definition: avcodec.h:2136
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:1759
rational number numerator/denominator
Definition: rational.h:43
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:1752
const char * name
short name for the profile
Definition: avcodec.h:2786
void av_register_codec_parser(AVCodecParser *parser)
Definition: parser.c:40
AVFieldOrder
Definition: avcodec.h:1034
int(* init_thread_copy)(AVCodecContext *)
If defined, called on thread contexts when they are created.
Definition: avcodec.h:2845
attribute_deprecated int debug_mv
Definition: avcodec.h:2395
AVMediaType
Definition: avutil.h:185
discard useless packets like 0 size packets in avi
Definition: avcodec.h:564
refcounted data buffer API
const char * name
Name of the codec described by this descriptor.
Definition: avcodec.h:486
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
Definition: utils.c:982
float b_quant_offset
qscale offset between IP and B-frames
Definition: avcodec.h:1331
attribute_deprecated void * priv
Definition: avcodec.h:996
int frame_skip_exp
frame skip exponent
Definition: avcodec.h:2220
attribute_deprecated int dtg_active_format
DTG active format information (additional aspect ratio information only used in DVB MPEG-2 transport ...
Definition: avcodec.h:1522
#define AV_PARSER_PTS_NB
Definition: avcodec.h:3693
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
Definition: utils.c:2061
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
Definition: avcodec.h:2065
uint16_t * inter_matrix
custom inter quantization matrix
Definition: avcodec.h:1598
int end_frame
Definition: avcodec.h:589
int(* parser_init)(AVCodecParserContext *s)
Definition: avcodec.h:3824
AVHWAccel * av_hwaccel_next(const AVHWAccel *hwaccel)
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL...
Definition: utils.c:2277
This struct describes the properties of a single codec described by an AVCodecID. ...
Definition: avcodec.h:478
float dark_masking
darkness masking (0-> disabled)
Definition: avcodec.h:1397
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:1130
int skip_bottom
Number of macroblock rows at the bottom which are skipped.
Definition: avcodec.h:1650
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
Definition: utils.c:1785
This side data should be associated with an audio stream and contains ReplayGain information in form ...
Definition: avcodec.h:904
int output_picture_number
Picture number incremented in presentation or output order.
Definition: avcodec.h:3818
float temporal_cplx_masking
temporary complexity masking (0-> disabled)
Definition: avcodec.h:1376
int(* decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
Callback for each slice.
Definition: avcodec.h:2969
Pan Scan area.
Definition: avcodec.h:804
const AVClass * priv_class
AVClass for the private context.
Definition: avcodec.h:2824
#define attribute_deprecated
Definition: attributes.h:80
int rc_qmod_freq
Definition: avcodec.h:2098
int noise_reduction
noise reduction strength
Definition: avcodec.h:1613
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:2956
int height
Definition: gxfenc.c:72
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
Definition: avcodec.h:1245
enum AVMediaType type
Definition: avcodec.h:480
A reference to a data buffer.
Definition: buffer.h:81
discard all non reference
Definition: avcodec.h:565
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:76
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
Definition: avcodec.h:984
int mb_cmp
macroblock comparison function (not supported yet)
Definition: avcodec.h:1448
attribute_deprecated int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
Definition: avcodec.h:1968
int(* decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt)
Definition: avcodec.h:2881
Free mutex resources.
Definition: avcodec.h:4387
rational numbers
attribute_deprecated void void av_register_hwaccel(AVHWAccel *hwaccel)
Register the hardware accelerator hwaccel.
Definition: utils.c:2268
raw UTF-8 text
Definition: avcodec.h:452
struct AVHWAccel * next
Definition: avcodec.h:2935
int nsse_weight
noise vs.
Definition: avcodec.h:2615
void(* flush)(AVCodecContext *)
Flush buffers.
Definition: avcodec.h:2887
int(* init)(AVCodecContext *)
Definition: avcodec.h:2866
uint32_t start_display_time
Definition: avcodec.h:3085
int(* encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
Definition: avcodec.h:2867
int prediction_method
prediction method (needed for huffyuv)
Definition: avcodec.h:1410
AVProfile.
Definition: avcodec.h:2784
int workaround_bugs
Work around bugs in encoders which sometimes cannot be detected automatically.
Definition: avcodec.h:2307
enum AVCodecID id
Codec implemented by the hardware accelerator.
Definition: avcodec.h:2913
int64_t cur_frame_offset[AV_PARSER_PTS_NB]
Definition: avcodec.h:3695
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
Definition: avpacket.c:109
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
Definition: avpacket.c:47
enum AVDiscard skip_loop_filter
Definition: avcodec.h:2713
int thread_safe_callbacks
Set by the client if its custom get_buffer() callback can be called synchronously from another thread...
Definition: avcodec.h:2569
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:55
AVPictureStructure
Definition: avcodec.h:3659
int trellis
trellis RD quantization
Definition: avcodec.h:2234
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
Definition: utils.c:1842
int av_packet_ref(AVPacket *dst, AVPacket *src)
Setup a new reference to the data described by a given packet.
Definition: avpacket.c:355
int slices
Number of slices.
Definition: avcodec.h:1782
int16_t position[3][2]
position of the top left corner in 1/16 pel for up to 3 fields/frames
Definition: avcodec.h:825
void * priv_data
Definition: avcodec.h:1092
int cutoff
Audio cutoff bandwidth (0 means "automatic")
Definition: avcodec.h:1835
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
Definition: avcodec.h:466
Formatted text, the ass field must be set by the decoder and is authoritative.
Definition: avcodec.h:3053
int64_t frame_offset
Definition: avcodec.h:3669
enum AVCodecID id
Definition: avcodec.h:479
pixel format definitions
int dia_size
ME diamond size & shape.
Definition: avcodec.h:1475
int b_sensitivity
Adjust sensitivity of b_frame_strategy 1.
Definition: avcodec.h:1738
int(* encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode data to an AVPacket.
Definition: avcodec.h:2879
uneven multi-hexagon search
Definition: avcodec.h:553
as in Berlin toast format
Definition: avcodec.h:396
int channels
number of audio channels
Definition: avcodec.h:1792
int frame_priv_data_size
Size of per-frame hardware accelerator private data.
Definition: avcodec.h:2989
const int * supported_samplerates
array of supported audio samplerates, or NULL if unknown, array is terminated by 0 ...
Definition: avcodec.h:2818
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:278
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:1971
char * ass
0 terminated ASS/SSA compatible event line.
Definition: avcodec.h:3079
attribute_deprecated int error_rate
Definition: avcodec.h:2746
int mv0_threshold
Note: Value depends upon the compare function used for fullpel ME.
Definition: avcodec.h:1731
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:1574
int flags2
CODEC_FLAG2_*.
Definition: avcodec.h:1151
AVDiscard
Definition: avcodec.h:560
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:128
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:972
void avcodec_register(AVCodec *codec)
Register the codec codec and initialize libavcodec.
Definition: utils.c:105
int * slice_offset
slice offsets in the frame in bytes
Definition: avcodec.h:1420
int frame_number
Frame counter, set by libavcodec.
Definition: avcodec.h:1822
int repeat_pict
This field is used for proper frame duration computation in lavf.
Definition: avcodec.h:3684
int max_prediction_order
Definition: avcodec.h:2246
enum AVFieldOrder field_order
Field order.
Definition: avcodec.h:1788
void(* init_static_data)(struct AVCodec *codec)
Initialize codec static data, called from avcodec_register().
Definition: avcodec.h:2864
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:376
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
Definition: avpacket.c:287
enum AVSampleFormat * sample_fmts
array of supported sample formats, or NULL if unknown, array is terminated by -1
Definition: avcodec.h:2819
attribute_deprecated uint8_t max_lowres
maximum value for lowres supported by the decoder
Definition: avcodec.h:2822
int nb_channels
int me_method
Motion estimation algorithm used for video coding.
Definition: avcodec.h:1263
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
Definition: avpacket.c:262
int stream_index
Definition: avcodec.h:975
int rc_min_rate
minimum bitrate
Definition: avcodec.h:2134
enum AVSubtitleType type
Definition: avcodec.h:3070
uint64_t request_channel_layout
Request decoder to use this channel layout if it can (0 for default)
Definition: avcodec.h:1859
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:2580
int me_pre_cmp
motion estimation prepass comparison function
Definition: avcodec.h:1496
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63
This structure stores compressed data.
Definition: avcodec.h:950
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)
Definition: utils.c:1457
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
Definition: avcodec.h:3714
int delay
Codec delay.
Definition: avcodec.h:1212
int me_subpel_quality
subpel ME quality
Definition: avcodec.h:1510
int strict_std_compliance
strictly follow the standard (MPEG4, ...).
Definition: avcodec.h:2341
int dts_sync_point
Synchronization point for start of timestamp generation.
Definition: avcodec.h:3745
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:966
A dummy ID pointing at the start of subtitle codecs.
Definition: avcodec.h:449
void * opaque
Private data of the user, can be used to carry app specific stuff.
Definition: avcodec.h:1107
int thread_type
Which multithreading methods to use.
Definition: avcodec.h:2550
AVSubtitleType
Definition: avcodec.h:3038
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
Definition: utils.c:852
discard nothing
Definition: avcodec.h:563
uint8_t * subtitle_header
Header containing style information for text subtitles.
Definition: avcodec.h:2737
int keyint_min
minimum GOP size
Definition: avcodec.h:1700
attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)
Definition: utils.c:534
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:1630