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)
602 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
607 #define AV_CODEC_PROP_TEXT_SUB (1 << 17)
617 #define FF_INPUT_BUFFER_PADDING_SIZE 32
624 #define FF_MIN_BUFFER_SIZE 16384
682 #if FF_API_MAX_BFRAMES
686 #define FF_MAX_B_FRAMES 16
698 #define CODEC_FLAG_UNALIGNED 0x0001
699 #define CODEC_FLAG_QSCALE 0x0002
700 #define CODEC_FLAG_4MV 0x0004
701 #define CODEC_FLAG_OUTPUT_CORRUPT 0x0008
702 #define CODEC_FLAG_QPEL 0x0010
707 #define CODEC_FLAG_GMC 0x0020
714 #define CODEC_FLAG_MV0 0x0040
716 #if FF_API_INPUT_PRESERVED
721 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
723 #define CODEC_FLAG_PASS1 0x0200
724 #define CODEC_FLAG_PASS2 0x0400
725 #define CODEC_FLAG_GRAY 0x2000
731 #define CODEC_FLAG_EMU_EDGE 0x4000
733 #define CODEC_FLAG_PSNR 0x8000
734 #define CODEC_FLAG_TRUNCATED 0x00010000
736 #if FF_API_NORMALIZE_AQP
741 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
743 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
744 #define CODEC_FLAG_LOW_DELAY 0x00080000
745 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
746 #define CODEC_FLAG_BITEXACT 0x00800000
748 #define CODEC_FLAG_AC_PRED 0x01000000
749 #define CODEC_FLAG_LOOP_FILTER 0x00000800
750 #define CODEC_FLAG_INTERLACED_ME 0x20000000
751 #define CODEC_FLAG_CLOSED_GOP 0x80000000
752 #define CODEC_FLAG2_FAST 0x00000001
753 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
754 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
755 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
756 #define CODEC_FLAG2_IGNORE_CROP 0x00010000
758 #define CODEC_FLAG2_CHUNKS 0x00008000
759 #define CODEC_FLAG2_SHOW_ALL 0x00400000
768 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
774 #define CODEC_CAP_DR1 0x0002
775 #define CODEC_CAP_TRUNCATED 0x0008
784 #define CODEC_CAP_HWACCEL 0x0010
809 #define CODEC_CAP_DELAY 0x0020
814 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
819 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
832 #define CODEC_CAP_SUBFRAMES 0x0100
837 #define CODEC_CAP_EXPERIMENTAL 0x0200
841 #define CODEC_CAP_CHANNEL_CONF 0x0400
842 #if FF_API_NEG_LINESIZES
846 #define CODEC_CAP_NEG_LINESIZES 0x0800
851 #define CODEC_CAP_FRAME_THREADS 0x1000
855 #define CODEC_CAP_SLICE_THREADS 0x2000
859 #define CODEC_CAP_PARAM_CHANGE 0x4000
863 #define CODEC_CAP_AUTO_THREADS 0x8000
867 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
871 #define CODEC_CAP_INTRA_ONLY 0x40000000
875 #define CODEC_CAP_LOSSLESS 0x80000000
879 #define MB_TYPE_INTRA4x4 0x0001
880 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
881 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
882 #define MB_TYPE_16x16 0x0008
883 #define MB_TYPE_16x8 0x0010
884 #define MB_TYPE_8x16 0x0020
885 #define MB_TYPE_8x8 0x0040
886 #define MB_TYPE_INTERLACED 0x0080
887 #define MB_TYPE_DIRECT2 0x0100 //FIXME
888 #define MB_TYPE_ACPRED 0x0200
889 #define MB_TYPE_GMC 0x0400
890 #define MB_TYPE_SKIP 0x0800
891 #define MB_TYPE_P0L0 0x1000
892 #define MB_TYPE_P1L0 0x2000
893 #define MB_TYPE_P0L1 0x4000
894 #define MB_TYPE_P1L1 0x8000
895 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
896 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
897 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
898 #define MB_TYPE_QUANT 0x00010000
899 #define MB_TYPE_CBP 0x00020000
932 #if FF_API_QSCALE_TYPE
933 #define FF_QSCALE_TYPE_MPEG1 0
934 #define FF_QSCALE_TYPE_MPEG2 1
935 #define FF_QSCALE_TYPE_H264 2
936 #define FF_QSCALE_TYPE_VP56 3
939 #if FF_API_GET_BUFFER
940 #define FF_BUFFER_TYPE_INTERNAL 1
941 #define FF_BUFFER_TYPE_USER 2
942 #define FF_BUFFER_TYPE_SHARED 4
943 #define FF_BUFFER_TYPE_COPY 8
945 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
946 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
947 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
948 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
954 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
1154 #if FF_API_DESTRUCT_PACKET
1181 #define AV_PKT_FLAG_KEY 0x0001
1182 #define AV_PKT_FLAG_CORRUPT 0x0002
1224 #if FF_API_CODEC_NAME
1301 #define FF_COMPRESSION_DEFAULT -1
1405 #if FF_API_ASPECT_EXTENDED
1406 #define FF_ASPECT_EXTENDED 15
1491 #define FF_RC_STRATEGY_XVID 1
1580 #define FF_PRED_LEFT 0
1581 #define FF_PRED_PLANE 1
1582 #define FF_PRED_MEDIAN 2
1624 #define FF_CMP_SAD 0
1625 #define FF_CMP_SSE 1
1626 #define FF_CMP_SATD 2
1627 #define FF_CMP_DCT 3
1628 #define FF_CMP_PSNR 4
1629 #define FF_CMP_BIT 5
1631 #define FF_CMP_ZERO 7
1632 #define FF_CMP_VSAD 8
1633 #define FF_CMP_VSSE 9
1634 #define FF_CMP_NSSE 10
1635 #define FF_CMP_W53 11
1636 #define FF_CMP_W97 12
1637 #define FF_CMP_DCTMAX 13
1638 #define FF_CMP_DCT264 14
1639 #define FF_CMP_CHROMA 256
1692 #define FF_DTG_AFD_SAME 8
1693 #define FF_DTG_AFD_4_3 9
1694 #define FF_DTG_AFD_16_9 10
1695 #define FF_DTG_AFD_14_9 11
1696 #define FF_DTG_AFD_4_3_SP_14_9 13
1697 #define FF_DTG_AFD_16_9_SP_14_9 14
1698 #define FF_DTG_AFD_SP_4_3 15
1715 #define FF_DEFAULT_QUANT_BIAS 999999
1730 #define SLICE_FLAG_CODED_ORDER 0x0001
1731 #define SLICE_FLAG_ALLOW_FIELD 0x0002
1732 #define SLICE_FLAG_ALLOW_PLANE 0x0004
1750 #define FF_MB_DECISION_SIMPLE 0
1751 #define FF_MB_DECISION_BITS 1
1752 #define FF_MB_DECISION_RD 2
2003 #if FF_API_REQUEST_CHANNELS
2042 #if FF_API_GET_BUFFER
2335 #define FF_CODER_TYPE_VLC 0
2336 #define FF_CODER_TYPE_AC 1
2337 #define FF_CODER_TYPE_RAW 2
2338 #define FF_CODER_TYPE_RLE 3
2339 #define FF_CODER_TYPE_DEFLATE 4
2475 #define FF_BUG_AUTODETECT 1
2476 #if FF_API_OLD_MSMPEG4
2477 #define FF_BUG_OLD_MSMPEG4 2
2479 #define FF_BUG_XVID_ILACE 4
2480 #define FF_BUG_UMP4 8
2481 #define FF_BUG_NO_PADDING 16
2482 #define FF_BUG_AMV 32
2484 #define FF_BUG_AC_VLC 0
2486 #define FF_BUG_QPEL_CHROMA 64
2487 #define FF_BUG_STD_QPEL 128
2488 #define FF_BUG_QPEL_CHROMA2 256
2489 #define FF_BUG_DIRECT_BLOCKSIZE 512
2490 #define FF_BUG_EDGE 1024
2491 #define FF_BUG_HPEL_CHROMA 2048
2492 #define FF_BUG_DC_CLIP 4096
2493 #define FF_BUG_MS 8192
2494 #define FF_BUG_TRUNCATED 16384
2509 #define FF_COMPLIANCE_VERY_STRICT 2
2510 #define FF_COMPLIANCE_STRICT 1
2511 #define FF_COMPLIANCE_NORMAL 0
2512 #define FF_COMPLIANCE_UNOFFICIAL -1
2513 #define FF_COMPLIANCE_EXPERIMENTAL -2
2521 #define FF_EC_GUESS_MVS 1
2522 #define FF_EC_DEBLOCK 2
2523 #define FF_EC_FAVOR_INTER 256
2531 #define FF_DEBUG_PICT_INFO 1
2532 #define FF_DEBUG_RC 2
2533 #define FF_DEBUG_BITSTREAM 4
2534 #define FF_DEBUG_MB_TYPE 8
2535 #define FF_DEBUG_QP 16
2540 #define FF_DEBUG_MV 32
2542 #define FF_DEBUG_DCT_COEFF 0x00000040
2543 #define FF_DEBUG_SKIP 0x00000080
2544 #define FF_DEBUG_STARTCODE 0x00000100
2545 #define FF_DEBUG_PTS 0x00000200
2546 #define FF_DEBUG_ER 0x00000400
2547 #define FF_DEBUG_MMCO 0x00000800
2548 #define FF_DEBUG_BUGS 0x00001000
2550 #define FF_DEBUG_VIS_QP 0x00002000
2551 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2553 #define FF_DEBUG_BUFFERS 0x00008000
2554 #define FF_DEBUG_THREADS 0x00010000
2555 #define FF_DEBUG_NOMC 0x01000000
2565 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2566 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2567 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2583 #define AV_EF_CRCCHECK (1<<0)
2584 #define AV_EF_BITSTREAM (1<<1)
2585 #define AV_EF_BUFFER (1<<2)
2586 #define AV_EF_EXPLODE (1<<3)
2588 #define AV_EF_IGNORE_ERR (1<<15)
2589 #define AV_EF_CAREFUL (1<<16)
2590 #define AV_EF_COMPLIANT (1<<17)
2591 #define AV_EF_AGGRESSIVE (1<<18)
2635 #define FF_DCT_AUTO 0
2636 #define FF_DCT_FASTINT 1
2637 #define FF_DCT_INT 2
2638 #define FF_DCT_MMX 3
2639 #define FF_DCT_ALTIVEC 5
2640 #define FF_DCT_FAAN 6
2648 #define FF_IDCT_AUTO 0
2649 #define FF_IDCT_INT 1
2650 #define FF_IDCT_SIMPLE 2
2651 #define FF_IDCT_SIMPLEMMX 3
2652 #define FF_IDCT_ARM 7
2653 #define FF_IDCT_ALTIVEC 8
2655 #define FF_IDCT_SH4 9
2657 #define FF_IDCT_SIMPLEARM 10
2658 #define FF_IDCT_IPP 13
2659 #define FF_IDCT_XVIDMMX 14
2660 #define FF_IDCT_SIMPLEARMV5TE 16
2661 #define FF_IDCT_SIMPLEARMV6 17
2662 #if FF_API_ARCH_SPARC
2663 #define FF_IDCT_SIMPLEVIS 18
2665 #define FF_IDCT_FAAN 20
2666 #define FF_IDCT_SIMPLENEON 22
2667 #if FF_API_ARCH_ALPHA
2668 #define FF_IDCT_SIMPLEALPHA 23
2670 #define FF_IDCT_SIMPLEAUTO 128
2721 #define FF_THREAD_FRAME 1
2722 #define FF_THREAD_SLICE 2
2772 #if FF_API_THREAD_OPAQUE
2793 #define FF_PROFILE_UNKNOWN -99
2794 #define FF_PROFILE_RESERVED -100
2796 #define FF_PROFILE_AAC_MAIN 0
2797 #define FF_PROFILE_AAC_LOW 1
2798 #define FF_PROFILE_AAC_SSR 2
2799 #define FF_PROFILE_AAC_LTP 3
2800 #define FF_PROFILE_AAC_HE 4
2801 #define FF_PROFILE_AAC_HE_V2 28
2802 #define FF_PROFILE_AAC_LD 22
2803 #define FF_PROFILE_AAC_ELD 38
2804 #define FF_PROFILE_MPEG2_AAC_LOW 128
2805 #define FF_PROFILE_MPEG2_AAC_HE 131
2807 #define FF_PROFILE_DTS 20
2808 #define FF_PROFILE_DTS_ES 30
2809 #define FF_PROFILE_DTS_96_24 40
2810 #define FF_PROFILE_DTS_HD_HRA 50
2811 #define FF_PROFILE_DTS_HD_MA 60
2813 #define FF_PROFILE_MPEG2_422 0
2814 #define FF_PROFILE_MPEG2_HIGH 1
2815 #define FF_PROFILE_MPEG2_SS 2
2816 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
2817 #define FF_PROFILE_MPEG2_MAIN 4
2818 #define FF_PROFILE_MPEG2_SIMPLE 5
2820 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
2821 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
2823 #define FF_PROFILE_H264_BASELINE 66
2824 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2825 #define FF_PROFILE_H264_MAIN 77
2826 #define FF_PROFILE_H264_EXTENDED 88
2827 #define FF_PROFILE_H264_HIGH 100
2828 #define FF_PROFILE_H264_HIGH_10 110
2829 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
2830 #define FF_PROFILE_H264_HIGH_422 122
2831 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
2832 #define FF_PROFILE_H264_HIGH_444 144
2833 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
2834 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
2835 #define FF_PROFILE_H264_CAVLC_444 44
2837 #define FF_PROFILE_VC1_SIMPLE 0
2838 #define FF_PROFILE_VC1_MAIN 1
2839 #define FF_PROFILE_VC1_COMPLEX 2
2840 #define FF_PROFILE_VC1_ADVANCED 3
2842 #define FF_PROFILE_MPEG4_SIMPLE 0
2843 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
2844 #define FF_PROFILE_MPEG4_CORE 2
2845 #define FF_PROFILE_MPEG4_MAIN 3
2846 #define FF_PROFILE_MPEG4_N_BIT 4
2847 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
2848 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
2849 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
2850 #define FF_PROFILE_MPEG4_HYBRID 8
2851 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
2852 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
2853 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
2854 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
2855 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
2856 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
2857 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
2859 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0
2860 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1
2861 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2
2862 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
2863 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
2866 #define FF_PROFILE_HEVC_MAIN 1
2867 #define FF_PROFILE_HEVC_MAIN_10 2
2868 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
2869 #define FF_PROFILE_HEVC_REXT 4
2877 #define FF_LEVEL_UNKNOWN -99
2911 #if FF_API_ERROR_RATE
2920 #if FF_API_CODEC_PKT
3004 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1
3005 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0
3006 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3030 #if !FF_API_DEBUG_MV
3038 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
3039 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
3040 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
3166 int *got_packet_ptr);
3357 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3508 #if FF_API_AVFRAME_LAVC
3513 AVFrame *avcodec_alloc_frame(
void);
3606 #if FF_API_DESTRUCT_PACKET
3847 #if FF_API_GET_BUFFER
3916 #if FF_API_OLD_DECODE_AUDIO
3972 int *frame_size_ptr,
4025 int *got_frame_ptr,
const AVPacket *avpkt);
4068 int *got_picture_ptr,
4138 #define AV_PARSER_PTS_NB 4
4145 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
4146 #define PARSER_FLAG_ONCE 0x0002
4148 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
4149 #define PARSER_FLAG_USE_CODEC_TS 0x1000
4273 const uint8_t **poutbuf,
int *poutbuf_size,
4315 uint8_t **poutbuf,
int *poutbuf_size,
4317 int64_t pts, int64_t dts,
4326 uint8_t **poutbuf,
int *poutbuf_size,
4327 const uint8_t *
buf,
int buf_size,
int keyframe);
4356 #if FF_API_OLD_ENCODE_AUDIO
4383 const short *samples);
4428 #if FF_API_OLD_ENCODE_VIDEO
4493 #if FF_API_AVCODEC_RESAMPLE
4524 int output_rate,
int input_rate,
4527 int filter_length,
int log2_phase_count,
4528 int linear,
double cutoff);
4666 unsigned char *dest,
int dest_size);
4682 #if FF_API_DEINTERLACE
4708 int padtop,
int padbottom,
int padleft,
int padright,
int *
color);
4779 int has_alpha,
int *loss_ptr);
4785 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4788 #if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
4791 int has_alpha,
int *loss_ptr);
4794 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4804 #if FF_API_SET_DIMENSIONS
4863 int buf_size,
int align);
4926 uint8_t **poutbuf,
int *poutbuf_size,
4985 uint8_t **poutbuf,
int *poutbuf_size,
4986 const uint8_t *
buf,
int buf_size,
int keyframe);
5032 #if FF_API_MISSING_SAMPLE