AVCodecContext Struct Reference

#include <avcodec.h>

Collaboration diagram for AVCodecContext:

Collaboration graph
[legend]

Data Fields

AVClassav_class
int bit_rate
int bit_rate_tolerance
int flags
int sub_id
int me_method
void * extradata
int extradata_size
AVRational time_base
int width
int height
int gop_size
enum PixelFormat pix_fmt
int rate_emu
void(* draw_horiz_band )(struct AVCodecContext *s, const AVFrame *src, int offset[4], int y, int type, int height)
int sample_rate
 samples per sec
int channels
enum SampleFormat sample_fmt
 sample format, currenly unused
int frame_size
int frame_number
 audio or video frame number
int real_pict_num
 returns the real picture number of previous encoded frame
int delay
float qcompress
 amount of qscale change between easy & hard scenes (0.0-1.0)
float qblur
 amount of qscale smoothing over time (0.0-1.0)
int qmin
int qmax
int max_qdiff
int max_b_frames
float b_quant_factor
int rc_strategy
int b_frame_strategy
int hurry_up
struct AVCodeccodec
void * priv_data
int rtp_mode
int rtp_payload_size
void(* rtp_callback )(struct AVCodecContext *avctx, void *data, int size, int mb_nb)
int mv_bits
int header_bits
int i_tex_bits
int p_tex_bits
int i_count
int p_count
int skip_count
int misc_bits
int frame_bits
void * opaque
char codec_name [32]
enum CodecType codec_type
enum CodecID codec_id
unsigned int codec_tag
int workaround_bugs
int luma_elim_threshold
int chroma_elim_threshold
int strict_std_compliance
float b_quant_offset
int error_resilience
int(* get_buffer )(struct AVCodecContext *c, AVFrame *pic)
void(* release_buffer )(struct AVCodecContext *c, AVFrame *pic)
int has_b_frames
int block_align
int parse_only
int mpeg_quant
char * stats_out
char * stats_in
float rc_qsquish
float rc_qmod_amp
int rc_qmod_freq
RcOverriderc_override
int rc_override_count
char * rc_eq
int rc_max_rate
int rc_min_rate
int rc_buffer_size
float rc_buffer_aggressivity
float i_quant_factor
float i_quant_offset
float rc_initial_cplx
int dct_algo
float lumi_masking
float temporal_cplx_masking
float spatial_cplx_masking
float p_masking
float dark_masking
int unused
int idct_algo
int slice_count
int * slice_offset
int error_concealment
unsigned dsp_mask
int bits_per_sample
int prediction_method
AVRational sample_aspect_ratio
AVFramecoded_frame
int debug
int debug_mv
uint64_t error [4]
int mb_qmin
int mb_qmax
int me_cmp
int me_sub_cmp
int mb_cmp
int ildct_cmp
int dia_size
int last_predictor_count
int pre_me
int me_pre_cmp
int pre_dia_size
int me_subpel_quality
enum PixelFormat(* get_format )(struct AVCodecContext *s, const enum PixelFormat *fmt)
int dtg_active_format
int me_range
int intra_quant_bias
int inter_quant_bias
int color_table_id
int internal_buffer_count
void * internal_buffer
int global_quality
int coder_type
int context_model
int slice_flags
int xvmc_acceleration
int mb_decision
uint16_t * intra_matrix
uint16_t * inter_matrix
unsigned int stream_codec_tag
int scenechange_threshold
int lmin
int lmax
struct AVPaletteControlpalctrl
int noise_reduction
int(* reget_buffer )(struct AVCodecContext *c, AVFrame *pic)
int rc_initial_buffer_occupancy
int inter_threshold
int flags2
int error_rate
int antialias_algo
int quantizer_noise_shaping
int thread_count
int(* execute )(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count)
void * thread_opaque
int me_threshold
int mb_threshold
int intra_dc_precision
int nsse_weight
int skip_top
int skip_bottom
int profile
int level
int lowres
int coded_width
int coded_height
int frame_skip_threshold
int frame_skip_factor
int frame_skip_exp
int frame_skip_cmp
float border_masking
int mb_lmin
int mb_lmax
int me_penalty_compensation
enum AVDiscard skip_loop_filter
enum AVDiscard skip_idct
enum AVDiscard skip_frame

