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/hwcontext.h"
39 #include "libavutil/log.h"
40 #include "libavutil/pixfmt.h"
41 #include "libavutil/rational.h"
42 
43 #include "version.h"
44 
211 enum AVCodecID {
213 
214  /* video codecs */
414 
415  /* various PCM "codecs" */
448 
449  /* various ADPCM codecs */
481 
482  /* AMR */
485 
486  /* RealAudio codecs*/
489 
490  /* various DPCM codecs */
495 
496  /* audio codecs */
497  AV_CODEC_ID_MP2 = 0x15000,
527  AV_CODEC_ID_GSM_MS, /* as found in WAV */
564 
565  /* subtitle codecs */
576 
577  /* other specific kind of codecs (generally used for attachments) */
579  AV_CODEC_ID_TTF = 0x18000,
580 
581  AV_CODEC_ID_PROBE = 0x19000,
582 
589 };
590 
596 typedef struct AVCodecDescriptor {
597  enum AVCodecID id;
604  const char *name;
608  const char *long_name;
612  int props;
617  const struct AVProfile *profiles;
619 
624 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
625 
630 #define AV_CODEC_PROP_LOSSY (1 << 1)
631 
634 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
635 
644 #define AV_CODEC_PROP_REORDER (1 << 3)
645 
654 #define AV_INPUT_BUFFER_PADDING_SIZE 8
655 
661 #define AV_INPUT_BUFFER_MIN_SIZE 16384
662 
667  /* We leave some space between them for extensions (drop some
668  * keyframes for intra-only or drop just some bidir frames). */
675 };
676 
688 };
689 
693 typedef struct RcOverride{
696  int qscale; // If this is 0 then quality_factor will be used instead.
698 } RcOverride;
699 
700 /* encoding support
701  These flags can be passed in AVCodecContext.flags before initialization.
702  Note: Not everything is supported yet.
703 */
704 
709 #define AV_CODEC_FLAG_UNALIGNED (1 << 0)
710 
713 #define AV_CODEC_FLAG_QSCALE (1 << 1)
714 
717 #define AV_CODEC_FLAG_4MV (1 << 2)
718 
721 #define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3)
722 
725 #define AV_CODEC_FLAG_QPEL (1 << 4)
726 
729 #define AV_CODEC_FLAG_PASS1 (1 << 9)
730 
733 #define AV_CODEC_FLAG_PASS2 (1 << 10)
734 
737 #define AV_CODEC_FLAG_LOOP_FILTER (1 << 11)
738 
741 #define AV_CODEC_FLAG_GRAY (1 << 13)
742 
745 #define AV_CODEC_FLAG_PSNR (1 << 15)
746 
750 #define AV_CODEC_FLAG_TRUNCATED (1 << 16)
751 
754 #define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18)
755 
758 #define AV_CODEC_FLAG_LOW_DELAY (1 << 19)
759 
762 #define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
763 
766 #define AV_CODEC_FLAG_BITEXACT (1 << 23)
767 /* Fx : Flag for H.263+ extra options */
771 #define AV_CODEC_FLAG_AC_PRED (1 << 24)
772 
775 #define AV_CODEC_FLAG_INTERLACED_ME (1 << 29)
776 #define AV_CODEC_FLAG_CLOSED_GOP (1 << 31)
777 
781 #define AV_CODEC_FLAG2_FAST (1 << 0)
782 
785 #define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2)
786 
789 #define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3)
790 
794 #define AV_CODEC_FLAG2_CHUNKS (1 << 15)
795 
798 #define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16)
799 
800 /* Unsupported options :
801  * Syntax Arithmetic coding (SAC)
802  * Reference Picture Selection
803  * Independent Segment Decoding */
804 /* /Fx */
805 /* codec capabilities */
806 
810 #define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
811 
816 #define AV_CODEC_CAP_DR1 (1 << 1)
817 #define AV_CODEC_CAP_TRUNCATED (1 << 3)
818 
841 #define AV_CODEC_CAP_DELAY (1 << 5)
842 
846 #define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
847 
858 #define AV_CODEC_CAP_SUBFRAMES (1 << 8)
859 
863 #define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
864 
867 #define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
868 
871 #define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
872 
875 #define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
876 
879 #define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
880 
883 #define AV_CODEC_CAP_AUTO_THREADS (1 << 15)
884 
887 #define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
888 
893 #define AV_CODEC_CAP_HARDWARE (1 << 17)
894 
900 #define AV_CODEC_CAP_HYBRID (1 << 18)
901 
907 #define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 19)
908 
914 typedef struct AVPanScan{
920  int id;
921 
927  int width;
928  int height;
929 
935  int16_t position[3][2];
936 }AVPanScan;
937 
943 typedef struct AVCPBProperties {
959 
965 
973  uint64_t vbv_delay;
975 
979 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
980 
994 
1003 
1020 
1041 
1047 
1056 
1062 
1068 
1075 
1083 
1088 
1094 };
1095 
1096 typedef struct AVPacketSideData {
1097  uint8_t *data;
1098  int size;
1101 
1130 typedef struct AVPacket {
1146  int64_t pts;
1152  int64_t dts;
1153  uint8_t *data;
1154  int size;
1159  int flags;
1166 
1171  int64_t duration;
1172 
1173  int64_t pos;
1174 
1175 #if FF_API_CONVERGENCE_DURATION
1176 
1183 #endif
1184 } AVPacket;
1185 #define AV_PKT_FLAG_KEY 0x0001
1186 #define AV_PKT_FLAG_CORRUPT 0x0002
1187 
1193 };
1198 struct AVCodecInternal;
1199 
1203  AV_FIELD_TT, //< Top coded_first, top displayed first
1204  AV_FIELD_BB, //< Bottom coded first, bottom displayed first
1205  AV_FIELD_TB, //< Top coded first, bottom displayed first
1206  AV_FIELD_BT, //< Bottom coded first, top displayed first
1207 };
1208 
1216 typedef struct AVCodecContext {
1223 
1224  enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
1225  const struct AVCodec *codec;
1226  enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
1227 
1241  unsigned int codec_tag;
1242 
1243  void *priv_data;
1244 
1251  struct AVCodecInternal *internal;
1252 
1258  void *opaque;
1259 
1266 
1274 
1282 
1288 #define FF_COMPRESSION_DEFAULT -1
1289 
1295  int flags;
1296 
1302  int flags2;
1303 
1315  uint8_t *extradata;
1317 
1328 
1337 
1355  int delay;
1356 
1357 
1358  /* video only */
1372  int width, height;
1373 
1387  int coded_width, coded_height;
1388 
1395 
1409  enum AVPixelFormat pix_fmt;
1410 
1434  void (*draw_horiz_band)(struct AVCodecContext *s,
1435  const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
1436  int y, int type, int height);
1437 
1451  enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
1452 
1460 
1469 
1470 #if FF_API_PRIVATE_OPT
1471 
1474 #endif
1475 
1482 
1490 
1491 #if FF_API_PRIVATE_OPT
1492 
1495 #endif
1496 
1505 
1512 
1519 
1526 
1533 
1539  float p_masking;
1540 
1547 
1554 
1555 #if FF_API_PRIVATE_OPT
1556 
1559 #define FF_PRED_LEFT 0
1560 #define FF_PRED_PLANE 1
1561 #define FF_PRED_MEDIAN 2
1562 #endif
1563 
1570 
1579 
1585  int me_cmp;
1597  int mb_cmp;
1604 #define FF_CMP_SAD 0
1605 #define FF_CMP_SSE 1
1606 #define FF_CMP_SATD 2
1607 #define FF_CMP_DCT 3
1608 #define FF_CMP_PSNR 4
1609 #define FF_CMP_BIT 5
1610 #define FF_CMP_RD 6
1611 #define FF_CMP_ZERO 7
1612 #define FF_CMP_VSAD 8
1613 #define FF_CMP_VSSE 9
1614 #define FF_CMP_NSSE 10
1615 #define FF_CMP_DCTMAX 13
1616 #define FF_CMP_DCT264 14
1617 #define FF_CMP_CHROMA 256
1618 
1625 
1632 
1633 #if FF_API_PRIVATE_OPT
1634 
1636  int pre_me;
1637 #endif
1638 
1645 
1652 
1659 
1668 
1675 #define SLICE_FLAG_CODED_ORDER 0x0001
1676 #define SLICE_FLAG_ALLOW_FIELD 0x0002
1677 #define SLICE_FLAG_ALLOW_PLANE 0x0004
1678 
1679 
1685 #define FF_MB_DECISION_SIMPLE 0
1686 #define FF_MB_DECISION_BITS 1
1687 #define FF_MB_DECISION_RD 2
1688 
1689 
1694  uint16_t *intra_matrix;
1695 
1701  uint16_t *inter_matrix;
1702 
1703 #if FF_API_PRIVATE_OPT
1704 
1707 
1711 #endif
1712 
1719 
1726 
1733 
1739  int mb_lmin;
1740 
1746  int mb_lmax;
1747 
1748 #if FF_API_PRIVATE_OPT
1749 
1754 #endif
1755 
1761 
1762 #if FF_API_PRIVATE_OPT
1763 
1766 #endif
1767 
1774 
1780  int refs;
1781 
1782 #if FF_API_PRIVATE_OPT
1783 
1786 #endif
1787 
1794 
1795 #if FF_API_PRIVATE_OPT
1796 
1799 #endif
1800 
1807 
1814 
1821 
1828 
1835 
1843  int slices;
1844 
1850 
1851  /* audio only */
1853  int channels;
1854 
1861 
1862  /* The following data should not be initialized. */
1873 
1884 
1890 
1896  int cutoff;
1897 
1903  uint64_t channel_layout;
1904 
1911 
1918 
1925 
2004  int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
2005 
2020 
2021  /* - encoding parameters */
2022  float qcompress;
2023  float qblur;
2024 
2030  int qmin;
2031 
2037  int qmax;
2038 
2045 
2052 
2060 
2067 
2074 
2081 
2088 
2095 
2096 #if FF_API_CODER_TYPE
2097 #define FF_CODER_TYPE_VLC 0
2098 #define FF_CODER_TYPE_AC 1
2099 #define FF_CODER_TYPE_RAW 2
2100 #define FF_CODER_TYPE_RLE 3
2101 
2106 #endif /* FF_API_CODER_TYPE */
2107 
2108 #if FF_API_PRIVATE_OPT
2109 
2112 #endif
2113 
2114 #if FF_API_PRIVATE_OPT
2115 
2118 
2122 
2126 
2130 #endif /* FF_API_PRIVATE_OPT */
2131 
2137  int trellis;
2138 
2139 #if FF_API_PRIVATE_OPT
2140 
2143 
2147 
2151 #endif
2152 
2153 #if FF_API_RTP_CALLBACK
2154 
2157  /* The RTP callback: This function is called */
2158  /* every time the encoder has a packet to send. */
2159  /* It depends on the encoder if the data starts */
2160  /* with a Start Code (it should). H.263 does. */
2161  /* mb_nb contains the number of macroblocks */
2162  /* encoded in the RTP payload. */
2164  void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
2165 #endif
2166 
2167 #if FF_API_PRIVATE_OPT
2168 
2170  int rtp_payload_size; /* The size of the RTP payload: the coder will */
2171  /* do its best to deliver a chunk with size */
2172  /* below rtp_payload_size, the chunk will start */
2173  /* with a start code on some codecs like H.263. */
2174  /* This doesn't take account of any particular */
2175  /* headers inside the transmitted RTP payload. */
2176 #endif
2177 
2178 #if FF_API_STAT_BITS
2179  /* statistics, used for 2-pass encoding */
2181  int mv_bits;
2189  int i_count;
2191  int p_count;
2196 
2200 #endif
2201 
2207  char *stats_out;
2208 
2215  char *stats_in;
2216 
2223 #define FF_BUG_AUTODETECT 1
2224 #define FF_BUG_XVID_ILACE 4
2225 #define FF_BUG_UMP4 8
2226 #define FF_BUG_NO_PADDING 16
2227 #define FF_BUG_AMV 32
2228 #define FF_BUG_QPEL_CHROMA 64
2229 #define FF_BUG_STD_QPEL 128
2230 #define FF_BUG_QPEL_CHROMA2 256
2231 #define FF_BUG_DIRECT_BLOCKSIZE 512
2232 #define FF_BUG_EDGE 1024
2233 #define FF_BUG_HPEL_CHROMA 2048
2234 #define FF_BUG_DC_CLIP 4096
2235 #define FF_BUG_MS 8192
2236 #define FF_BUG_TRUNCATED 16384
2237 
2251 #define FF_COMPLIANCE_VERY_STRICT 2
2252 #define FF_COMPLIANCE_STRICT 1
2253 #define FF_COMPLIANCE_NORMAL 0
2254 #define FF_COMPLIANCE_UNOFFICIAL -1
2255 #define FF_COMPLIANCE_EXPERIMENTAL -2
2256 
2257 
2263 #define FF_EC_GUESS_MVS 1
2264 #define FF_EC_DEBLOCK 2
2265 
2271  int debug;
2272 #define FF_DEBUG_PICT_INFO 1
2273 #define FF_DEBUG_RC 2
2274 #define FF_DEBUG_BITSTREAM 4
2275 #define FF_DEBUG_MB_TYPE 8
2276 #define FF_DEBUG_QP 16
2277 #define FF_DEBUG_DCT_COEFF 0x00000040
2278 #define FF_DEBUG_SKIP 0x00000080
2279 #define FF_DEBUG_STARTCODE 0x00000100
2280 #define FF_DEBUG_ER 0x00000400
2281 #define FF_DEBUG_MMCO 0x00000800
2282 #define FF_DEBUG_BUGS 0x00001000
2283 #define FF_DEBUG_BUFFERS 0x00008000
2284 #define FF_DEBUG_THREADS 0x00010000
2285 
2292 
2299 #define AV_EF_CRCCHECK (1<<0)
2300 #define AV_EF_BITSTREAM (1<<1)
2301 #define AV_EF_BUFFER (1<<2)
2302 #define AV_EF_EXPLODE (1<<3)
2303 
2314 
2320  const struct AVHWAccel *hwaccel;
2321 
2333 
2339  uint64_t error[AV_NUM_DATA_POINTERS];
2340 
2347 #define FF_DCT_AUTO 0
2348 #define FF_DCT_FASTINT 1
2349 #define FF_DCT_INT 2
2350 #define FF_DCT_MMX 3
2351 #define FF_DCT_ALTIVEC 5
2352 #define FF_DCT_FAAN 6
2353 
2360 #define FF_IDCT_AUTO 0
2361 #define FF_IDCT_INT 1
2362 #define FF_IDCT_SIMPLE 2
2363 #define FF_IDCT_SIMPLEMMX 3
2364 #define FF_IDCT_ARM 7
2365 #define FF_IDCT_ALTIVEC 8
2366 #define FF_IDCT_SIMPLEARM 10
2367 #define FF_IDCT_XVID 14
2368 #define FF_IDCT_SIMPLEARMV5TE 16
2369 #define FF_IDCT_SIMPLEARMV6 17
2370 #define FF_IDCT_FAAN 20
2371 #define FF_IDCT_SIMPLENEON 22
2372 
2379 
2386 
2387 #if FF_API_CODED_FRAME
2388 
2396 #endif
2397 
2405 
2415 #define FF_THREAD_FRAME 1
2416 #define FF_THREAD_SLICE 2
2417 
2418 
2424 
2434 
2444  int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
2445 
2464  int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
2465 
2472 
2478  int profile;
2479 #define FF_PROFILE_UNKNOWN -99
2480 #define FF_PROFILE_RESERVED -100
2481 
2482 #define FF_PROFILE_AAC_MAIN 0
2483 #define FF_PROFILE_AAC_LOW 1
2484 #define FF_PROFILE_AAC_SSR 2
2485 #define FF_PROFILE_AAC_LTP 3
2486 #define FF_PROFILE_AAC_HE 4
2487 #define FF_PROFILE_AAC_HE_V2 28
2488 #define FF_PROFILE_AAC_LD 22
2489 #define FF_PROFILE_AAC_ELD 38
2490 #define FF_PROFILE_MPEG2_AAC_LOW 128
2491 #define FF_PROFILE_MPEG2_AAC_HE 131
2492 
2493 #define FF_PROFILE_DTS 20
2494 #define FF_PROFILE_DTS_ES 30
2495 #define FF_PROFILE_DTS_96_24 40
2496 #define FF_PROFILE_DTS_HD_HRA 50
2497 #define FF_PROFILE_DTS_HD_MA 60
2498 #define FF_PROFILE_DTS_EXPRESS 70
2499 
2500 #define FF_PROFILE_MPEG2_422 0
2501 #define FF_PROFILE_MPEG2_HIGH 1
2502 #define FF_PROFILE_MPEG2_SS 2
2503 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
2504 #define FF_PROFILE_MPEG2_MAIN 4
2505 #define FF_PROFILE_MPEG2_SIMPLE 5
2506 
2507 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
2508 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
2509 
2510 #define FF_PROFILE_H264_BASELINE 66
2511 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2512 #define FF_PROFILE_H264_MAIN 77
2513 #define FF_PROFILE_H264_EXTENDED 88
2514 #define FF_PROFILE_H264_HIGH 100
2515 #define FF_PROFILE_H264_HIGH_10 110
2516 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
2517 #define FF_PROFILE_H264_MULTIVIEW_HIGH 118
2518 #define FF_PROFILE_H264_HIGH_422 122
2519 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
2520 #define FF_PROFILE_H264_STEREO_HIGH 128
2521 #define FF_PROFILE_H264_HIGH_444 144
2522 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
2523 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
2524 #define FF_PROFILE_H264_CAVLC_444 44
2525 
2526 #define FF_PROFILE_VC1_SIMPLE 0
2527 #define FF_PROFILE_VC1_MAIN 1
2528 #define FF_PROFILE_VC1_COMPLEX 2
2529 #define FF_PROFILE_VC1_ADVANCED 3
2530 
2531 #define FF_PROFILE_MPEG4_SIMPLE 0
2532 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
2533 #define FF_PROFILE_MPEG4_CORE 2
2534 #define FF_PROFILE_MPEG4_MAIN 3
2535 #define FF_PROFILE_MPEG4_N_BIT 4
2536 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
2537 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
2538 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
2539 #define FF_PROFILE_MPEG4_HYBRID 8
2540 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
2541 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
2542 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
2543 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
2544 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
2545 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
2546 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
2547 
2548 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
2549 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
2550 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
2551 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
2552 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
2553 
2554 #define FF_PROFILE_VP9_0 0
2555 #define FF_PROFILE_VP9_1 1
2556 #define FF_PROFILE_VP9_2 2
2557 #define FF_PROFILE_VP9_3 3
2558 
2559 #define FF_PROFILE_HEVC_MAIN 1
2560 #define FF_PROFILE_HEVC_MAIN_10 2
2561 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
2562 #define FF_PROFILE_HEVC_REXT 4
2563 
2564 #define FF_PROFILE_AV1_MAIN 0
2565 #define FF_PROFILE_AV1_HIGH 1
2566 #define FF_PROFILE_AV1_PROFESSIONAL 2
2567 
2573  int level;
2574 #define FF_LEVEL_UNKNOWN -99
2575 
2581 
2587 
2593 
2604 
2605 #if FF_API_VBV_DELAY
2606 
2615  uint64_t vbv_delay;
2616 #endif
2617 
2618 #if FF_API_SIDEDATA_ONLY_PKT
2619 
2631 #endif
2632 
2649 
2650  /*
2651  * - decoding: For codecs that store a framerate value in the compressed
2652  * bitstream, the decoder may export it here. { 0, 1} when
2653  * unknown.
2654  * - encoding: May be used to signal the framerate of CFR content to an
2655  * encoder.
2656  */
2658 
2665 
2674 
2698 
2725 
2747 
2756 
2770 } AVCodecContext;
2771 
2775 typedef struct AVProfile {
2776  int profile;
2777  const char *name;
2778 } AVProfile;
2779 
2780 enum {
2814 };
2815 
2816 typedef struct AVCodecHWConfig {
2820  enum AVPixelFormat pix_fmt;
2825  int methods;
2832  enum AVHWDeviceType device_type;
2833 } AVCodecHWConfig;
2834 
2836 
2837 struct AVSubtitle;
2838 
2842 typedef struct AVCodec {
2849  const char *name;
2854  const char *long_name;
2863  const enum AVPixelFormat *pix_fmts;
2866  const uint64_t *channel_layouts;
2869 
2880  const char *wrapper_name;
2881 
2882  /*****************************************************************
2883  * No fields below this line are part of the public API. They
2884  * may not be used outside of libavcodec and can be changed and
2885  * removed at will.
2886  * New public fields should be added right above.
2887  *****************************************************************
2888  */
2890  struct AVCodec *next;
2915 
2919  void (*init_static_data)(struct AVCodec *codec);
2920 
2922  int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
2923  const struct AVSubtitle *sub);
2934  int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
2935  int *got_packet_ptr);
2936  int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
2937  int (*close)(AVCodecContext *);
2946  int (*send_frame)(AVCodecContext *avctx, const AVFrame *frame);
2947  int (*receive_packet)(AVCodecContext *avctx, AVPacket *avpkt);
2948 
2954  int (*receive_frame)(AVCodecContext *avctx, AVFrame *frame);
2959  void (*flush)(AVCodecContext *);
2965 
2970  const char *bsfs;
2971 
2979  const struct AVCodecHWConfigInternal **hw_configs;
2980 } AVCodec;
2981 
2989 const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index);
2990 
2999 typedef struct AVHWAccel {
3005  const char *name;
3006 
3013 
3020 
3026  enum AVPixelFormat pix_fmt;
3027 
3033 
3034  /*****************************************************************
3035  * No fields below this line are part of the public API. They
3036  * may not be used outside of libavcodec and can be changed and
3037  * removed at will.
3038  * New public fields should be added right above.
3039  *****************************************************************
3040  */
3041  struct AVHWAccel *next;
3042 
3046  int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame);
3047 
3062  int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3063 
3075  int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
3076 
3086  int (*end_frame)(AVCodecContext *avctx);
3087 
3096 
3104  int (*init)(AVCodecContext *avctx);
3105 
3112  int (*uninit)(AVCodecContext *avctx);
3113 
3119 
3124 
3133  int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx);
3134 } AVHWAccel;
3135 
3141 #define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0)
3142 
3147 #define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1)
3148 
3161 #define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2)
3162 
3167 #if FF_API_AVPICTURE
3168 
3180 typedef struct AVPicture {
3182  uint8_t *data[AV_NUM_DATA_POINTERS];
3184  int linesize[AV_NUM_DATA_POINTERS];
3185 } AVPicture;
3186 
3190 #endif
3191 
3192 #define AVPALETTE_SIZE 1024
3193 #define AVPALETTE_COUNT 256
3194 
3197 
3199 
3205 
3211 };
3212 
3213 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3214 
3215 typedef struct AVSubtitleRect {
3216  int x;
3217  int y;
3218  int w;
3219  int h;
3221 
3222 #if FF_API_AVPICTURE
3223 
3228 #endif
3229 
3233  uint8_t *data[4];
3234  int linesize[4];
3235 
3237 
3238  char *text;
3239 
3245  char *ass;
3246  int flags;
3247 } AVSubtitleRect;
3248 
3249 typedef struct AVSubtitle {
3250  uint16_t format; /* 0 = graphics */
3251  uint32_t start_display_time; /* relative to packet pts, in ms */
3252  uint32_t end_display_time; /* relative to packet pts, in ms */
3253  unsigned num_rects;
3255  int64_t pts;
3256 } AVSubtitle;
3257 
3265 typedef struct AVCodecParameters {
3269  enum AVMediaType codec_type;
3273  enum AVCodecID codec_id;
3277  uint32_t codec_tag;
3278 
3287  uint8_t *extradata;
3292 
3297  int format;
3298 
3303 
3305 
3309  int profile;
3310  int level;
3311 
3315  int width;
3316  int height;
3317 
3326 
3330  enum AVFieldOrder field_order;
3331 
3335  enum AVColorRange color_range;
3336  enum AVColorPrimaries color_primaries;
3338  enum AVColorSpace color_space;
3339  enum AVChromaLocation chroma_location;
3340 
3346  uint64_t channel_layout;
3362 
3378 
3384 AVCodec *av_codec_next(const AVCodec *c);
3385 
3389 unsigned avcodec_version(void);
3390 
3394 const char *avcodec_configuration(void);
3395 
3399 const char *avcodec_license(void);
3400 
3409 void avcodec_register(AVCodec *codec);
3410 
3421 void avcodec_register_all(void);
3422 
3437 
3442 void avcodec_free_context(AVCodecContext **avctx);
3443 
3444 #if FF_API_GET_CONTEXT_DEFAULTS
3445 
3451 #endif
3452 
3459 const AVClass *avcodec_get_class(void);
3460 
3461 #if FF_API_COPY_CONTEXT
3462 
3480 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
3481 #endif
3482 
3489 
3495 
3503 
3512  const AVCodecContext *codec);
3513 
3523  const AVCodecParameters *par);
3524 
3563 int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
3564 
3578 int avcodec_close(AVCodecContext *avctx);
3579 
3585 void avsubtitle_free(AVSubtitle *sub);
3586 
3607 AVPacket *av_packet_alloc(void);
3608 
3619 AVPacket *av_packet_clone(const AVPacket *src);
3620 
3628 void av_packet_free(AVPacket **pkt);
3629 
3638 void av_init_packet(AVPacket *pkt);
3639 
3648 int av_new_packet(AVPacket *pkt, int size);
3649 
3656 void av_shrink_packet(AVPacket *pkt, int size);
3657 
3664 int av_grow_packet(AVPacket *pkt, int grow_by);
3665 
3679 int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
3680 
3681 #if FF_API_AVPACKET_OLD_API
3682 
3689 int av_dup_packet(AVPacket *pkt);
3698 void av_free_packet(AVPacket *pkt);
3699 #endif
3700 
3709  int size);
3710 
3725  uint8_t *data, size_t size);
3726 
3736  int size);
3737 
3747  int *size);
3748 
3756 
3773 int av_packet_ref(AVPacket *dst, const AVPacket *src);
3774 
3783 void av_packet_unref(AVPacket *pkt);
3784 
3793 void av_packet_move_ref(AVPacket *dst, AVPacket *src);
3794 
3806 int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
3807 
3819 void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);
3820 
3837 
3845 
3851 int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
3852 
3860 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
3861 
3869 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
3870  int linesize_align[AV_NUM_DATA_POINTERS]);
3871 
3926 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
3927  int *got_frame_ptr, AVPacket *avpkt);
3928 
3975 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
3976  int *got_picture_ptr,
3977  AVPacket *avpkt);
3978 
3999  int *got_sub_ptr,
4000  AVPacket *avpkt);
4001 
4052 int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);
4053 
4072 int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame);
4073 
4109 int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame);
4110 
4126 int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt);
4127 
4226  AVBufferRef *device_ref,
4227  enum AVPixelFormat hw_pix_fmt,
4228  AVBufferRef **out_frames_ref);
4229 
4230 
4231 
4239  AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field
4240  AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
4241  AV_PICTURE_STRUCTURE_FRAME, //< coded as frame
4242 };
4243 
4244 typedef struct AVCodecParserContext {
4245  void *priv_data;
4247  int64_t frame_offset; /* offset of the current frame */
4248  int64_t cur_offset; /* current offset
4249  (incremented by each av_parser_parse()) */
4250  int64_t next_frame_offset; /* offset of the next frame */
4251  /* video info */
4252  int pict_type; /* XXX: Put it back in AVCodecContext. */
4262  int repeat_pict; /* XXX: Put it back in AVCodecContext. */
4263  int64_t pts; /* pts of the current frame */
4264  int64_t dts; /* dts of the current frame */
4265 
4266  /* private data */
4267  int64_t last_pts;
4268  int64_t last_dts;
4270 
4271 #define AV_PARSER_PTS_NB 4
4273  int64_t cur_frame_offset[AV_PARSER_PTS_NB];
4274  int64_t cur_frame_pts[AV_PARSER_PTS_NB];
4275  int64_t cur_frame_dts[AV_PARSER_PTS_NB];
4276 
4277  int flags;
4278 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
4279 #define PARSER_FLAG_ONCE 0x0002
4280 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
4282 
4283  int64_t offset;
4284  int64_t cur_frame_end[AV_PARSER_PTS_NB];
4285 
4293 
4294 #if FF_API_CONVERGENCE_DURATION
4295 
4300 #endif
4301 
4302  // Timestamp generation support:
4313 
4328 
4342 
4348  int64_t cur_frame_pos[AV_PARSER_PTS_NB];
4349 
4353  int64_t pos;
4354 
4358  int64_t last_pos;
4359 
4366 
4367  enum AVFieldOrder field_order;
4368 
4377  enum AVPictureStructure picture_structure;
4378 
4386 
4390  int width;
4391  int height;
4392 
4398 
4407  int format;
4409 
4410 typedef struct AVCodecParser {
4411  int codec_ids[5]; /* several codec IDs are permitted */
4413  int (*parser_init)(AVCodecParserContext *s);
4414  /* This callback never returns an error, a negative value means that
4415  * the frame start was in a previous packet. */
4416  int (*parser_parse)(AVCodecParserContext *s,
4417  AVCodecContext *avctx,
4418  const uint8_t **poutbuf, int *poutbuf_size,
4419  const uint8_t *buf, int buf_size);
4420  void (*parser_close)(AVCodecParserContext *s);
4421  int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
4423 } AVCodecParser;
4424 
4426 
4428 AVCodecParserContext *av_parser_init(int codec_id);
4429 
4459  AVCodecContext *avctx,
4460  uint8_t **poutbuf, int *poutbuf_size,
4461  const uint8_t *buf, int buf_size,
4462  int64_t pts, int64_t dts,
4463  int64_t pos);
4464 
4470  AVCodecContext *avctx,
4471  uint8_t **poutbuf, int *poutbuf_size,
4472  const uint8_t *buf, int buf_size, int keyframe);
4474 
4492 
4500 
4541 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
4542  const AVFrame *frame, int *got_packet_ptr);
4543 
4580 int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
4581  const AVFrame *frame, int *got_packet_ptr);
4582 
4583 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
4584  const AVSubtitle *sub);
4585 
4586 
4591 #if FF_API_AVPICTURE
4592 
4601 int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
4602 
4607 void avpicture_free(AVPicture *picture);
4608 
4613 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
4614  enum AVPixelFormat pix_fmt, int width, int height);
4615 
4620 int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
4621  int width, int height,
4622  unsigned char *dest, int dest_size);
4623 
4628 int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
4629 
4634 void av_picture_copy(AVPicture *dst, const AVPicture *src,
4635  enum AVPixelFormat pix_fmt, int width, int height);
4636 
4641 int av_picture_crop(AVPicture *dst, const AVPicture *src,
4642  enum AVPixelFormat pix_fmt, int top_band, int left_band);
4643 
4648 int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
4649  int padtop, int padbottom, int padleft, int padright, int *color);
4650 
4654 #endif
4655 
4677 unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
4678 
4679 #define FF_LOSS_RESOLUTION 0x0001
4680 #define FF_LOSS_DEPTH 0x0002
4681 #define FF_LOSS_COLORSPACE 0x0004
4682 #define FF_LOSS_ALPHA 0x0008
4683 #define FF_LOSS_COLORQUANT 0x0010
4684 #define FF_LOSS_CHROMA 0x0020
4703 int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
4704  int has_alpha);
4705 
4724  enum AVPixelFormat src_pix_fmt,
4725  int has_alpha, int *loss_ptr);
4726 
4727 enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
4728 
4742 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
4743 
4744 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
4745 
4753 const char *av_get_profile_name(const AVCodec *codec, int profile);
4754 
4766 const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
4767 
4768 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
4769 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
4770 //FIXME func typedef
4771 
4788 int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
4789  enum AVSampleFormat sample_fmt, const uint8_t *buf,
4790  int buf_size, int align);
4791 
4802 
4809 int av_get_bits_per_sample(enum AVCodecID codec_id);
4810 
4819 int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
4820 
4829 int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
4830 
4835 int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
4836 
4837 #if FF_API_OLD_BSF
4839  void *priv_data;
4844 #endif
4845 
4847 
4858 typedef struct AVBSFContext {
4863 
4867  const struct AVBitStreamFilter *filter;
4868 
4873  AVBSFInternal *internal;
4874 
4879  void *priv_data;
4880 
4887 
4893 
4899 
4905 } AVBSFContext;
4906 
4907 typedef struct AVBitStreamFilter {
4908  const char *name;
4909 
4915  const enum AVCodecID *codec_ids;
4916 
4927 
4928  /*****************************************************************
4929  * No fields below this line are part of the public API. They
4930  * may not be used outside of libavcodec and can be changed and
4931  * removed at will.
4932  * New public fields should be added right above.
4933  *****************************************************************
4934  */
4935 
4937  int (*init)(AVBSFContext *ctx);
4938  int (*filter)(AVBSFContext *ctx, AVPacket *pkt);
4939  void (*close)(AVBSFContext *ctx);
4940  void (*flush)(AVBSFContext *ctx);
4942 
4943 #if FF_API_OLD_BSF
4944 
4954  AVCodecContext *avctx, const char *args,
4955  uint8_t **poutbuf, int *poutbuf_size,
4956  const uint8_t *buf, int buf_size, int keyframe);
4961 #endif
4962 
4967 const AVBitStreamFilter *av_bsf_get_by_name(const char *name);
4968 
4978 const AVBitStreamFilter *av_bsf_next(void **opaque);
4979 
4992 int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx);
4993 
4998 int av_bsf_init(AVBSFContext *ctx);
4999 
5015 int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);
5016 
5042 
5046 void av_bsf_flush(AVBSFContext *ctx);
5047 
5052 void av_bsf_free(AVBSFContext **ctx);
5053 
5060 const AVClass *av_bsf_get_class(void);
5061 
5062 /* memory */
5063 
5070 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
5071 
5079 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
5080 
5081 #if FF_API_USER_VISIBLE_AVHWACCEL
5082 
5088 void av_register_hwaccel(AVHWAccel *hwaccel);
5089 
5099 AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel);
5100 #endif
5101 
5102 
5106 enum AVLockOp {
5111 };
5112 
5136 int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
5137 
5141 enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
5142 
5148 
5152 int av_codec_is_encoder(const AVCodec *codec);
5153 
5157 int av_codec_is_decoder(const AVCodec *codec);
5158 
5163 
5172 
5178 
5189 
5194 #endif /* AVCODEC_AVCODEC_H */
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
callback to negotiate the pixelFormat
Definition: avcodec.h:1451
codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it ...
Definition: avcodec.h:581
int caps_internal
Internal hwaccel capabilities.
Definition: avcodec.h:3123
void av_bsf_free(AVBSFContext **ctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
const struct AVCodec * codec
Definition: avcodec.h:1225
AVRational framerate
Definition: avcodec.h:2657
discard all frames except keyframes
Definition: avcodec.h:673
AVSideDataParamChangeFlags
Definition: avcodec.h:1188
const AVClass * priv_class
A class for the private data, used to declare bitstream filter private AVOptions. ...
Definition: avcodec.h:4926
AVCodecParameters * par_out
Parameters of the output stream.
Definition: avcodec.h:4892
#define AV_NUM_DATA_POINTERS
Definition: frame.h:148
AVPacketSideDataType
Definition: avcodec.h:987
This structure describes decoded (raw) audio or video data.
Definition: frame.h:147
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.
int x
top left corner of pict, undefined when pict is not set
Definition: avcodec.h:3216
int dct_algo
DCT algorithm, see FF_DCT_* below.
Definition: avcodec.h:2346
A dummy id pointing at the start of audio codecs.
Definition: avcodec.h:416
int apply_cropping
Video decoding only.
Definition: avcodec.h:2724
const struct AVCodecHWConfigInternal ** hw_configs
Array of pointers to hardware configurations supported by the codec, or NULL if no hardware supported...
Definition: avcodec.h:2979
int coded_width
Bitstream width / height, may be different from width/height e.g.
Definition: avcodec.h:1387
int capabilities
Hardware accelerated codec capabilities.
Definition: avcodec.h:3032
int av_lockmgr_register(int(*cb)(void **mutex, enum AVLockOp op))
Register a user provided lock manager supporting the operations specified by AVLockOp.
float qblur
amount of qscale smoothing over time (0.0-1.0)
Definition: avcodec.h:2023
Unlock the mutex.
Definition: avcodec.h:5109
int64_t pos
byte position in stream, -1 if unknown
Definition: avcodec.h:1173
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
int64_t next_frame_offset
Definition: avcodec.h:4250
int id
id
Definition: avcodec.h:920
int max_bitrate
Maximum bitrate of the stream, in bits per second.
Definition: avcodec.h:948
attribute_deprecated 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.
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:1459
AVRational sample_aspect_ratio
Video only.
Definition: avcodec.h:3325
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
Definition: avcodec.h:2094
Dummy codec for streams containing only metadata information.
Definition: avcodec.h:587
int height
Definition: avcodec.h:928
int width
Dimensions of the decoded video intended for presentation.
Definition: avcodec.h:4390
int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
Read encoded data from the encoder.
attribute_deprecated int frame_skip_cmp
Definition: avcodec.h:2129
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Definition: avcodec.h:1061
const char * avcodec_configuration(void)
Return the libavcodec build-time configuration.
attribute_deprecated 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)
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: avcodec.h:1827
const struct AVBitStreamFilter * filter
The bitstream filter this context is an instance of.
Definition: avcodec.h:4867
int qscale
Definition: avcodec.h:696
attribute_deprecated int av_picture_crop(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int top_band, int left_band)
The bitstream filter state.
Definition: avcodec.h:4858
int nb_colors
number of colors in pict, undefined when pict is not set
Definition: avcodec.h:3220
int size
Definition: avcodec.h:1154
int mb_lmin
minimum MB Lagrange multiplier
Definition: avcodec.h:1739
const char * avcodec_license(void)
Return the libavcodec license.
const AVBitStreamFilter * av_bsf_get_by_name(const char *name)
int coded_width
Dimensions of the coded video.
Definition: avcodec.h:4396
This side data contains an integer value representing the stream index of a "fallback" track...
Definition: avcodec.h:1082
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:1578
attribute_deprecated int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of audio.
external API header
unsigned num_rects
Definition: avcodec.h:3253
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.
A dummy ID pointing at the start of various fake codecs.
Definition: avcodec.h:578
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
Definition: avcodec.h:2215
int ildct_cmp
interlaced DCT comparison function
Definition: avcodec.h:1603
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.
int duration
Duration of the current frame.
Definition: avcodec.h:4365
discard all
Definition: avcodec.h:674
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:2385
void avcodec_register_all(void)
Register all the codecs, parsers and bitstream filters which were enabled at configuration time...
int dts_ref_dts_delta
Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base.
Definition: avcodec.h:4327
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)
Decode a subtitle message.
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
Definition: avcodec.h:2320
int trailing_padding
Audio only.
Definition: avcodec.h:3376
void * priv_data
Opaque filter-specific private data.
Definition: avcodec.h:4879
four components are given, that&#39;s all.
Definition: avcodec.h:3180
int(* alloc_frame)(AVCodecContext *avctx, AVFrame *frame)
Allocate a custom buffer.
Definition: avcodec.h:3046
int profile
profile
Definition: avcodec.h:2478
The codec supports this format via the hw_frames_ctx interface.
Definition: avcodec.h:2797
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
Definition: avcodec.h:1040
AVCodec.
Definition: avcodec.h:2842
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
Definition: avcodec.h:1889
attribute_deprecated 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)
float i_quant_offset
qscale offset between P and I-frames
Definition: avcodec.h:1511
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:41
This struct describes the properties of an encoded stream.
Definition: avcodec.h:3265
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
AVLockOp
Lock operation used by lockmgr.
Definition: avcodec.h:5106
attribute_deprecated AVPicture pict
Definition: avcodec.h:3227
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:348
int min_bitrate
Minimum bitrate of the stream, in bits per second.
Definition: avcodec.h:953
char * text
0 terminated plain UTF-8 text
Definition: avcodec.h:3238
attribute_deprecated int frame_skip_exp
Definition: avcodec.h:2125
attribute_deprecated int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height)
Macro definitions for various function/variable attributes.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1327
int av_codec_is_decoder(const AVCodec *codec)
AVSubtitleRect ** rects
Definition: avcodec.h:3254
int(* uninit)(AVCodecContext *avctx)
Uninitialize the hwaccel private data.
Definition: avcodec.h:3112
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
Definition: avcodec.h:1917
const AVCodecDescriptor * avcodec_descriptor_next(const AVCodecDescriptor *prev)
Iterate over all codec descriptors known to libavcodec.
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.
enum AVDiscard skip_frame
Definition: avcodec.h:2592
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
int av_codec_is_encoder(const AVCodec *codec)
uint64_t vbv_delay
The delay between the time the packet this structure is associated with is received and the time when...
Definition: avcodec.h:973
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx)
Allocate a context for a given bitstream filter.
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...
int w
width of pict, undefined when pict is not set
Definition: avcodec.h:3218
attribute_deprecated int mv_bits
Definition: avcodec.h:2181
float p_masking
p block masking (0-> disabled)
Definition: avcodec.h:1539
AVCodecParserContext * parser
Definition: avcodec.h:4841
Public dictionary API.
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
attribute_deprecated int side_data_only_packets
Encoding only and set by default.
Definition: avcodec.h:2630
int bit_rate_tolerance
number of bits the bitstream is allowed to diverge from the reference.
Definition: avcodec.h:1273
int mb_lmax
maximum MB Lagrange multiplier
Definition: avcodec.h:1746
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:1860
Lock the mutex.
Definition: avcodec.h:5108
void * hwaccel_context
Hardware accelerator context.
Definition: avcodec.h:2332
int width
Video only.
Definition: avcodec.h:3315
int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
int subtitle_header_size
Definition: avcodec.h:2603
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
int me_range
maximum motion estimation search range in subpel units If 0 then no limit.
Definition: avcodec.h:1667
attribute_deprecated int i_count
Definition: avcodec.h:2189
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:377
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.
struct AVCodecDefault AVCodecDefault
Definition: avcodec.h:2835
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:1171
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: avcodec.h:1055
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:1468
int pre_dia_size
ME prepass diamond size & shape.
Definition: avcodec.h:1651
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
Initialize a reference-counted packet from av_malloc()ed data.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1315
const AVClass * av_class
information on struct for av_log
Definition: avcodec.h:1221
int me_cmp
motion estimation comparison function
Definition: avcodec.h:1585
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
struct AVCodecParser * next
Definition: avcodec.h:4422
int initial_padding
Audio only.
Definition: avcodec.h:3369
const char * name
Definition: avcodec.h:4908
uint8_t * data
Definition: avcodec.h:1153
attribute_deprecated int context_model
Definition: avcodec.h:2111
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
uint8_t * data
Definition: avcodec.h:1097
AVColorRange
MPEG vs JPEG YUV range.
Definition: pixfmt.h:400
int(* init)(AVCodecContext *avctx)
Initialize the hwaccel private data.
Definition: avcodec.h:3104
int buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
Definition: avcodec.h:964
int h
height of pict, undefined when pict is not set
Definition: avcodec.h:3219
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
Definition: avcodec.h:2378
float lumi_masking
luminance masking (0-> disabled)
Definition: avcodec.h:1518
char * stats_out
pass1 encoding statistics output buffer
Definition: avcodec.h:2207
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:324
AVCPBProperties * av_cpb_properties_alloc(size_t *size)
Allocate a CPB properties structure and initialize its fields to default values.
struct AVBitStreamFilterContext * next
Definition: avcodec.h:4842
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
Definition: avcodec.h:1834
attribute_deprecated int frame_skip_threshold
Definition: avcodec.h:2117
uint64_t channel_layout
Audio only.
Definition: avcodec.h:3346
float quality_factor
Definition: avcodec.h:697
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
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...
attribute_deprecated int skip_count
Definition: avcodec.h:2193
attribute_deprecated void av_register_hwaccel(AVHWAccel *hwaccel)
Register the hardware accelerator hwaccel.
int slice_count
slice count
Definition: avcodec.h:1553
Libavcodec version macros.
The codec supports this format by some internal method.
Definition: avcodec.h:2804
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
const uint64_t * channel_layouts
array of support channel layouts, or NULL if unknown. array is terminated by 0
Definition: avcodec.h:2866
const AVCodecDefault * defaults
Private codec-specific defaults.
Definition: avcodec.h:2914
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:211
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
int has_b_frames
Size of the frame reordering buffer in the decoder.
Definition: avcodec.h:1489
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette...
Definition: avcodec.h:993
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
const AVBitStreamFilter * av_bsf_next(void **opaque)
Iterate over all registered bitstream filters.
int64_t pos
Byte position of currently parsed frame in stream.
Definition: avcodec.h:4353
Create a mutex.
Definition: avcodec.h:5107
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...
int priv_data_size
Definition: avcodec.h:4412
struct AVCodecParser * parser
Definition: avcodec.h:4246
AVAudioServiceType
Definition: avcodec.h:677
int y
top left corner of pict, undefined when pict is not set
Definition: avcodec.h:3217
discard all bidirectional frames
Definition: avcodec.h:672
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: avcodec.h:1019
enum AVCodecID * codec_ids
A list of codec ids supported by the filter, terminated by AV_CODEC_ID_NONE.
Definition: avcodec.h:4915
int me_sub_cmp
subpixel motion estimation comparison function
Definition: avcodec.h:1591
void av_packet_free_side_data(AVPacket *pkt)
Convenience function to free all the side data stored.
attribute_deprecated uint64_t vbv_delay
VBV delay coded in the last frame (in periods of a 27 MHz clock).
Definition: avcodec.h:2615
int qmax
maximum quantizer
Definition: avcodec.h:2037
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...
enum AVSampleFormat request_sample_fmt
Used to request a sample format from the decoder.
Definition: avcodec.h:1924
int active_thread_type
Which multithreading methods are in use by the codec.
Definition: avcodec.h:2423
int methods
Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible setup methods which can be used...
Definition: avcodec.h:2825
attribute_deprecated int av_dup_packet(AVPacket *pkt)
int avcodec_is_open(AVCodecContext *s)
int error_concealment
error concealment flags
Definition: avcodec.h:2262
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder.
int capabilities
Codec capabilities.
Definition: avcodec.h:2861
int initial_padding
Audio only.
Definition: avcodec.h:2648
struct AVDictionary AVDictionary
Definition: dict.h:77
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:498
attribute_deprecated AVBitStreamFilterContext * av_bitstream_filter_init(const char *name)
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
Definition: avcodec.h:1136
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:1295
AVRational time_base_in
The timebase used for the timestamps of the input packets.
Definition: avcodec.h:4898
int rc_max_rate
maximum bitrate
Definition: avcodec.h:2066
int log_level_offset
Definition: avcodec.h:1222
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
Get the type of the given codec.
const char * name
Name of the codec implementation.
Definition: avcodec.h:2849
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
Definition: avcodec.h:1504
int side_data_elems
Definition: avcodec.h:1165
int width
width and height in 1/16 pel
Definition: avcodec.h:927
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Shrink the already allocated side data buffer.
const struct AVProfile * profiles
If non-NULL, an array of profiles recognized for this codec.
Definition: avcodec.h:617
const char * long_name
A more descriptive name for this codec.
Definition: avcodec.h:608
AVCodecParser * av_parser_next(const AVCodecParser *c)
void avcodec_parameters_free(AVCodecParameters **par)
Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied p...
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
attribute_deprecated int64_t timecode_frame_start
Definition: avcodec.h:2150
attribute_deprecated int b_sensitivity
Definition: avcodec.h:1798
int priv_data_size
Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data.
Definition: avcodec.h:3118
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:1159
reference-counted frame API
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
uint64_t channel_layout
Audio channel layout.
Definition: avcodec.h:1903
int extradata_size
Size of the extradata content in bytes.
Definition: avcodec.h:3291
uint32_t end_display_time
Definition: avcodec.h:3252
int64_t pts
Same as packet pts, in AV_TIME_BASE.
Definition: avcodec.h:3255
int rc_buffer_size
decoder bitstream buffer size
Definition: avcodec.h:2051
int props
Codec properties, a combination of AV_CODEC_PROP_* flags.
Definition: avcodec.h:612
int intra_dc_precision
precision of the intra DC coefficient - 8
Definition: avcodec.h:1718
int bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: avcodec.h:3302
Not part of ABI.
Definition: avcodec.h:687
int refs
number of reference frames
Definition: avcodec.h:1780
int block_align
Audio only.
Definition: avcodec.h:3361
A bitmap, pict will be set.
Definition: avcodec.h:3198
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
int rc_override_count
ratecontrol override, see RcOverride
Definition: avcodec.h:2058
int bit_rate
the average bitrate
Definition: avcodec.h:1265
const AVClass * av_bsf_get_class(void)
Get the AVClass for AVBSFContext.
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
Definition: avcodec.h:2863
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
Definition: avcodec.h:2291
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:3005
AVPacketSideData * coded_side_data
Additional data associated with the entire coded stream.
Definition: avcodec.h:2672
attribute_deprecated int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size)
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
attribute_deprecated int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
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.
int width
picture width / height.
Definition: avcodec.h:1372
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
Definition: avcodec.h:2359
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames...
Definition: avcodec.h:2697
int64_t offset
byte offset from starting packet start
Definition: avcodec.h:4283
attribute_deprecated void av_bitstream_filter_close(AVBitStreamFilterContext *bsf)
AVRational time_base_out
The timebase used for the timestamps of the output packets.
Definition: avcodec.h:4904
int priv_data_size
Definition: avcodec.h:2889
int profile
Definition: avcodec.h:2776
attribute_deprecated int noise_reduction
Definition: avcodec.h:1710
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
Definition: avcodec.h:1093
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
float rc_max_available_vbv_use
Ratecontrol attempt to use, at maximum, of what can be used without an underflow. ...
Definition: avcodec.h:2080
float rc_min_vbv_overflow_use
Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow.
Definition: avcodec.h:2087
void av_parser_close(AVCodecParserContext *s)
attribute_deprecated int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:1806
int start_frame
Definition: avcodec.h:694
attribute_deprecated int frame_skip_factor
Definition: avcodec.h:2121
uint16_t format
Definition: avcodec.h:3250
int level
level
Definition: avcodec.h:2573
const AVClass * av_class
A class for logging and AVOptions.
Definition: avcodec.h:4862
const AVProfile * profiles
array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} ...
Definition: avcodec.h:2868
struct AVBSFInternal AVBSFInternal
Definition: avcodec.h:4846
int64_t reordered_opaque
opaque 64-bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
Definition: avcodec.h:2313
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
Definition: avcodec.h:1336
const char * bsfs
Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding...
Definition: avcodec.h:2970
int skip_top
Number of macroblock rows at the top which are skipped.
Definition: avcodec.h:1725
int mb_decision
macroblock decision mode
Definition: avcodec.h:1684
int last_predictor_count
amount of previous MV predictors (2a+1 x 2a+1 square)
Definition: avcodec.h:1631
int max_qdiff
maximum quantizer difference between frames
Definition: avcodec.h:2044
Passthrough codec, AVFrames wrapped in AVPacket.
Definition: avcodec.h:588
attribute_deprecated int coder_type
Definition: avcodec.h:2105
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:216
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
RcOverride * rc_override
Definition: avcodec.h:2059
int64_t last_pos
Previous frame byte position.
Definition: avcodec.h:4358
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
Definition: avcodec.h:2404
attribute_deprecated int max_prediction_order
Definition: avcodec.h:2146
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal decoder state / flush internal buffers.
FAKE codec to indicate a MPEG-4 Systems stream (only used by libavformat)
Definition: avcodec.h:585
attribute_deprecated int i_tex_bits
Definition: avcodec.h:2185
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
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:2908
const char * av_get_profile_name(const AVCodec *codec, int profile)
Return a name for the specified profile, if available.
int frame_size
Number of samples per channel in an audio frame.
Definition: avcodec.h:1872
int pts_dts_delta
Presentation delay of current frame in units of AVCodecContext.time_base.
Definition: avcodec.h:4341
attribute_deprecated int misc_bits
Definition: avcodec.h:2195
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:2464
const char * long_name
Descriptive name for the codec, meant to be more human readable than name.
Definition: avcodec.h:2854
This structure describes the bitrate properties of an encoded bitstream.
Definition: avcodec.h:943
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Definition: avcodec.h:1002
int bidir_refine
Definition: avcodec.h:1760
attribute_deprecated AVHWAccel * av_hwaccel_next(const AVHWAccel *hwaccel)
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL...
AVCodecParserContext * av_parser_init(int codec_id)
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
const char * wrapper_name
Group name of the codec implementation.
Definition: avcodec.h:2880
attribute_deprecated int mpeg_quant
Definition: avcodec.h:1494
const AVRational * supported_framerates
array of supported framerates, or NULL if any, array is terminated by {0,0}
Definition: avcodec.h:2862
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:60
attribute_deprecated int scenechange_threshold
Definition: avcodec.h:1706
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer...
int(* end_frame)(AVCodecContext *avctx)
Called at the end of each frame or field picture.
Definition: avcodec.h:3086
int compression_level
Definition: avcodec.h:1287
attribute_deprecated int prediction_method
Definition: avcodec.h:1558
int sample_rate
samples per second
Definition: avcodec.h:1852
enum AVDiscard skip_idct
Definition: avcodec.h:2586
attribute_deprecated int b_frame_strategy
Definition: avcodec.h:1473
Plain text, the text field must be set by the decoder and is authoritative.
Definition: avcodec.h:3204
int debug
debug
Definition: avcodec.h:2271
const AVCodecHWConfig * avcodec_get_hw_config(const AVCodec *codec, int index)
Retrieve supported hardware configurations for a codec.
main external API structure.
Definition: avcodec.h:1216
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int qmin
minimum quantizer
Definition: avcodec.h:2030
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> (&#39;D&#39;<<24) + (&#39;C&#39;<<16) + (&#39;B&#39;<<8) + &#39;A&#39;).
Definition: avcodec.h:1241
static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, FILE *output)
Definition: encode_audio.c:92
int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
Supply a raw video or audio frame to the encoder.
float spatial_cplx_masking
spatial complexity masking (0-> disabled)
Definition: avcodec.h:1532
attribute_deprecated int header_bits
Definition: avcodec.h:2183
int extradata_size
Definition: avcodec.h:1316
unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
Encode extradata length to a buffer.
struct AVCodec * next
Definition: avcodec.h:2890
struct AVBitStreamFilter * filter
Definition: avcodec.h:4840
uint16_t * intra_matrix
custom intra quantization matrix
Definition: avcodec.h:1694
int nb_coded_side_data
Definition: avcodec.h:2673
int slice_flags
slice flags
Definition: avcodec.h:1674
Describe the class of an AVClass context structure.
Definition: log.h:34
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:2004
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:1820
rational number numerator/denominator
Definition: rational.h:43
attribute_deprecated int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of video.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:1813
const char * name
short name for the profile
Definition: avcodec.h:2777
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
void av_register_codec_parser(AVCodecParser *parser)
AVFieldOrder
Definition: avcodec.h:1200
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as a packet side data.
int(* init_thread_copy)(AVCodecContext *)
If defined, called on thread contexts when they are created.
Definition: avcodec.h:2900
AVMediaType
Definition: avutil.h:198
discard useless packets like 0 size packets in avi
Definition: avcodec.h:670
refcounted data buffer API
attribute_deprecated int brd_scale
Definition: avcodec.h:1765
const char * name
Name of the codec described by this descriptor.
Definition: avcodec.h:604
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
attribute_deprecated int chromaoffset
Definition: avcodec.h:1785
float b_quant_offset
qscale offset between IP and B-frames
Definition: avcodec.h:1481
int(* frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Fill the given hw_frames context with current codec parameters.
Definition: avcodec.h:3133
#define AV_PARSER_PTS_NB
Definition: avcodec.h:4271
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
Definition: avcodec.h:2022
attribute_deprecated int refcounted_frames
If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...
Definition: avcodec.h:2019
attribute_deprecated int p_tex_bits
Definition: avcodec.h:2187
uint16_t * inter_matrix
custom inter quantization matrix
Definition: avcodec.h:1701
int end_frame
Definition: avcodec.h:695
attribute_deprecated int64_t convergence_duration
Definition: avcodec.h:4299
This struct describes the properties of a single codec described by an AVCodecID. ...
Definition: avcodec.h:596
The codec supports this format by some ad-hoc method.
Definition: avcodec.h:2813
This side data contains an integer value representing the quality factor of the compressed frame...
Definition: avcodec.h:1074
float dark_masking
darkness masking (0-> disabled)
Definition: avcodec.h:1546
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:1281
static int64_t pts
int skip_bottom
Number of macroblock rows at the bottom which are skipped.
Definition: avcodec.h:1732
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
This side data should be associated with an audio stream and contains ReplayGain information in form ...
Definition: avcodec.h:1046
int output_picture_number
Picture number incremented in presentation or output order.
Definition: avcodec.h:4385
float temporal_cplx_masking
temporary complexity masking (0-> disabled)
Definition: avcodec.h:1525
int(* decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size)
Callback for each slice.
Definition: avcodec.h:3075
Pan Scan area.
Definition: avcodec.h:914
const AVClass * priv_class
AVClass for the private context.
Definition: avcodec.h:2867
#define attribute_deprecated
Definition: attributes.h:80
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:3062
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
Definition: avcodec.h:1394
int sample_rate
Audio only.
Definition: avcodec.h:3354
enum AVMediaType type
Definition: avcodec.h:598
A reference to a data buffer.
Definition: buffer.h:81
discard all non reference
Definition: avcodec.h:671
int extra_hw_frames
Video decoding only.
Definition: avcodec.h:2769
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
Definition: avcodec.h:1164
attribute_deprecated int64_t convergence_duration
Definition: avcodec.h:1182
int mb_cmp
macroblock comparison function (not supported yet)
Definition: avcodec.h:1597
int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, AVBufferRef *device_ref, enum AVPixelFormat hw_pix_fmt, AVBufferRef **out_frames_ref)
Create and return a AVHWFramesContext with values adequate for hardware decoding. ...
Free mutex resources.
Definition: avcodec.h:5110
rational numbers
attribute_deprecated void avpicture_free(AVPicture *picture)
raw UTF-8 text
Definition: avcodec.h:569
struct AVHWAccel * next
Definition: avcodec.h:3041
attribute_deprecated int rtp_payload_size
Definition: avcodec.h:2170
int nsse_weight
noise vs.
Definition: avcodec.h:2471
int(* init)(AVCodecContext *)
Definition: avcodec.h:2921
int profile
Codec-specific bitstream restrictions that the stream conforms to.
Definition: avcodec.h:3309
uint32_t start_display_time
Definition: avcodec.h:3251
int(* encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
Definition: avcodec.h:2922
AVProfile.
Definition: avcodec.h:2775
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
Definition: avcodec.h:2395
int workaround_bugs
Work around bugs in encoders which sometimes cannot be detected automatically.
Definition: avcodec.h:2222
attribute_deprecated AVBitStreamFilter * av_bitstream_filter_next(const AVBitStreamFilter *f)
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
int caps_internal
Internal codec capabilities.
Definition: avcodec.h:2964
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
enum AVDiscard skip_loop_filter
Definition: avcodec.h:2580
int thread_safe_callbacks
Set by the client if its custom get_buffer() callback can be called synchronously from another thread...
Definition: avcodec.h:2433
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
AVPictureStructure
Definition: avcodec.h:4237
attribute_deprecated void av_picture_copy(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height)
int trellis
trellis RD quantization
Definition: avcodec.h:2137
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
int slices
Number of slices.
Definition: avcodec.h:1843
void * priv_data
Definition: avcodec.h:1243
int cutoff
Audio cutoff bandwidth (0 means "automatic")
Definition: avcodec.h:1896
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
Definition: avcodec.h:583
Formatted text, the ass field must be set by the decoder and is authoritative.
Definition: avcodec.h:3210
int64_t frame_offset
Definition: avcodec.h:4247
enum AVCodecID id
Definition: avcodec.h:597
The codec supports this format via the hw_device_ctx interface.
Definition: avcodec.h:2788
pixel format definitions
AVHWDeviceType
Definition: hwcontext.h:27
int dia_size
ME diamond size & shape.
Definition: avcodec.h:1624
attribute_deprecated int frame_bits
Definition: avcodec.h:2199
attribute_deprecated int me_penalty_compensation
Definition: avcodec.h:1753
attribute_deprecated int min_prediction_order
Definition: avcodec.h:2142
as in Berlin toast format
Definition: avcodec.h:515
int avg_bitrate
Average bitrate of the stream, in bits per second.
Definition: avcodec.h:958
int channels
number of audio channels
Definition: avcodec.h:1853
int frame_priv_data_size
Size of per-frame hardware accelerator private data.
Definition: avcodec.h:3095
const int * supported_samplerates
array of supported audio samplerates, or NULL if unknown, array is terminated by 0 ...
Definition: avcodec.h:2864
int format
The format of the coded data, corresponds to enum AVPixelFormat for video and for enum AVSampleFormat...
Definition: avcodec.h:4407
unsigned avcodec_version(void)
Return the LIBAVCODEC_VERSION_INT constant.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
char * ass
0 terminated ASS/SSA compatible event line.
Definition: avcodec.h:3245
This side data corresponds to the AVCPBProperties struct.
Definition: avcodec.h:1087
attribute_deprecated int p_count
Definition: avcodec.h:2191
attribute_deprecated void(* rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb)
Definition: avcodec.h:2164
int mv0_threshold
Note: Value depends upon the compare function used for fullpel ME.
Definition: avcodec.h:1793
int flags2
AV_CODEC_FLAG2_*.
Definition: avcodec.h:1302
int bits_per_coded_sample
Definition: avcodec.h:3304
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: avcodec.h:3287
AVDiscard
Definition: avcodec.h:666
attribute_deprecated void av_register_bitstream_filter(AVBitStreamFilter *bsf)
int channels
Audio only.
Definition: avcodec.h:3350
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.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:1152
void avcodec_register(AVCodec *codec)
Register the codec codec and initialize libavcodec.
int * slice_offset
slice offsets in the frame in bytes
Definition: avcodec.h:1569
int frame_number
Frame counter, set by libavcodec.
Definition: avcodec.h:1883
attribute_deprecated void av_free_packet(AVPacket *pkt)
Free a packet.
int repeat_pict
This field is used for proper frame duration computation in lavf.
Definition: avcodec.h:4262
void av_bsf_flush(AVBSFContext *ctx)
Reset the internal bitstream filter state / flush internal buffers.
enum AVFieldOrder field_order
Field order.
Definition: avcodec.h:1849
void(* init_static_data)(struct AVCodec *codec)
Initialize codec static data, called from avcodec_register().
Definition: avcodec.h:2919
AVChromaLocation
Location of chroma samples.
Definition: pixfmt.h:414
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
int hwaccel_flags
Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated decoding (if active)...
Definition: avcodec.h:2755
enum AVSampleFormat * sample_fmts
array of supported sample formats, or NULL if unknown, array is terminated by -1
Definition: avcodec.h:2865
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: avcodec.h:3277
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
int stream_index
Definition: avcodec.h:1155
int rc_min_rate
minimum bitrate
Definition: avcodec.h:2073
attribute_deprecated 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.
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
Definition: avcodec.h:2746
uint64_t request_channel_layout
Request decoder to use this channel layout if it can (0 for default)
Definition: avcodec.h:1910
int me_pre_cmp
motion estimation prepass comparison function
Definition: avcodec.h:1644
AVPixelFormat
Pixel format.
Definition: pixfmt.h:57
This structure stores compressed data.
Definition: avcodec.h:1130
const char * avcodec_profile_name(enum AVCodecID codec_id, int profile)
Return a name for the specified profile, if available.
AVCodecParameters * par_in
Parameters of the input stream.
Definition: avcodec.h:4886
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
Definition: avcodec.h:4292
int delay
Codec delay.
Definition: avcodec.h:1355
int me_subpel_quality
subpel ME quality
Definition: avcodec.h:1658
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
Definition: avcodec.h:2250
int dts_sync_point
Synchronization point for start of timestamp generation.
Definition: avcodec.h:4312
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:1146
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:2664
A dummy ID pointing at the start of subtitle codecs.
Definition: avcodec.h:566
void * opaque
Private data of the user, can be used to carry app specific stuff.
Definition: avcodec.h:1258
int thread_type
Which multithreading methods to use.
Definition: avcodec.h:2414
AVSubtitleType
Definition: avcodec.h:3195
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
discard nothing
Definition: avcodec.h:669
attribute_deprecated int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height)
attribute_deprecated int pre_me
Definition: avcodec.h:1636
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
Definition: avcodec.h:1067
uint8_t * subtitle_header
Header containing style information for text subtitles.
Definition: avcodec.h:2602
int keyint_min
minimum GOP size
Definition: avcodec.h:1773