21 #ifndef AVCODEC_AVCODEC_H
22 #define AVCODEC_AVCODEC_H
443 #if LIBAVCODEC_VERSION_MAJOR <= 54
501 #define CodecID AVCodecID
532 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
538 #define AV_CODEC_PROP_LOSSY (1 << 1)
542 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
546 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
548 #if FF_API_OLD_DECODE_AUDIO
550 #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
561 #define FF_INPUT_BUFFER_PADDING_SIZE 16
568 #define FF_MIN_BUFFER_SIZE 16384
633 #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
681 #define FF_MAX_B_FRAMES 16
688 #define CODEC_FLAG_QSCALE 0x0002
689 #define CODEC_FLAG_4MV 0x0004
690 #define CODEC_FLAG_QPEL 0x0010
691 #define CODEC_FLAG_GMC 0x0020
692 #define CODEC_FLAG_MV0 0x0040
698 #define CODEC_FLAG_INPUT_PRESERVED 0x0100
699 #define CODEC_FLAG_PASS1 0x0200
700 #define CODEC_FLAG_PASS2 0x0400
701 #define CODEC_FLAG_GRAY 0x2000
702 #define CODEC_FLAG_EMU_EDGE 0x4000
703 #define CODEC_FLAG_PSNR 0x8000
704 #define CODEC_FLAG_TRUNCATED 0x00010000
706 #define CODEC_FLAG_NORMALIZE_AQP 0x00020000
707 #define CODEC_FLAG_INTERLACED_DCT 0x00040000
708 #define CODEC_FLAG_LOW_DELAY 0x00080000
709 #define CODEC_FLAG_GLOBAL_HEADER 0x00400000
710 #define CODEC_FLAG_BITEXACT 0x00800000
712 #define CODEC_FLAG_AC_PRED 0x01000000
713 #define CODEC_FLAG_LOOP_FILTER 0x00000800
714 #define CODEC_FLAG_INTERLACED_ME 0x20000000
715 #define CODEC_FLAG_CLOSED_GOP 0x80000000
716 #define CODEC_FLAG2_FAST 0x00000001
717 #define CODEC_FLAG2_NO_OUTPUT 0x00000004
718 #define CODEC_FLAG2_LOCAL_HEADER 0x00000008
719 #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000
720 #define CODEC_FLAG2_IGNORE_CROP 0x00010000
722 #if FF_API_MPV_GLOBAL_OPTS
723 #define CODEC_FLAG_CBP_RD 0x04000000
724 #define CODEC_FLAG_QP_RD 0x08000000
725 #define CODEC_FLAG2_STRICT_GOP 0x00000002
726 #define CODEC_FLAG2_SKIP_RD 0x00004000
728 #define CODEC_FLAG2_CHUNKS 0x00008000
729 #define CODEC_FLAG2_SHOW_ALL 0x00400000
738 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
744 #define CODEC_CAP_DR1 0x0002
745 #define CODEC_CAP_TRUNCATED 0x0008
747 #define CODEC_CAP_HWACCEL 0x0010
771 #define CODEC_CAP_DELAY 0x0020
776 #define CODEC_CAP_SMALL_LAST_FRAME 0x0040
780 #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 #define FF_BUFFER_TYPE_INTERNAL 1
896 #define FF_BUFFER_TYPE_USER 2
897 #define FF_BUFFER_TYPE_SHARED 4
898 #define FF_BUFFER_TYPE_COPY 8
900 #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
901 #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
902 #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
903 #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
1085 #define AV_PKT_FLAG_KEY 0x0001
1086 #define AV_PKT_FLAG_CORRUPT 0x0002
1117 #define AV_NUM_DATA_POINTERS 8
1494 #define FF_DECODE_ERROR_INVALID_BITSTREAM 1
1495 #define FF_DECODE_ERROR_MISSING_REFERENCE 2
1649 #define FF_COMPRESSION_DEFAULT -1
1744 #define FF_ASPECT_EXTENDED 15
1828 #define FF_RC_STRATEGY_XVID 1
1832 #if FF_API_MPV_GLOBAL_OPTS
1933 #define FF_PRED_LEFT 0
1934 #define FF_PRED_PLANE 1
1935 #define FF_PRED_MEDIAN 2
1977 #define FF_CMP_SAD 0
1978 #define FF_CMP_SSE 1
1979 #define FF_CMP_SATD 2
1980 #define FF_CMP_DCT 3
1981 #define FF_CMP_PSNR 4
1982 #define FF_CMP_BIT 5
1984 #define FF_CMP_ZERO 7
1985 #define FF_CMP_VSAD 8
1986 #define FF_CMP_VSSE 9
1987 #define FF_CMP_NSSE 10
1988 #define FF_CMP_W53 11
1989 #define FF_CMP_W97 12
1990 #define FF_CMP_DCTMAX 13
1991 #define FF_CMP_DCT264 14
1992 #define FF_CMP_CHROMA 256
2045 #define FF_DTG_AFD_SAME 8
2046 #define FF_DTG_AFD_4_3 9
2047 #define FF_DTG_AFD_16_9 10
2048 #define FF_DTG_AFD_14_9 11
2049 #define FF_DTG_AFD_4_3_SP_14_9 13
2050 #define FF_DTG_AFD_16_9_SP_14_9 14
2051 #define FF_DTG_AFD_SP_4_3 15
2068 #define FF_DEFAULT_QUANT_BIAS 999999
2077 #if FF_API_COLOR_TABLE_ID
2093 #define SLICE_FLAG_CODED_ORDER 0x0001
2094 #define SLICE_FLAG_ALLOW_FIELD 0x0002
2095 #define SLICE_FLAG_ALLOW_PLANE 0x0004
2110 #define FF_MB_DECISION_SIMPLE 0
2111 #define FF_MB_DECISION_BITS 1
2112 #define FF_MB_DECISION_RD 2
2143 #if FF_API_INTER_THRESHOLD
2150 #if FF_API_MPV_GLOBAL_OPTS
2377 #if FF_API_REQUEST_CHANNELS
2384 int request_channels;
2606 #define FF_CODER_TYPE_VLC 0
2607 #define FF_CODER_TYPE_AC 1
2608 #define FF_CODER_TYPE_RAW 2
2609 #define FF_CODER_TYPE_RLE 3
2610 #define FF_CODER_TYPE_DEFLATE 4
2746 #define FF_BUG_AUTODETECT 1
2747 #define FF_BUG_OLD_MSMPEG4 2
2748 #define FF_BUG_XVID_ILACE 4
2749 #define FF_BUG_UMP4 8
2750 #define FF_BUG_NO_PADDING 16
2751 #define FF_BUG_AMV 32
2752 #define FF_BUG_AC_VLC 0
2753 #define FF_BUG_QPEL_CHROMA 64
2754 #define FF_BUG_STD_QPEL 128
2755 #define FF_BUG_QPEL_CHROMA2 256
2756 #define FF_BUG_DIRECT_BLOCKSIZE 512
2757 #define FF_BUG_EDGE 1024
2758 #define FF_BUG_HPEL_CHROMA 2048
2759 #define FF_BUG_DC_CLIP 4096
2760 #define FF_BUG_MS 8192
2761 #define FF_BUG_TRUNCATED 16384
2776 #define FF_COMPLIANCE_VERY_STRICT 2
2777 #define FF_COMPLIANCE_STRICT 1
2778 #define FF_COMPLIANCE_NORMAL 0
2779 #define FF_COMPLIANCE_UNOFFICIAL -1
2780 #define FF_COMPLIANCE_EXPERIMENTAL -2
2788 #define FF_EC_GUESS_MVS 1
2789 #define FF_EC_DEBLOCK 2
2797 #define FF_DEBUG_PICT_INFO 1
2798 #define FF_DEBUG_RC 2
2799 #define FF_DEBUG_BITSTREAM 4
2800 #define FF_DEBUG_MB_TYPE 8
2801 #define FF_DEBUG_QP 16
2802 #define FF_DEBUG_MV 32
2803 #define FF_DEBUG_DCT_COEFF 0x00000040
2804 #define FF_DEBUG_SKIP 0x00000080
2805 #define FF_DEBUG_STARTCODE 0x00000100
2806 #define FF_DEBUG_PTS 0x00000200
2807 #define FF_DEBUG_ER 0x00000400
2808 #define FF_DEBUG_MMCO 0x00000800
2809 #define FF_DEBUG_BUGS 0x00001000
2810 #define FF_DEBUG_VIS_QP 0x00002000
2811 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
2812 #define FF_DEBUG_BUFFERS 0x00008000
2813 #define FF_DEBUG_THREADS 0x00010000
2821 #define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
2822 #define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
2823 #define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
2831 #define AV_EF_CRCCHECK (1<<0)
2832 #define AV_EF_BITSTREAM (1<<1)
2833 #define AV_EF_BUFFER (1<<2)
2834 #define AV_EF_EXPLODE (1<<3)
2836 #define AV_EF_CAREFUL (1<<16)
2837 #define AV_EF_COMPLIANT (1<<17)
2838 #define AV_EF_AGGRESSIVE (1<<18)
2882 #define FF_DCT_AUTO 0
2883 #define FF_DCT_FASTINT 1
2884 #define FF_DCT_INT 2
2885 #define FF_DCT_MMX 3
2886 #define FF_DCT_ALTIVEC 5
2887 #define FF_DCT_FAAN 6
2895 #define FF_IDCT_AUTO 0
2896 #define FF_IDCT_INT 1
2897 #define FF_IDCT_SIMPLE 2
2898 #define FF_IDCT_SIMPLEMMX 3
2899 #define FF_IDCT_LIBMPEG2MMX 4
2901 #define FF_IDCT_MMI 5
2903 #define FF_IDCT_ARM 7
2904 #define FF_IDCT_ALTIVEC 8
2905 #define FF_IDCT_SH4 9
2906 #define FF_IDCT_SIMPLEARM 10
2907 #define FF_IDCT_IPP 13
2908 #define FF_IDCT_XVIDMMX 14
2909 #define FF_IDCT_SIMPLEARMV5TE 16
2910 #define FF_IDCT_SIMPLEARMV6 17
2911 #define FF_IDCT_SIMPLEVIS 18
2912 #define FF_IDCT_FAAN 20
2913 #define FF_IDCT_SIMPLENEON 22
2914 #define FF_IDCT_SIMPLEALPHA 23
2916 #define FF_IDCT_H264 11
2917 #define FF_IDCT_VP3 12
2918 #define FF_IDCT_CAVS 15
2919 #define FF_IDCT_WMV2 19
2920 #define FF_IDCT_EA 21
2921 #define FF_IDCT_BINK 24
2977 #define FF_THREAD_FRAME 1
2978 #define FF_THREAD_SLICE 2
3049 #define FF_PROFILE_UNKNOWN -99
3050 #define FF_PROFILE_RESERVED -100
3052 #define FF_PROFILE_AAC_MAIN 0
3053 #define FF_PROFILE_AAC_LOW 1
3054 #define FF_PROFILE_AAC_SSR 2
3055 #define FF_PROFILE_AAC_LTP 3
3056 #define FF_PROFILE_AAC_HE 4
3057 #define FF_PROFILE_AAC_HE_V2 28
3058 #define FF_PROFILE_AAC_LD 22
3059 #define FF_PROFILE_AAC_ELD 38
3061 #define FF_PROFILE_DTS 20
3062 #define FF_PROFILE_DTS_ES 30
3063 #define FF_PROFILE_DTS_96_24 40
3064 #define FF_PROFILE_DTS_HD_HRA 50
3065 #define FF_PROFILE_DTS_HD_MA 60
3067 #define FF_PROFILE_MPEG2_422 0
3068 #define FF_PROFILE_MPEG2_HIGH 1
3069 #define FF_PROFILE_MPEG2_SS 2
3070 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
3071 #define FF_PROFILE_MPEG2_MAIN 4
3072 #define FF_PROFILE_MPEG2_SIMPLE 5
3074 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
3075 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
3077 #define FF_PROFILE_H264_BASELINE 66
3078 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
3079 #define FF_PROFILE_H264_MAIN 77
3080 #define FF_PROFILE_H264_EXTENDED 88
3081 #define FF_PROFILE_H264_HIGH 100
3082 #define FF_PROFILE_H264_HIGH_10 110
3083 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
3084 #define FF_PROFILE_H264_HIGH_422 122
3085 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
3086 #define FF_PROFILE_H264_HIGH_444 144
3087 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
3088 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
3089 #define FF_PROFILE_H264_CAVLC_444 44
3091 #define FF_PROFILE_VC1_SIMPLE 0
3092 #define FF_PROFILE_VC1_MAIN 1
3093 #define FF_PROFILE_VC1_COMPLEX 2
3094 #define FF_PROFILE_VC1_ADVANCED 3
3096 #define FF_PROFILE_MPEG4_SIMPLE 0
3097 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
3098 #define FF_PROFILE_MPEG4_CORE 2
3099 #define FF_PROFILE_MPEG4_MAIN 3
3100 #define FF_PROFILE_MPEG4_N_BIT 4
3101 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
3102 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
3103 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
3104 #define FF_PROFILE_MPEG4_HYBRID 8
3105 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
3106 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
3107 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
3108 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
3109 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
3110 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
3111 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
3119 #define FF_LEVEL_UNKNOWN -99
3226 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1
3227 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0
3228 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1
3264 const char *long_name;
3276 const uint64_t *channel_layouts;
3334 int *got_packet_ptr);
3472 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
3502 uint32_t start_display_time;
3503 uint32_t end_display_time;
3554 #if FF_API_ALLOC_CONTEXT
3680 #if FF_API_AVCODEC_OPEN
3939 #if FF_API_OLD_DECODE_AUDIO
3995 int *frame_size_ptr,
4033 int *got_frame_ptr,
const AVPacket *avpkt);
4077 int *got_picture_ptr,
4108 int64_t frame_offset;
4111 int64_t next_frame_offset;
4130 int fetch_timestamp;
4132 #define AV_PARSER_PTS_NB 4
4133 int cur_frame_start_index;
4139 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
4140 #define PARSER_FLAG_ONCE 0x0002
4142 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
4143 #define PARSER_FLAG_USE_CODEC_TS 0x1000
4173 int64_t convergence_duration;
4200 int dts_ref_dts_delta;
4247 const uint8_t **poutbuf,
int *poutbuf_size,
4289 uint8_t **poutbuf,
int *poutbuf_size,
4290 const uint8_t *buf,
int buf_size,
4291 int64_t pts, int64_t dts,
4300 uint8_t **poutbuf,
int *poutbuf_size,
4301 const uint8_t *buf,
int buf_size,
int keyframe);
4330 #if FF_API_OLD_ENCODE_AUDIO
4402 #if FF_API_OLD_ENCODE_VIDEO
4467 #if FF_API_AVCODEC_RESAMPLE
4475 struct ReSampleContext;
4476 struct AVResampleContext;
4478 typedef struct ReSampleContext ReSampleContext;
4497 ReSampleContext *av_audio_resample_init(
int output_channels,
int input_channels,
4498 int output_rate,
int input_rate,
4501 int filter_length,
int log2_phase_count,
4502 int linear,
double cutoff);
4505 int audio_resample(ReSampleContext *s,
short *output,
short *input,
int nb_samples);
4514 void audio_resample_close(ReSampleContext *s);
4527 struct AVResampleContext *av_resample_init(
int out_rate,
int in_rate,
int filter_length,
int log2_phase_count,
int linear,
double cutoff);
4539 int av_resample(
struct AVResampleContext *
c,
short *
dst,
short *src,
int *consumed,
int src_size,
int dst_size,
int update_ctx);
4555 void av_resample_compensate(
struct AVResampleContext *
c,
int sample_delta,
int compensation_distance);
4557 void av_resample_close(
struct AVResampleContext *
c);
4608 unsigned char *dest,
int dest_size);
4619 #if FF_API_DEINTERLACE
4645 int padtop,
int padbottom,
int padleft,
int padright,
int *
color);
4691 #define FF_LOSS_RESOLUTION 0x0001
4692 #define FF_LOSS_DEPTH 0x0002
4693 #define FF_LOSS_COLORSPACE 0x0004
4694 #define FF_LOSS_ALPHA 0x0008
4695 #define FF_LOSS_COLORQUANT 0x0010
4696 #define FF_LOSS_CHROMA 0x0020
4719 #if FF_API_FIND_BEST_PIX_FMT
4748 int has_alpha,
int *loss_ptr);
4770 int has_alpha,
int *loss_ptr);
4803 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4806 #if AV_HAVE_INCOMPATIBLE_FORK_ABI
4809 int has_alpha,
int *loss_ptr);
4812 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
4873 int buf_size,
int align);
4932 uint8_t **poutbuf,
int *poutbuf_size,
4942 uint8_t **poutbuf,
int *poutbuf_size,
4943 const uint8_t *buf,
int buf_size,
int keyframe);
4955 void *
av_fast_realloc(
void *ptr,
unsigned int *size,
size_t min_size);
4969 void av_fast_malloc(
void *ptr,
unsigned int *size,
size_t min_size);