Detailed Description

main external api structure.

Definition at line 562 of file avcodec.h.


Field Documentation

Info on struct for av_log

  • set by avcodec_alloc_context

Definition at line 567 of file avcodec.h.

Referenced by avcodec_get_context_defaults().

number of bits the bitstream is allowed to diverge from the reference. the reference can be CBR (for CBR pass1) or VBR (for pass2)

  • encoding: set by user. unused for constant quantizer encoding
  • decoding: unused

Definition at line 581 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), encode(), ff_rate_estimate_qscale(), new_video_stream(), and parse_ffconfig().

some codecs needs additionnal format info. It is stored here

  • encoding: set by user.
  • decoding: set by lavc. (FIXME is this ok?)

Definition at line 595 of file avcodec.h.

Referenced by avcodec_string(), decode_frame(), decode_frame_adu(), dvbsub_init_decoder(), mpa_decode_header(), mpeg1_decode_sequence(), mpeg_decode_postinit(), mpeg_decode_sequence_extension(), mpegvideo_extract_headers(), rv10_decode_init(), rv20_decode_picture_header(), and vcr2_init_sequence().

motion estimation algorithm used for video coding.

  • encoding: MUST be set by user.
  • decoding: unused

Definition at line 602 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), encode(), encode_frame(), ff_xvid_encode_init(), and new_video_stream().

some codecs need / can use extra-data like huffman tables. mjpeg: huffman tables rv10: additional flags mpeg4: global headers (they can be in the bitstream or here) the allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then extradata_size to avoid prolems if its read with the bitstream reader

  • encoding: set/allocated/freed by lavc.
  • decoding: set/allocated/freed by user.

Definition at line 614 of file avcodec.h.

Referenced by alac_set_info(), av_encode(), av_mpeg4_decode_header(), av_parser_change(), decode_ext_header(), decode_frame(), decode_init(), decode_init_mp3on4(), encode_end(), encode_init(), Faac_encode_init(), faac_init_mp4(), ff_h263_decode_frame(), ff_xvid_encode_close(), ff_xvid_encode_init(), flac_decode_init(), flic_decode_init(), idcin_decode_init(), mjpeg_decode_init(), oggvorbis_decode_init(), oggvorbis_encode_close(), oggvorbis_encode_init(), quicktime_new_ffmpeg(), ra288_decode_frame(), rv10_decode_init(), rv20_decode_picture_header(), sonic_decode_init(), svq3_decode_frame(), theora_decode_init(), Theora_decode_init(), vc9_decode_init(), vmdvideo_decode_init(), vorbis_decode_init(), vqa_decode_init(), wma_decode_init(), and xvid_strip_vol_header().

picture width / height.

  • encoding: MUST be set by user.
  • decoding: set by lavc. Note, for compatibility its possible to set this instead of coded_width/height before decoding

Definition at line 632 of file avcodec.h.

