21 #ifndef AVCODEC_AVCODEC_H
22 #define AVCODEC_AVCODEC_H
45 #if FF_API_FAST_MALLOC
114 AV_CODEC_ID_MPEG2VIDEO_XVMC,
325 #define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
587 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
593 #define AV_CODEC_PROP_LOSSY (1 << 1)
597 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
607 #define AV_CODEC_PROP_REORDER (1 << 3)
612 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
617 #define AV_CODEC_PROP_TEXT_SUB (1 << 17)
627 #define FF_INPUT_BUFFER_PADDING_SIZE 32
634 #define FF_MIN_BUFFER_SIZE 16384
692 #if FF_API_MAX_BFRAMES
696 #define FF_MAX_B_FRAMES 16
708 #define CODEC_FLAG_UNALIGNED 0x0001
709 #define CODEC_FLAG_QSCALE 0x0002
710 #define CODEC_FLAG_4MV 0x0004
711 #define CODEC_FLAG_OUTPUT_CORRUPT 0x0008
712 #define CODEC_FLAG_QPEL 0x0010
717 #define CODEC_FLAG_GMC 0x0020
724 #define CODEC_FLAG_MV0 0x0040
726 #if FF_API_INPUT_PRESERVED
731 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
733 #define CODEC_FLAG_PASS1 0x0200
734 #define CODEC_FLAG_PASS2 0x0400
735 #define CODEC_FLAG_GRAY 0x2000
741 #define CODEC_FLAG_EMU_EDGE 0x4000
743 #define CODEC_FLAG_PSNR 0x8000
744 #define CODEC_FLAG_TRUNCATED 0x00010000
746 #if FF_API_NORMALIZE_AQP
751 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
753 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
754 #define CODEC_FLAG_LOW_DELAY 0x00080000
755 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
756 #define CODEC_FLAG_BITEXACT 0x00800000
758 #define CODEC_FLAG_AC_PRED 0x01000000
759 #define CODEC_FLAG_LOOP_FILTER 0x00000800
760 #define CODEC_FLAG_INTERLACED_ME 0x20000000
761 #define CODEC_FLAG_CLOSED_GOP 0x80000000
762 #define CODEC_FLAG2_FAST 0x00000001
763 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
764 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
765 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
766 #define CODEC_FLAG2_IGNORE_CROP 0x00010000
768 #define CODEC_FLAG2_CHUNKS 0x00008000
769 #define CODEC_FLAG2_SHOW_ALL 0x00400000
770 #define CODEC_FLAG2_EXPORT_MVS 0x10000000
779 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
785 #define CODEC_CAP_DR1 0x0002
786 #define CODEC_CAP_TRUNCATED 0x0008
795 #define CODEC_CAP_HWACCEL 0x0010
820 #define CODEC_CAP_DELAY 0x0020
825 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
830 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
843 #define CODEC_CAP_SUBFRAMES 0x0100
848 #define CODEC_CAP_EXPERIMENTAL 0x0200
852 #define CODEC_CAP_CHANNEL_CONF 0x0400
853 #if FF_API_NEG_LINESIZES
857 #define CODEC_CAP_NEG_LINESIZES 0x0800
862 #define CODEC_CAP_FRAME_THREADS 0x1000
866 #define CODEC_CAP_SLICE_THREADS 0x2000
870 #define CODEC_CAP_PARAM_CHANGE 0x4000
874 #define CODEC_CAP_AUTO_THREADS 0x8000
878 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
882 #define CODEC_CAP_INTRA_ONLY 0x40000000
886 #define CODEC_CAP_LOSSLESS 0x80000000
890 #define MB_TYPE_INTRA4x4 0x0001
891 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
892 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
893 #define MB_TYPE_16x16 0x0008
894 #define MB_TYPE_16x8 0x0010
895 #define MB_TYPE_8x16 0x0020
896 #define MB_TYPE_8x8 0x0040
897 #define MB_TYPE_INTERLACED 0x0080
898 #define MB_TYPE_DIRECT2 0x0100 //FIXME
899 #define MB_TYPE_ACPRED 0x0200
900 #define MB_TYPE_GMC 0x0400
901 #define MB_TYPE_SKIP 0x0800
902 #define MB_TYPE_P0L0 0x1000
903 #define MB_TYPE_P1L0 0x2000
904 #define MB_TYPE_P0L1 0x4000
905 #define MB_TYPE_P1L1 0x8000
906 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
907 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
908 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
909 #define MB_TYPE_QUANT 0x00010000
910 #define MB_TYPE_CBP 0x00020000
943 #if FF_API_QSCALE_TYPE
944 #define FF_QSCALE_TYPE_MPEG1 0
945 #define FF_QSCALE_TYPE_MPEG2 1
946 #define FF_QSCALE_TYPE_H264 2
947 #define FF_QSCALE_TYPE_VP56 3
950 #if FF_API_GET_BUFFER
951 #define FF_BUFFER_TYPE_INTERNAL 1
952 #define FF_BUFFER_TYPE_USER 2
953 #define FF_BUFFER_TYPE_SHARED 4
954 #define FF_BUFFER_TYPE_COPY 8
956 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
957 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
958 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
959 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
965 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
1171 #if FF_API_DESTRUCT_PACKET
1198 #define AV_PKT_FLAG_KEY 0x0001
1199 #define AV_PKT_FLAG_CORRUPT 0x0002
1241 #if FF_API_CODEC_NAME
1318 #define FF_COMPRESSION_DEFAULT -1
1422 #if FF_API_ASPECT_EXTENDED
1423 #define FF_ASPECT_EXTENDED 15
1508 #define FF_RC_STRATEGY_XVID 1
1597 #define FF_PRED_LEFT 0
1598 #define FF_PRED_PLANE 1
1599 #define FF_PRED_MEDIAN 2
1641 #define FF_CMP_SAD 0
1642 #define FF_CMP_SSE 1
1643 #define FF_CMP_SATD 2
1644 #define FF_CMP_DCT 3
1645 #define FF_CMP_PSNR 4
1646 #define FF_CMP_BIT 5
1648 #define FF_CMP_ZERO 7
1649 #define FF_CMP_VSAD 8
1650 #define FF_CMP_VSSE 9
1651 #define FF_CMP_NSSE 10
1652 #define FF_CMP_W53 11
1653 #define FF_CMP_W97 12
1654 #define FF_CMP_DCTMAX 13
1655 #define FF_CMP_DCT264 14
1656 #define FF_CMP_CHROMA 256
1711 #define FF_DTG_AFD_SAME 8
1712 #define FF_DTG_AFD_4_3 9
1713 #define FF_DTG_AFD_16_9 10
1714 #define FF_DTG_AFD_14_9 11
1715 #define FF_DTG_AFD_4_3_SP_14_9 13
1716 #define FF_DTG_AFD_16_9_SP_14_9 14
1717 #define FF_DTG_AFD_SP_4_3 15
1735 #define FF_DEFAULT_QUANT_BIAS 999999
1750 #define SLICE_FLAG_CODED_ORDER 0x0001
1751 #define SLICE_FLAG_ALLOW_FIELD 0x0002
1752 #define SLICE_FLAG_ALLOW_PLANE 0x0004
1770 #define FF_MB_DECISION_SIMPLE 0
1771 #define FF_MB_DECISION_BITS 1
1772 #define FF_MB_DECISION_RD 2
1904 #if FF_API_UNUSED_MEMBERS
2025 #if FF_API_REQUEST_CHANNELS
2064 #if FF_API_GET_BUFFER
2357 #define FF_CODER_TYPE_VLC 0
2358 #define FF_CODER_TYPE_AC 1
2359 #define FF_CODER_TYPE_RAW 2
2360 #define FF_CODER_TYPE_RLE 3
2361 #if FF_API_UNUSED_MEMBERS
2362 #define FF_CODER_TYPE_DEFLATE 4
2499 #define FF_BUG_AUTODETECT 1
2500 #if FF_API_OLD_MSMPEG4
2501 #define FF_BUG_OLD_MSMPEG4 2
2503 #define FF_BUG_XVID_ILACE 4
2504 #define FF_BUG_UMP4 8
2505 #define FF_BUG_NO_PADDING 16
2506 #define FF_BUG_AMV 32
2508 #define FF_BUG_AC_VLC 0
2510 #define FF_BUG_QPEL_CHROMA 64
2511 #define FF_BUG_STD_QPEL 128
2512 #define FF_BUG_QPEL_CHROMA2 256
2513 #define FF_BUG_DIRECT_BLOCKSIZE 512
2514 #define FF_BUG_EDGE 1024
2515 #define FF_BUG_HPEL_CHROMA 2048
2516 #define FF_BUG_DC_CLIP 4096
2517 #define FF_BUG_MS 8192
2518 #define FF_BUG_TRUNCATED 16384
2533 #define FF_COMPLIANCE_VERY_STRICT 2
2534 #define FF_COMPLIANCE_STRICT 1
2535 #define FF_COMPLIANCE_NORMAL 0
2536 #define FF_COMPLIANCE_UNOFFICIAL -1
2537 #define FF_COMPLIANCE_EXPERIMENTAL -2
2545 #define FF_EC_GUESS_MVS 1
2546 #define FF_EC_DEBLOCK 2
2547 #define FF_EC_FAVOR_INTER 256
2555 #define FF_DEBUG_PICT_INFO 1
2556 #define FF_DEBUG_RC 2
2557 #define FF_DEBUG_BITSTREAM 4
2558 #define FF_DEBUG_MB_TYPE 8
2559 #define FF_DEBUG_QP 16
2564 #define FF_DEBUG_MV 32
2566 #define FF_DEBUG_DCT_COEFF 0x00000040
2567 #define FF_DEBUG_SKIP 0x00000080
2568 #define FF_DEBUG_STARTCODE 0x00000100
2569 #if FF_API_UNUSED_MEMBERS
2570 #define FF_DEBUG_PTS 0x00000200
2572 #define FF_DEBUG_ER 0x00000400
2573 #define FF_DEBUG_MMCO 0x00000800
2574 #define FF_DEBUG_BUGS 0x00001000
2576 #define FF_DEBUG_VIS_QP 0x00002000
2577 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2579 #define FF_DEBUG_BUFFERS 0x00008000
2580 #define FF_DEBUG_THREADS 0x00010000
2581 #define FF_DEBUG_NOMC 0x01000000
2591 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2592 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2593 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2609 #define AV_EF_CRCCHECK (1<<0)
2610 #define AV_EF_BITSTREAM (1<<1)
2611 #define AV_EF_BUFFER (1<<2)
2612 #define AV_EF_EXPLODE (1<<3)
2614 #define AV_EF_IGNORE_ERR (1<<15)
2615 #define AV_EF_CAREFUL (1<<16)
2616 #define AV_EF_COMPLIANT (1<<17)
2617 #define AV_EF_AGGRESSIVE (1<<18)
2660 #define FF_DCT_AUTO 0
2661 #define FF_DCT_FASTINT 1
2662 #if FF_API_UNUSED_MEMBERS
2663 #define FF_DCT_INT 2
2665 #define FF_DCT_MMX 3
2666 #define FF_DCT_ALTIVEC 5
2667 #define FF_DCT_FAAN 6
2675 #define FF_IDCT_AUTO 0
2676 #define FF_IDCT_INT 1
2677 #define FF_IDCT_SIMPLE 2
2678 #define FF_IDCT_SIMPLEMMX 3
2679 #define FF_IDCT_ARM 7
2680 #define FF_IDCT_ALTIVEC 8
2682 #define FF_IDCT_SH4 9
2684 #define FF_IDCT_SIMPLEARM 10
2685 #if FF_API_UNUSED_MEMBERS
2686 #define FF_IDCT_IPP 13
2688 #define FF_IDCT_XVID 14
2689 #if FF_API_IDCT_XVIDMMX
2690 #define FF_IDCT_XVIDMMX 14
2692 #define FF_IDCT_SIMPLEARMV5TE 16
2693 #define FF_IDCT_SIMPLEARMV6 17
2694 #if FF_API_ARCH_SPARC
2695 #define FF_IDCT_SIMPLEVIS 18
2697 #define FF_IDCT_FAAN 20
2698 #define FF_IDCT_SIMPLENEON 22
2699 #if FF_API_ARCH_ALPHA
2700 #define FF_IDCT_SIMPLEALPHA 23
2702 #define FF_IDCT_SIMPLEAUTO 128
2753 #define FF_THREAD_FRAME 1
2754 #define FF_THREAD_SLICE 2
2804 #if FF_API_THREAD_OPAQUE
2825 #define FF_PROFILE_UNKNOWN -99
2826 #define FF_PROFILE_RESERVED -100
2828 #define FF_PROFILE_AAC_MAIN 0
2829 #define FF_PROFILE_AAC_LOW 1
2830 #define FF_PROFILE_AAC_SSR 2
2831 #define FF_PROFILE_AAC_LTP 3
2832 #define FF_PROFILE_AAC_HE 4
2833 #define FF_PROFILE_AAC_HE_V2 28
2834 #define FF_PROFILE_AAC_LD 22
2835 #define FF_PROFILE_AAC_ELD 38
2836 #define FF_PROFILE_MPEG2_AAC_LOW 128
2837 #define FF_PROFILE_MPEG2_AAC_HE 131
2839 #define FF_PROFILE_DTS 20
2840 #define FF_PROFILE_DTS_ES 30
2841 #define FF_PROFILE_DTS_96_24 40
2842 #define FF_PROFILE_DTS_HD_HRA 50
2843 #define FF_PROFILE_DTS_HD_MA 60
2845 #define FF_PROFILE_MPEG2_422 0
2846 #define FF_PROFILE_MPEG2_HIGH 1
2847 #define FF_PROFILE_MPEG2_SS 2
2848 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
2849 #define FF_PROFILE_MPEG2_MAIN 4
2850 #define FF_PROFILE_MPEG2_SIMPLE 5
2852 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
2853 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
2855 #define FF_PROFILE_H264_BASELINE 66
2856 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2857 #define FF_PROFILE_H264_MAIN 77
2858 #define FF_PROFILE_H264_EXTENDED 88
2859 #define FF_PROFILE_H264_HIGH 100
2860 #define FF_PROFILE_H264_HIGH_10 110
2861 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
2862 #define FF_PROFILE_H264_HIGH_422 122
2863 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
2864 #define FF_PROFILE_H264_HIGH_444 144
2865 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
2866 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
2867 #define FF_PROFILE_H264_CAVLC_444 44
2869 #define FF_PROFILE_VC1_SIMPLE 0
2870 #define FF_PROFILE_VC1_MAIN 1
2871 #define FF_PROFILE_VC1_COMPLEX 2
2872 #define FF_PROFILE_VC1_ADVANCED 3
2874 #define FF_PROFILE_MPEG4_SIMPLE 0
2875 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
2876 #define FF_PROFILE_MPEG4_CORE 2
2877 #define FF_PROFILE_MPEG4_MAIN 3
2878 #define FF_PROFILE_MPEG4_N_BIT 4
2879 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
2880 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
2881 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
2882 #define FF_PROFILE_MPEG4_HYBRID 8
2883 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
2884 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
2885 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
2886 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
2887 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
2888 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
2889 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
2891 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0
2892 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1
2893 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2
2894 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
2895 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
2898 #define FF_PROFILE_HEVC_MAIN 1
2899 #define FF_PROFILE_HEVC_MAIN_10 2
2900 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
2901 #define FF_PROFILE_HEVC_REXT 4
2909 #define FF_LEVEL_UNKNOWN -99
2943 #if FF_API_ERROR_RATE
2952 #if FF_API_CODEC_PKT
3036 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1
3037 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0
3038 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3062 #if !FF_API_DEBUG_MV
3070 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
3071 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
3072 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
3198 int *got_packet_ptr);
3389 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3540 #if FF_API_AVFRAME_LAVC
3545 AVFrame *avcodec_alloc_frame(
void);
3638 #if FF_API_DESTRUCT_PACKET
3879 #if FF_API_GET_BUFFER
3948 #if FF_API_OLD_DECODE_AUDIO
4004 int *frame_size_ptr,
4057 int *got_frame_ptr,
const AVPacket *avpkt);
4100 int *got_picture_ptr,
4170 #define AV_PARSER_PTS_NB 4
4177 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
4178 #define PARSER_FLAG_ONCE 0x0002
4180 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
4181 #define PARSER_FLAG_USE_CODEC_TS 0x1000
4305 const uint8_t **poutbuf,
int *poutbuf_size,
4347 uint8_t **poutbuf,
int *poutbuf_size,
4349 int64_t pts, int64_t dts,
4358 uint8_t **poutbuf,
int *poutbuf_size,
4359 const uint8_t *
buf,
int buf_size,
int keyframe);
4388 #if FF_API_OLD_ENCODE_AUDIO
4415 const short *samples);
4460 #if FF_API_OLD_ENCODE_VIDEO
4525 #if FF_API_AVCODEC_RESAMPLE
4556 int output_rate,
int input_rate,
4559 int filter_length,
int log2_phase_count,
4560 int linear,
double cutoff);
4698 unsigned char *dest,
int dest_size);
4714 #if FF_API_DEINTERLACE
4740 int padtop,
int padbottom,
int padleft,
int padright,
int *
color);
4811 int has_alpha,
int *loss_ptr);
4817 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4820 #if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
4823 int has_alpha,
int *loss_ptr);
4826 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4836 #if FF_API_SET_DIMENSIONS
4895 int buf_size,
int align);
4958 uint8_t **poutbuf,
int *poutbuf_size,
5017 uint8_t **poutbuf,
int *poutbuf_size,
5018 const uint8_t *
buf,
int buf_size,
int keyframe);
5064 #if FF_API_MISSING_SAMPLE