21 #ifndef AVCODEC_AVCODEC_H
22 #define AVCODEC_AVCODEC_H
306 #define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
550 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
556 #define AV_CODEC_PROP_LOSSY (1 << 1)
560 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
565 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
570 #define AV_CODEC_PROP_TEXT_SUB (1 << 17)
580 #define FF_INPUT_BUFFER_PADDING_SIZE 16
587 #define FF_MIN_BUFFER_SIZE 16384
680 #define FF_MAX_B_FRAMES 16
691 #define CODEC_FLAG_UNALIGNED 0x0001
692 #define CODEC_FLAG_QSCALE 0x0002
693 #define CODEC_FLAG_4MV 0x0004
694 #define CODEC_FLAG_QPEL 0x0010
695 #define CODEC_FLAG_GMC 0x0020
696 #define CODEC_FLAG_MV0 0x0040
702 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
703 #define CODEC_FLAG_PASS1 0x0200
704 #define CODEC_FLAG_PASS2 0x0400
705 #define CODEC_FLAG_GRAY 0x2000
706 #define CODEC_FLAG_EMU_EDGE 0x4000
707 #define CODEC_FLAG_PSNR 0x8000
708 #define CODEC_FLAG_TRUNCATED 0x00010000
710 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
711 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
712 #define CODEC_FLAG_LOW_DELAY 0x00080000
713 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
714 #define CODEC_FLAG_BITEXACT 0x00800000
716 #define CODEC_FLAG_AC_PRED 0x01000000
717 #define CODEC_FLAG_LOOP_FILTER 0x00000800
718 #define CODEC_FLAG_INTERLACED_ME 0x20000000
719 #define CODEC_FLAG_CLOSED_GOP 0x80000000
720 #define CODEC_FLAG2_FAST 0x00000001
721 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
722 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
723 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
724 #define CODEC_FLAG2_IGNORE_CROP 0x00010000
726 #define CODEC_FLAG2_CHUNKS 0x00008000
727 #define CODEC_FLAG2_SHOW_ALL 0x00400000
736 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
742 #define CODEC_CAP_DR1 0x0002
743 #define CODEC_CAP_TRUNCATED 0x0008
745 #define CODEC_CAP_HWACCEL 0x0010
769 #define CODEC_CAP_DELAY 0x0020
774 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
779 #define CODEC_CAP_HWACCEL_VDPAU 0x0080
792 #define CODEC_CAP_SUBFRAMES 0x0100
797 #define CODEC_CAP_EXPERIMENTAL 0x0200
801 #define CODEC_CAP_CHANNEL_CONF 0x0400
806 #define CODEC_CAP_NEG_LINESIZES 0x0800
811 #define CODEC_CAP_FRAME_THREADS 0x1000
815 #define CODEC_CAP_SLICE_THREADS 0x2000
819 #define CODEC_CAP_PARAM_CHANGE 0x4000
823 #define CODEC_CAP_AUTO_THREADS 0x8000
827 #define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
831 #define CODEC_CAP_INTRA_ONLY 0x40000000
835 #define CODEC_CAP_LOSSLESS 0x80000000
838 #define MB_TYPE_INTRA4x4 0x0001
839 #define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
840 #define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific
841 #define MB_TYPE_16x16 0x0008
842 #define MB_TYPE_16x8 0x0010
843 #define MB_TYPE_8x16 0x0020
844 #define MB_TYPE_8x8 0x0040
845 #define MB_TYPE_INTERLACED 0x0080
846 #define MB_TYPE_DIRECT2 0x0100 //FIXME
847 #define MB_TYPE_ACPRED 0x0200
848 #define MB_TYPE_GMC 0x0400
849 #define MB_TYPE_SKIP 0x0800
850 #define MB_TYPE_P0L0 0x1000
851 #define MB_TYPE_P1L0 0x2000
852 #define MB_TYPE_P0L1 0x4000
853 #define MB_TYPE_P1L1 0x8000
854 #define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
855 #define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
856 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
857 #define MB_TYPE_QUANT 0x00010000
858 #define MB_TYPE_CBP 0x00020000
890 #define FF_QSCALE_TYPE_MPEG1 0
891 #define FF_QSCALE_TYPE_MPEG2 1
892 #define FF_QSCALE_TYPE_H264 2
893 #define FF_QSCALE_TYPE_VP56 3
895 #if FF_API_GET_BUFFER
896 #define FF_BUFFER_TYPE_INTERNAL 1
897 #define FF_BUFFER_TYPE_USER 2
898 #define FF_BUFFER_TYPE_SHARED 4
899 #define FF_BUFFER_TYPE_COPY 8
901 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
902 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
903 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
904 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
910 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
1086 #if FF_API_DESTRUCT_PACKET
1113 #define AV_PKT_FLAG_KEY 0x0001
1114 #define AV_PKT_FLAG_CORRUPT 0x0002
1227 #define FF_COMPRESSION_DEFAULT -1
1326 #define FF_ASPECT_EXTENDED 15
1410 #define FF_RC_STRATEGY_XVID 1
1499 #define FF_PRED_LEFT 0
1500 #define FF_PRED_PLANE 1
1501 #define FF_PRED_MEDIAN 2
1543 #define FF_CMP_SAD 0
1544 #define FF_CMP_SSE 1
1545 #define FF_CMP_SATD 2
1546 #define FF_CMP_DCT 3
1547 #define FF_CMP_PSNR 4
1548 #define FF_CMP_BIT 5
1550 #define FF_CMP_ZERO 7
1551 #define FF_CMP_VSAD 8
1552 #define FF_CMP_VSSE 9
1553 #define FF_CMP_NSSE 10
1554 #define FF_CMP_W53 11
1555 #define FF_CMP_W97 12
1556 #define FF_CMP_DCTMAX 13
1557 #define FF_CMP_DCT264 14
1558 #define FF_CMP_CHROMA 256
1611 #define FF_DTG_AFD_SAME 8
1612 #define FF_DTG_AFD_4_3 9
1613 #define FF_DTG_AFD_16_9 10
1614 #define FF_DTG_AFD_14_9 11
1615 #define FF_DTG_AFD_4_3_SP_14_9 13
1616 #define FF_DTG_AFD_16_9_SP_14_9 14
1617 #define FF_DTG_AFD_SP_4_3 15
1634 #define FF_DEFAULT_QUANT_BIAS 999999
1649 #define SLICE_FLAG_CODED_ORDER 0x0001
1650 #define SLICE_FLAG_ALLOW_FIELD 0x0002
1651 #define SLICE_FLAG_ALLOW_PLANE 0x0004
1666 #define FF_MB_DECISION_SIMPLE 0
1667 #define FF_MB_DECISION_BITS 1
1668 #define FF_MB_DECISION_RD 2
1919 #if FF_API_REQUEST_CHANNELS
1958 #if FF_API_GET_BUFFER
2252 #define FF_CODER_TYPE_VLC 0
2253 #define FF_CODER_TYPE_AC 1
2254 #define FF_CODER_TYPE_RAW 2
2255 #define FF_CODER_TYPE_RLE 3
2256 #define FF_CODER_TYPE_DEFLATE 4
2392 #define FF_BUG_AUTODETECT 1
2393 #define FF_BUG_OLD_MSMPEG4 2
2394 #define FF_BUG_XVID_ILACE 4
2395 #define FF_BUG_UMP4 8
2396 #define FF_BUG_NO_PADDING 16
2397 #define FF_BUG_AMV 32
2398 #define FF_BUG_AC_VLC 0
2399 #define FF_BUG_QPEL_CHROMA 64
2400 #define FF_BUG_STD_QPEL 128
2401 #define FF_BUG_QPEL_CHROMA2 256
2402 #define FF_BUG_DIRECT_BLOCKSIZE 512
2403 #define FF_BUG_EDGE 1024
2404 #define FF_BUG_HPEL_CHROMA 2048
2405 #define FF_BUG_DC_CLIP 4096
2406 #define FF_BUG_MS 8192
2407 #define FF_BUG_TRUNCATED 16384
2422 #define FF_COMPLIANCE_VERY_STRICT 2
2423 #define FF_COMPLIANCE_STRICT 1
2424 #define FF_COMPLIANCE_NORMAL 0
2425 #define FF_COMPLIANCE_UNOFFICIAL -1
2426 #define FF_COMPLIANCE_EXPERIMENTAL -2
2434 #define FF_EC_GUESS_MVS 1
2435 #define FF_EC_DEBLOCK 2
2443 #define FF_DEBUG_PICT_INFO 1
2444 #define FF_DEBUG_RC 2
2445 #define FF_DEBUG_BITSTREAM 4
2446 #define FF_DEBUG_MB_TYPE 8
2447 #define FF_DEBUG_QP 16
2448 #define FF_DEBUG_MV 32
2449 #define FF_DEBUG_DCT_COEFF 0x00000040
2450 #define FF_DEBUG_SKIP 0x00000080
2451 #define FF_DEBUG_STARTCODE 0x00000100
2452 #define FF_DEBUG_PTS 0x00000200
2453 #define FF_DEBUG_ER 0x00000400
2454 #define FF_DEBUG_MMCO 0x00000800
2455 #define FF_DEBUG_BUGS 0x00001000
2456 #define FF_DEBUG_VIS_QP 0x00002000
2457 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2458 #define FF_DEBUG_BUFFERS 0x00008000
2459 #define FF_DEBUG_THREADS 0x00010000
2467 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2468 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2469 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2477 #define AV_EF_CRCCHECK (1<<0)
2478 #define AV_EF_BITSTREAM (1<<1)
2479 #define AV_EF_BUFFER (1<<2)
2480 #define AV_EF_EXPLODE (1<<3)
2482 #define AV_EF_CAREFUL (1<<16)
2483 #define AV_EF_COMPLIANT (1<<17)
2484 #define AV_EF_AGGRESSIVE (1<<18)
2528 #define FF_DCT_AUTO 0
2529 #define FF_DCT_FASTINT 1
2530 #define FF_DCT_INT 2
2531 #define FF_DCT_MMX 3
2532 #define FF_DCT_ALTIVEC 5
2533 #define FF_DCT_FAAN 6
2541 #define FF_IDCT_AUTO 0
2542 #define FF_IDCT_INT 1
2543 #define FF_IDCT_SIMPLE 2
2544 #define FF_IDCT_SIMPLEMMX 3
2545 #define FF_IDCT_ARM 7
2546 #define FF_IDCT_ALTIVEC 8
2547 #define FF_IDCT_SH4 9
2548 #define FF_IDCT_SIMPLEARM 10
2549 #define FF_IDCT_IPP 13
2550 #define FF_IDCT_XVIDMMX 14
2551 #define FF_IDCT_SIMPLEARMV5TE 16
2552 #define FF_IDCT_SIMPLEARMV6 17
2553 #define FF_IDCT_SIMPLEVIS 18
2554 #define FF_IDCT_FAAN 20
2555 #define FF_IDCT_SIMPLENEON 22
2556 #define FF_IDCT_SIMPLEALPHA 23
2607 #define FF_THREAD_FRAME 1
2608 #define FF_THREAD_SLICE 2
2679 #define FF_PROFILE_UNKNOWN -99
2680 #define FF_PROFILE_RESERVED -100
2682 #define FF_PROFILE_AAC_MAIN 0
2683 #define FF_PROFILE_AAC_LOW 1
2684 #define FF_PROFILE_AAC_SSR 2
2685 #define FF_PROFILE_AAC_LTP 3
2686 #define FF_PROFILE_AAC_HE 4
2687 #define FF_PROFILE_AAC_HE_V2 28
2688 #define FF_PROFILE_AAC_LD 22
2689 #define FF_PROFILE_AAC_ELD 38
2690 #define FF_PROFILE_MPEG2_AAC_LOW 128
2691 #define FF_PROFILE_MPEG2_AAC_HE 131
2693 #define FF_PROFILE_DTS 20
2694 #define FF_PROFILE_DTS_ES 30
2695 #define FF_PROFILE_DTS_96_24 40
2696 #define FF_PROFILE_DTS_HD_HRA 50
2697 #define FF_PROFILE_DTS_HD_MA 60
2699 #define FF_PROFILE_MPEG2_422 0
2700 #define FF_PROFILE_MPEG2_HIGH 1
2701 #define FF_PROFILE_MPEG2_SS 2
2702 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
2703 #define FF_PROFILE_MPEG2_MAIN 4
2704 #define FF_PROFILE_MPEG2_SIMPLE 5
2706 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
2707 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
2709 #define FF_PROFILE_H264_BASELINE 66
2710 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
2711 #define FF_PROFILE_H264_MAIN 77
2712 #define FF_PROFILE_H264_EXTENDED 88
2713 #define FF_PROFILE_H264_HIGH 100
2714 #define FF_PROFILE_H264_HIGH_10 110
2715 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
2716 #define FF_PROFILE_H264_HIGH_422 122
2717 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
2718 #define FF_PROFILE_H264_HIGH_444 144
2719 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
2720 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
2721 #define FF_PROFILE_H264_CAVLC_444 44
2723 #define FF_PROFILE_VC1_SIMPLE 0
2724 #define FF_PROFILE_VC1_MAIN 1
2725 #define FF_PROFILE_VC1_COMPLEX 2
2726 #define FF_PROFILE_VC1_ADVANCED 3
2728 #define FF_PROFILE_MPEG4_SIMPLE 0
2729 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
2730 #define FF_PROFILE_MPEG4_CORE 2
2731 #define FF_PROFILE_MPEG4_MAIN 3
2732 #define FF_PROFILE_MPEG4_N_BIT 4
2733 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
2734 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
2735 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
2736 #define FF_PROFILE_MPEG4_HYBRID 8
2737 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
2738 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
2739 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
2740 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
2741 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
2742 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
2743 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
2745 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 0
2746 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 1
2747 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 2
2748 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
2749 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
2757 #define FF_LEVEL_UNKNOWN -99
2868 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1
2869 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0
2870 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3006 int *got_packet_ptr);
3148 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3230 #if FF_API_ALLOC_CONTEXT
3356 #if FF_API_AVCODEC_OPEN
3455 #if FF_API_DESTRUCT_PACKET
3665 #if FF_API_GET_BUFFER
3732 #if FF_API_OLD_DECODE_AUDIO
3788 int *frame_size_ptr,
3841 int *got_frame_ptr,
const AVPacket *avpkt);
3884 int *got_picture_ptr,
3954 #define AV_PARSER_PTS_NB 4
3961 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
3962 #define PARSER_FLAG_ONCE 0x0002
3964 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
3965 #define PARSER_FLAG_USE_CODEC_TS 0x1000
4089 const uint8_t **poutbuf,
int *poutbuf_size,
4131 uint8_t **poutbuf,
int *poutbuf_size,
4133 int64_t pts, int64_t dts,
4142 uint8_t **poutbuf,
int *poutbuf_size,
4143 const uint8_t *
buf,
int buf_size,
int keyframe);
4172 #if FF_API_OLD_ENCODE_AUDIO
4199 const short *samples);
4244 #if FF_API_OLD_ENCODE_VIDEO
4309 #if FF_API_AVCODEC_RESAMPLE
4317 struct ReSampleContext;
4318 struct AVResampleContext;
4320 typedef struct ReSampleContext ReSampleContext;
4339 ReSampleContext *av_audio_resample_init(
int output_channels,
int input_channels,
4340 int output_rate,
int input_rate,
4343 int filter_length,
int log2_phase_count,
4344 int linear,
double cutoff);
4347 int audio_resample(ReSampleContext *
s,
short *output,
short *input,
int nb_samples);
4356 void audio_resample_close(ReSampleContext *
s);
4369 struct AVResampleContext *av_resample_init(
int out_rate,
int in_rate,
int filter_length,
int log2_phase_count,
int linear,
double cutoff);
4381 int av_resample(
struct AVResampleContext *
c,
short *dst,
short *
src,
int *consumed,
int src_size,
int dst_size,
int update_ctx);
4397 void av_resample_compensate(
struct AVResampleContext *
c,
int sample_delta,
int compensation_distance);
4399 void av_resample_close(
struct AVResampleContext *
c);
4482 unsigned char *dest,
int dest_size);
4498 #if FF_API_DEINTERLACE
4524 int padtop,
int padbottom,
int padleft,
int padright,
int *
color);
4570 #define FF_LOSS_RESOLUTION 0x0001
4571 #define FF_LOSS_DEPTH 0x0002
4572 #define FF_LOSS_COLORSPACE 0x0004
4573 #define FF_LOSS_ALPHA 0x0008
4574 #define FF_LOSS_COLORQUANT 0x0010
4575 #define FF_LOSS_CHROMA 0x0020
4617 int has_alpha,
int *loss_ptr);
4650 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4653 #if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
4656 int has_alpha,
int *loss_ptr);
4659 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4720 int buf_size,
int align);
4783 uint8_t **poutbuf,
int *poutbuf_size,
4842 uint8_t **poutbuf,
int *poutbuf_size,
4843 const uint8_t *
buf,
int buf_size,
int keyframe);
4910 #if FF_API_MISSING_SAMPLE
4925 void av_log_missing_feature(
void *avc,
const char *feature,
int want_sample);
4937 void av_log_ask_for_sample(
void *avc,
const char *msg, ...)
av_printf_format(2, 3);