Referenced by aasc_decode_frame(), add_av_stream(), add_codec(), add_video_stream(), alloc_blocks(), av_encode(), avcodec_default_get_buffer(), avcodec_default_reget_buffer(), avcodec_encode_video(), avcodec_open(), avcodec_set_dimensions(), avcodec_string(), cinepak_decode(), cinepak_decode_init(), common_init(), cyuv_decode_init(), decode(), decode_frame(), decode_i_frame(), decode_init(), decode_p_frame(), decode_slice_header(), do_video_out(), do_video_stats(), dv_codec_profile(), dvvideo_decode_frame(), encode(), encode_frame(), encode_init(), ff_print_debug_info(), ff_xvid_encode_init(), find_stream_in_feed(), flic_decode_frame(), frame_start(), idcin_decode_vlcs(), indeo3_decode_init(), init_codec(), ipvideo_decode_init(), ipvideo_decode_opcodes(), ir2_decode_frame(), msrle_decode_pal4(), msvideo1_decode_16bit(), msvideo1_decode_8bit(), new_video_stream(), open_video(), opt_input_file(), pam_encode_frame(), parse_ffconfig(), pnm_decode_frame(), pnm_decode_header(), pnm_encode_frame(), pnm_parse(), pre_process_video_frame(), prepare_grab(), print_report(), quicktime_ffmpeg_decode(), quicktime_new_ffmpeg(), raw_decode(), raw_encode(), raw_init_decoder(), roqvideo_decode_frame(), rpza_decode_stream(), rv10_decode_init(), smc_decode_stream(), sp5x_decode_frame(), svq1_decode_init(), svq3_decode_frame(), theora_decode_header(), Theora_decode_init(), truemotion1_decode_16bit(), truemotion1_decode_24bit(), truemotion1_decode_header(), truemotion1_decode_init(), ulti_decode_init(), vc9_decode_frame(), vc9_decode_init(), video_decode_example(), video_encode_example(), vmd_decode(), vp3_decode_init(), write_video_frame(), X264_init(), xan_decode_init(), xan_wc3_copy_pixel_run(), xan_wc3_decode_frame(), and xan_wc3_output_pixel_run().

Definition at line 632 of file avcodec.h.

Referenced by aasc_decode_frame(), add_av_stream(), add_codec(), add_video_stream(), alloc_blocks(), av_encode(), avcodec_default_get_buffer(), avcodec_default_reget_buffer(), avcodec_encode_video(), avcodec_open(), avcodec_set_dimensions(), avcodec_string(), cinepak_decode_init(), common_init(), cyuv_decode_init(), decode(), decode_frame(), decode_i_frame(), decode_init(), decode_p_frame(), decode_slice_header(), do_video_out(), do_video_stats(), dv_codec_profile(), dvvideo_decode_frame(), encode(), encode_frame(), encode_init(), ff_draw_horiz_band(), ff_print_debug_info(), ff_xvid_encode_init(), find_stream_in_feed(), flic_decode_frame(), flip(), frame_start(), idcin_decode_vlcs(), indeo3_decode_init(), init_codec(), ipvideo_decode_init(), ipvideo_decode_opcodes(), ir2_decode_frame(), mjpeg_decode_sof(), msrle_decode_pal4(), msrle_decode_pal8(), msvideo1_decode_16bit(), msvideo1_decode_8bit(), new_video_stream(), open_video(), opt_input_file(), pam_encode_frame(), parse_ffconfig(), pnm_decode_frame(), pnm_decode_header(), pnm_encode_frame(), pnm_parse(), pre_process_video_frame(), prepare_grab(), print_report(), qtrle_decode_16bpp(), qtrle_decode_24bpp(), qtrle_decode_32bpp(), qtrle_decode_4bpp(), qtrle_decode_8bpp(), quicktime_ffmpeg_decode(), quicktime_new_ffmpeg(), raw_decode(), raw_encode(), raw_init_decoder(), roqvideo_decode_frame(), rpza_decode_stream(), rv10_decode_init(), smc_decode_stream(), sp5x_decode_frame(), svq1_decode_init(), svq3_decode_frame(), theora_decode_header(), Theora_decode_init(), truemotion1_decode_16bit(), truemotion1_decode_24bit(), truemotion1_decode_frame(), truemotion1_decode_header(), ulti_decode_init(), vc9_decode_frame(), vc9_decode_init(), video_decode_example(), video_encode_example(), vmd_decode(), vp3_decode_init(), write_video_frame(), X264_init(), xan_decode_init(), and xan_wc3_decode_frame().

the number of pictures in a group of pitures, or 0 for intra_only.

  • encoding: set by user.
  • decoding: unused

Definition at line 641 of file avcodec.h.

Referenced by add_av_stream(), add_video_stream(), avcodec_get_context_defaults(), encode(), encode_frame(), ff_xvid_encode_init(), new_video_stream(), parse_ffconfig(), video_encode_example(), and X264_init().

pixel format, see PIX_FMT_xxx.

  • encoding: set by user.
  • decoding: set by lavc.

Definition at line 648 of file avcodec.h.

Referenced by aasc_decode_init(), add_video_stream(), avcodec_align_dimensions(), avcodec_default_get_buffer(), avcodec_default_reget_buffer(), avcodec_get_context_defaults(), avcodec_string(), cinepak_decode_init(), cyuv_decode_init(), decode(), FFMPEG::decode(), decode_frame(), decode_init(), do_video_out(), dvvideo_decode_frame(), dvvideo_encode_frame(), dvvideo_init(), encode(), encode_frame(), encode_init(), ff_h263_decode_init(), ff_print_debug_info(), ff_xvid_encode_frame(), flic_decode_init(), get_chroma_factor(), h261_decode_init(), idcin_decode_init(), indeo3_decode_init(), ipvideo_decode_init(), ir2_decode_init(), mjpeg_decode_sof(), MPV_common_init(), msrle_decode_init(), msvideo1_decode_8bit(), msvideo1_decode_init(), new_video_stream(), open_video(), opt_input_file(), pam_encode_frame(), pnm_decode_frame(), pnm_decode_header(), pnm_encode_frame(), pnm_parse(), pre_process_video_frame(), qtrle_decode_init(), quicktime_ffmpeg_decode(), raw_decode(), raw_encode(), raw_init_decoder(), raw_init_encoder(), read_header(), roq_decode_init(), rpza_decode_init(), rv10_decode_init(), smc_decode_init(), sp5x_decode_frame(), svq1_decode_init(), Theora_decode_init(), truemotion1_decode_header(), ulti_decode_init(), vc9_decode_frame(), vc9_decode_init(), vcr2_init_sequence(), video_encode_example(), vmdvideo_decode_init(), vp3_decode_init(), vqa_decode_init(), write_video_frame(), xan_decode_frame(), xan_decode_init(), xan_wc3_build_palette(), xan_wc3_copy_pixel_run(), xan_wc3_decode_frame(), and xan_wc3_output_pixel_run().

Frame rate emulation. If not zero lower layer (i.e. format handler) has to read frames at native frame rate.

  • encoding: set by user.
  • decoding: unused.

Definition at line 656 of file avcodec.h.

Referenced by opt_input_file().

void(* AVCodecContext::draw_horiz_band)(struct AVCodecContext *s, const AVFrame *src, int offset[4], int y, int type, int height)

if non NULL, 'draw_horiz_band' is called by the libavcodec decoder to draw an horizontal band. It improve cache usage. Not all codecs can do that. You must check the codec capabilities before

  • encoding: unused
  • decoding: set by user.
    Parameters:
    height the height of the slice
    y the y position of the slice
    type 1->top field, 2->bottom field, 3->frame
    offset offset into the AVFrame.data from which the slice should be read

Referenced by draw_slice(), ff_draw_horiz_band(), ff_init_block_index(), and MPV_decode_mb_internal().

sample format, currenly unused

audio sample format.

  • encoding: set by user.
  • decoding: set by lavc.

Definition at line 683 of file avcodec.h.

Referenced by decode_init().

returns the real picture number of previous encoded frame

Definition at line 691 of file avcodec.h.

number of frames the decoded output will be delayed relative to the encoded input.

  • encoding: set by lavc.
  • decoding: unused

Definition at line 699 of file avcodec.h.

amount of qscale change between easy & hard scenes (0.0-1.0)

Definition at line 702 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), encode(), get_qscale(), and new_video_stream().

amount of qscale smoothing over time (0.0-1.0)

Definition at line 703 of file avcodec.h.

Referenced by add_codec(), encode(), ff_rate_estimate_qscale(), init_pass2(), and new_video_stream().

minimum quantizer.

  • encoding: set by user.
  • decoding: unused

Definition at line 710 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), avcodec_string(), encode(), ff_xvid_encode_init(), new_video_stream(), parse_ffconfig(), and X264_init().

maximum quantizer.

  • encoding: set by user.
  • decoding: unused

Definition at line 717 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), avcodec_string(), encode(), ff_xvid_encode_init(), new_video_stream(), parse_ffconfig(), and X264_init().

maximum quantizer difference etween frames.

  • encoding: set by user.
  • decoding: unused

Definition at line 724 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), encode(), get_diff_limited_q(), new_video_stream(), parse_ffconfig(), and X264_init().

maximum number of b frames between non b frames. note: the output will be delayed by max_b_frames+1 relative to the input

  • encoding: set by user.
  • decoding: unused

Definition at line 732 of file avcodec.h.

Referenced by add_video_stream(), decode_sequence_header(), ff_xvid_encode_init(), new_video_stream(), standard_decode_picture_primary_header(), vc9_decode_init(), video_encode_example(), and X264_init().

qscale factor between ip and b frames.

  • encoding: set by user.
  • decoding: unused

Definition at line 739 of file avcodec.h.

Referenced by add_codec(), avcodec_get_context_defaults(), encode(), ff_xvid_encode_init(), get_diff_limited_q(), get_qminmax(), get_qscale(), init_pass2(), and new_video_stream().

obsolete FIXME remove

Definition at line 742 of file avcodec.h.

Definition at line 743 of file avcodec.h.

Referenced by new_video_stream().

hurry up amount. deprecated in favor of skip_idct and skip_frame

  • encoding: unused
  • decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header

Definition at line 751 of file avcodec.h.

Referenced by ff_h263_decode_frame(), h261_decode_frame(), mpeg_decode_frame(), svq1_decode_frame(), svq3_decode_frame(), and vc9_decode_frame().

Definition at line 755 of file avcodec.h.

Referenced by a52_decode_end(), a52_decode_frame(), a52_decode_init(), aasc_decode_end(), aasc_decode_frame(), aasc_decode_init(), ac3_decode_frame(), ac3_decode_init(), AC3_encode_frame(), AC3_encode_init(), adpcm_decode_frame(), adpcm_decode_init(), adx_decode_frame(), adx_decode_init(), alac_decode_close(), alac_decode_frame(), alac_decode_init(), amr_nb_decode_close(), amr_nb_decode_frame(), amr_nb_decode_init(), amr_nb_encode_close(), amr_nb_encode_frame(), amr_nb_encode_init(), avcodec_close(), avcodec_open(), cinepak_decode_end(), cinepak_decode_frame(), cinepak_decode_init(), common_init(), cyuv_decode_frame(), cyuv_decode_init(), decode_block(), decode_close_mp3on4(), decode_end(), decode_frame(), decode_frame_adu(), decode_frame_mp3on4(), decode_init(), decode_init_mp3on4(), decode_sequence_header(), dpcm_decode_frame(), dpcm_decode_init(), dts_decode_frame(), dts_decode_init(), dv_decode_mt(), dv_encode_mt(), dvbsub_close_decoder(), dvbsub_decode(), dvbsub_display_end_segment(), dvbsub_encode(), dvbsub_init_decoder(), dvbsub_parse_clut_segment(), dvbsub_parse_object_segment(), dvbsub_parse_page_segment(), dvbsub_parse_pixel_data_block(), dvbsub_parse_region_segment(), dvvideo_decode_frame(), dvvideo_encode_frame(), dvvideo_init(), encode_end(), encode_frame(), encode_init(), faac_decode_end(), faac_decode_frame(), faac_decode_init(), Faac_encode_close(), Faac_encode_frame(), Faac_encode_init(), faac_init_mp4(), ff_h263_decode_end(), ff_h263_decode_frame(), ff_h263_decode_init(), ff_mpeg_flush(), ff_xvid_encode_close(), ff_xvid_encode_frame(), ff_xvid_encode_init(), flac_decode_close(), flac_decode_frame(), flac_decode_init(), flac_flush(), flic_decode_end(), flic_decode_frame(), flic_decode_init(), flush_dpb(), g726_decode_frame(), g726_encode_frame(), g726_init(),