Newer
Older
/* do its best to deliver a chunk with size */
/* below rtp_payload_size, the chunk will start */
/* with a start code on some codecs like H.263. */
/* This doesn't take account of any particular */
/* headers inside the transmitted RTP payload. */
/* The RTP callback: This function is called */
/* every time the encoder has a packet to send. */
/* It depends on the encoder if the data starts */
/* with a Start Code (it should). H.263 does. */
/* mb_nb contains the number of macroblocks */
/* encoded in the RTP payload. */
void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
/* statistics, used for 2-pass encoding */
int mv_bits;
int header_bits;
int i_tex_bits;
int p_tex_bits;
int i_count;
int p_count;
int skip_count;
* number of bits used for the previously encoded frame
* - encoding: Set by libavcodec.
* Private data of the user, can be used to carry app specific stuff.
* - encoding: Set by user.
* - decoding: Set by user.
*/
void *opaque;
enum CodecType codec_type; /* see CODEC_TYPE_xxx */
enum CodecID codec_id; /* see CODEC_ID_xxx */
/**
* fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
* This is used to work around some encoder bugs.
* A demuxer should set this to what is stored in the field used to identify the codec.
* If there are multiple such fields in a container then the demuxer should choose the one
* which maximizes the information about the used codec.
* If the codec tag field in a container is larger then 32 bits then the demuxer should
* remap the longer ID to 32 bits with a table or other structure. Alternatively a new
* extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
* first.
* - encoding: Set by user, if not then the default based on codec_id will be used.
* - decoding: Set by user, will be converted to uppercase by libavcodec during init.
* Work around bugs in encoders which sometimes cannot be detected automatically.
* - encoding: Set by user
* - decoding: Set by user
*/
int workaround_bugs;
#define FF_BUG_AUTODETECT 1 ///< autodetection
#define FF_BUG_OLD_MSMPEG4 2
#define FF_BUG_XVID_ILACE 4
#define FF_BUG_UMP4 8
#define FF_BUG_NO_PADDING 16
#define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default.
#define FF_BUG_DIRECT_BLOCKSIZE 512
#define FF_BUG_EDGE 1024
#define FF_BUG_HPEL_CHROMA 2048
#define FF_BUG_DC_CLIP 4096
#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
* luma single coefficient elimination threshold
* - encoding: Set by user.
* - decoding: unused
* chroma single coeff elimination threshold
* - encoding: Set by user.
* - decoding: unused
* strictly follow the standard (MPEG4, ...).
* - encoding: Set by user.
* - decoding: unused
*/
int strict_std_compliance;
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to a older more strict version of the spec or reference software.
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
Michael Niedermayer
committed
#define FF_COMPLIANCE_NORMAL 0
#define FF_COMPLIANCE_INOFFICIAL -1 ///< Allow inofficial extensions.
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
Michael Niedermayer
committed
* qscale offset between IP and B-frames
* If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
* If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
* - encoding: Set by user.
* - decoding: unused
*/
float b_quant_offset;
* Error resilience; higher values will detect more errors but may
* misdetect some more or less valid parts as errors.
* - encoding: unused
Michael Niedermayer
committed
#define FF_ER_COMPLIANT 2
#define FF_ER_AGGRESSIVE 3
#define FF_ER_VERY_AGGRESSIVE 4
/**
* Called at the beginning of each frame to get a buffer for it.
* If pic.reference is set then the frame will be read later by libavcodec.
* avcodec_align_dimensions() should be used to find the required width and
* height, as they normally need to be rounded up to the next multiple of 16.
* - encoding: unused
* - decoding: Set by libavcodec., user can override.
int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
* Called to release buffers which where allocated with get_buffer.
* A released buffer can be reused in get_buffer().
* pic.data[*] must be set to NULL.
* - encoding: unused
* - decoding: Set by libavcodec., user can override.
void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
* If 1 the stream has a 1 frame delay during decoding.
* - encoding: Set by libavcodec.
* - decoding: Set by libavcodec.
*/
int has_b_frames;
/**
* number of bytes per packet if constant and known or 0
*/
int block_align;
int parse_only; /* - decoding only: If true, only parsing is done
Fabrice Bellard
committed
(function avcodec_parse_frame()). The frame
data is returned. Only MPEG codecs support this now. */
* 0-> h263 quant 1-> mpeg quant
* - encoding: Set by user.
* - decoding: unused
* pass1 encoding statistics output buffer
* - encoding: Set by libavcodec.
* - decoding: unused
char *stats_out;
* pass2 encoding statistics input buffer
* Concatenated stuff from stats_out of pass1 should be placed here.
* - encoding: Allocated/set/freed by user.
* - decoding: unused
* ratecontrol qmin qmax limiting method
* 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
* - encoding: Set by user.
* - decoding: unused
* ratecontrol override, see RcOverride
* - encoding: Allocated/set/freed by user.
* - decoding: unused
RcOverride *rc_override;
int rc_override_count;
* rate control equation
* - encoding: Set by user
* - decoding: unused
* maximum bitrate
* - encoding: Set by user.
* - decoding: unused
* minimum bitrate
* - encoding: Set by user.
* - decoding: unused
* decoder bitstream buffer size
* - encoding: Set by user.
* - decoding: unused
int rc_buffer_size;
float rc_buffer_aggressivity;
* qscale factor between P and I-frames
* If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
* If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
* - encoding: Set by user.
* - decoding: unused
*/
float i_quant_factor;
* qscale offset between P and I-frames
* - encoding: Set by user.
* - decoding: unused
*/
float i_quant_offset;
* initial complexity for pass1 ratecontrol
* - encoding: Set by user.
* - decoding: unused
Fabrice Bellard
committed
* DCT algorithm, see FF_DCT_* below
* - encoding: Set by user.
* - decoding: unused
Michael Niedermayer
committed
int dct_algo;
Martin Olschewski
committed
#define FF_DCT_AUTO 0
Michael Niedermayer
committed
#define FF_DCT_FASTINT 1
Martin Olschewski
committed
#define FF_DCT_INT 2
#define FF_DCT_MMX 3
#define FF_DCT_MLIB 4
Michael Niedermayer
committed
#define FF_DCT_ALTIVEC 5
/**
* luminance masking (0-> disabled)
* - encoding: Set by user.
* - decoding: unused
*/
float lumi_masking;
/**
* temporary complexity masking (0-> disabled)
* - encoding: Set by user.
* - decoding: unused
*/
float temporal_cplx_masking;
/**
* spatial complexity masking (0-> disabled)
* - encoding: Set by user.
* - decoding: unused
*/
float spatial_cplx_masking;
/**
* p block masking (0-> disabled)
* - encoding: Set by user.
* - decoding: unused
*/
float p_masking;
* darkness masking (0-> disabled)
* - encoding: Set by user.
* - decoding: unused
*/
float dark_masking;
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
/* for binary compatibility */
int unused;
/**
* IDCT algorithm, see FF_IDCT_* below.
* - encoding: Set by user.
* - decoding: Set by user.
*/
int idct_algo;
#define FF_IDCT_AUTO 0
#define FF_IDCT_INT 1
#define FF_IDCT_SIMPLE 2
#define FF_IDCT_SIMPLEMMX 3
#define FF_IDCT_LIBMPEG2MMX 4
#define FF_IDCT_PS2 5
#define FF_IDCT_MLIB 6
#define FF_IDCT_ARM 7
#define FF_IDCT_ALTIVEC 8
#define FF_IDCT_SH4 9
#define FF_IDCT_SIMPLEARM 10
#define FF_IDCT_H264 11
#define FF_IDCT_VP3 12
#define FF_IDCT_IPP 13
#define FF_IDCT_XVIDMMX 14
#define FF_IDCT_CAVS 15
Michael Niedermayer
committed
/**
* slice count
* - encoding: Set by libavcodec.
* - decoding: Set by user (or 0).
Michael Niedermayer
committed
*/
int slice_count;
/**
* slice offsets in the frame in bytes
* - encoding: Set/allocated by libavcodec.
* - decoding: Set/allocated by user (or NULL).
Michael Niedermayer
committed
*/
int *slice_offset;
/**
* - encoding: unused
*/
int error_concealment;
#define FF_EC_GUESS_MVS 1
#define FF_EC_DEBLOCK 2
* dsp_mask could be add used to disable unwanted CPU features
* With the FORCE flag you may instead enable given CPU features.
* (Dangerous: Usable in case of misdetection, improper usage however will
* result into program crash.)
#define FF_MM_FORCE 0x80000000 /* Force usage of selected flags (OR) */
#define FF_MM_MMX 0x0001 ///< standard MMX
#define FF_MM_3DNOW 0x0004 ///< AMD 3DNOW
#define FF_MM_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
#define FF_MM_SSE 0x0008 ///< SSE functions
#define FF_MM_SSE2 0x0010 ///< PIV SSE2 functions
#define FF_MM_3DNOWEXT 0x0020 ///< AMD 3DNowExt
#define FF_MM_SSE3 0x0040 ///< Prescott SSE3 functions
#define FF_MM_SSSE3 0x0080 ///< Conroe SSSE3 functions
#define FF_MM_IWMMXT 0x0100 ///< XScale IWMMXT
* bits per sample/pixel from the demuxer (needed for huffyuv).
* - encoding: Set by libavcodec.
* - decoding: Set by user.
* prediction method (needed for huffyuv)
* - encoding: Set by user.
* - decoding: unused
*/
int prediction_method;
#define FF_PRED_LEFT 0
#define FF_PRED_PLANE 1
#define FF_PRED_MEDIAN 2
* sample aspect ratio (0 if unknown)
* Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
* - encoding: Set by user.
* - decoding: Set by libavcodec.
* the picture in the bitstream
* - encoding: Set by libavcodec.
* - decoding: Set by libavcodec.
* debug
* - encoding: Set by user.
* - decoding: Set by user.
#define FF_DEBUG_PICT_INFO 1
#define FF_DEBUG_RC 2
#define FF_DEBUG_BITSTREAM 4
#define FF_DEBUG_MB_TYPE 8
#define FF_DEBUG_QP 16
#define FF_DEBUG_MV 32
#define FF_DEBUG_DCT_COEFF 0x00000040
#define FF_DEBUG_SKIP 0x00000080
#define FF_DEBUG_STARTCODE 0x00000100
#define FF_DEBUG_PTS 0x00000200
#define FF_DEBUG_ER 0x00000400
#define FF_DEBUG_MMCO 0x00000800
#define FF_DEBUG_BUGS 0x00001000
#define FF_DEBUG_VIS_QP 0x00002000
#define FF_DEBUG_VIS_MB_TYPE 0x00004000
Wolfgang Hesseler
committed
/**
* debug
* - encoding: Set by user.
* - decoding: Set by user.
Wolfgang Hesseler
committed
*/
int debug_mv;
#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
* error
* - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
* - decoding: unused
*/
uint64_t error[4];
Michael Niedermayer
committed
* - encoding: unused
* - decoding: unused
Michael Niedermayer
committed
* - encoding: unused
* - decoding: unused
* motion estimation comparison function
* - encoding: Set by user.
* - decoding: unused
* subpixel motion estimation comparison function
* - encoding: Set by user.
* - decoding: unused
* macroblock comparison function (not supported yet)
* - encoding: Set by user.
* - decoding: unused
* interlaced DCT comparison function
* - encoding: Set by user.
* - decoding: unused
*/
int ildct_cmp;
#define FF_CMP_SAD 0
#define FF_CMP_SSE 1
#define FF_CMP_SATD 2
#define FF_CMP_DCT 3
#define FF_CMP_PSNR 4
#define FF_CMP_BIT 5
#define FF_CMP_RD 6
#define FF_CMP_ZERO 7
#define FF_CMP_VSAD 8
#define FF_CMP_VSSE 9
#define FF_CMP_NSSE 10
#define FF_CMP_W53 11
#define FF_CMP_W97 12
#define FF_CMP_DCT264 14
* ME diamond size & shape
* - encoding: Set by user.
* - decoding: unused
* amount of previous MV predictors (2a+1 x 2a+1 square)
* - encoding: Set by user.
* - decoding: unused
*/
int last_predictor_count;
* prepass for motion estimation
* - encoding: Set by user.
* - decoding: unused
* motion estimation prepass comparison function
* - encoding: Set by user.
* - decoding: unused
* ME prepass diamond size & shape
* - encoding: Set by user.
* - decoding: unused
* subpel ME quality
* - encoding: Set by user.
* - decoding: unused
* @param fmt is the list of formats which are supported by the codec,
* it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
* The first is always the native one.
* @return the chosen format
* - encoding: unused
* - decoding: Set by user, if not set the native format will be chosen.
enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
* DTG active format information (additional aspect ratio
* information only used in DVB MPEG-2 transport streams)
* 0 if not set.
* - encoding: unused
* - decoding: Set by decoder.
*/
int dtg_active_format;
#define FF_DTG_AFD_SAME 8
#define FF_DTG_AFD_4_3 9
#define FF_DTG_AFD_16_9 10
#define FF_DTG_AFD_14_9 11
#define FF_DTG_AFD_4_3_SP_14_9 13
#define FF_DTG_AFD_16_9_SP_14_9 14
#define FF_DTG_AFD_SP_4_3 15
* maximum motion estimation search range in subpel units
* If 0 then no limit.
* - encoding: Set by user.
* - decoding: unused
* intra quantizer bias
* - encoding: Set by user.
* - decoding: unused
*/
int intra_quant_bias;
#define FF_DEFAULT_QUANT_BIAS 999999
* inter quantizer bias
* - encoding: Set by user.
* - decoding: unused
*/
int inter_quant_bias;
* color table ID
* - encoding: unused
* - decoding: Which clrtable should be used for 8bit RGB images.
* Tables have to be stored somewhere. FIXME
* internal_buffer count
* Don't touch, used by libavcodec default_get_buffer().
*/
int internal_buffer_count;
* internal_buffers
* Don't touch, used by libavcodec default_get_buffer().
*/
void *internal_buffer;
Michael Niedermayer
committed
#define FF_LAMBDA_SHIFT 7
#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
#define FF_LAMBDA_MAX (256*128-1)
#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
* Global quality for codecs which cannot change it per frame.
* This should be proportional to MPEG-1/2/4 qscale.
* - encoding: Set by user.
#define FF_CODER_TYPE_VLC 0
#define FF_CODER_TYPE_AC 1
#define FF_CODER_TYPE_RAW 2
#define FF_CODER_TYPE_RLE 3
#define FF_CODER_TYPE_DEFLATE 4
* - decoding: unused
*/
int coder_type;
/**
* context model
* - decoding: unused
*/
int context_model;
#if 0
/**
*
* - encoding: unused
*/
uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
#endif
/**
* slice flags
* - encoding: unused
*/
int slice_flags;
#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
/**
* XVideo Motion Acceleration
* - encoding: forbidden
* - decoding: set by decoder
*/
int xvmc_acceleration;
/**
* macroblock decision mode
* - decoding: unused
*/
int mb_decision;
#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
#define FF_MB_DECISION_RD 2 ///< rate distoration
/**
* custom intra quantization matrix
* - encoding: Set by user, can be NULL.
* - decoding: Set by libavcodec.
*/
uint16_t *intra_matrix;
/**
* custom inter quantization matrix
* - encoding: Set by user, can be NULL.
* - decoding: Set by libavcodec.
*/
uint16_t *inter_matrix;
/**
* fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
* This is used to work around some encoder bugs.
* - encoding: unused
* - decoding: Set by user, will be converted to uppercase by libavcodec during init.
*/
unsigned int stream_codec_tag;
* scene change detection threshold
* 0 is default, larger means fewer detected scene changes.
* - encoding: Set by user.
* - decoding: unused
*/
int scenechange_threshold;
Michael Niedermayer
committed
/**
* minimum Lagrange multipler
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int lmin;
/**
* maximum Lagrange multipler
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int lmax;
/**
* - encoding: ??? (no palette-enabled encoder yet)
*/
struct AVPaletteControl *palctrl;
/**
* noise reduction strength
* - decoding: unused
*/
int noise_reduction;
* Called at the beginning of a frame to get cr buffer for it.
* Buffer type (size, hints) must be the same. libavcodec won't check it.
* libavcodec will pass previous buffer in pic, function should return
* same buffer or new buffer with old frame "painted" into it.
* If pic.data[0] == NULL must behave like get_buffer().
* - decoding: Set by libavcodec., user can override
int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
* Number of bits which should be loaded into the rc buffer before decoding starts.
* - encoding: Set by user.
* - decoding: unused
*/
int rc_initial_buffer_occupancy;
/**
*
* - decoding: unused
*/
int inter_threshold;
/**
* CODEC_FLAG2_*
* - encoding: Set by user.
* - decoding: Set by user.
* Simulates errors in the bitstream to test error concealment.
* - encoding: Set by user.
* - decoding: unused
Michael Niedermayer
committed
/**
* MP3 antialias algorithm, see FF_AA_* below.
* - encoding: unused
Michael Niedermayer
committed
*/
int antialias_algo;
#define FF_AA_AUTO 0
#define FF_AA_FASTINT 1 //not implemented yet
#define FF_AA_INT 2
#define FF_AA_FLOAT 3
* quantizer noise shaping
* - encoding: Set by user.
* - decoding: unused
*/
int quantizer_noise_shaping;
* is used to decide how many independent tasks should be passed to execute()
* - encoding: Set by user.
* - decoding: Set by user.
* The codec may call this to execute several independent things.
* It will return only after finishing all tasks.
* The user may replace this with some multithreaded implementation,
* the default implementation will execute the parts serially.
* @param count the number of things to execute
* - encoding: Set by libavcodec, user can override.
* - decoding: Set by libavcodec, user can override.
*/
int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
* thread opaque
* Can be used by execute() to store some per AVCodecContext stuff.
* - encoding: set by execute()
* - decoding: set by execute()
*/
void *thread_opaque;
Michael Niedermayer
committed
/**
* Motion estimation threshold below which no motion estimation is
* performed, but instead the user specified motion vectors are used.
Michael Niedermayer
committed
* - decoding: unused
Michael Niedermayer
committed
*/
Michael Niedermayer
committed
/**
* Macroblock threshold below which the user specified macroblock types will be used.
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int mb_threshold;
* precision of the intra DC coefficient - 8
* - encoding: Set by user.
* - decoding: unused
*/
int intra_dc_precision;
* noise vs. sse weight for the nsse comparsion function
* - encoding: Set by user.
* Number of macroblock rows at the top which are skipped.
*/
int skip_top;
/**
* Number of macroblock rows at the bottom which are skipped.
*/
int skip_bottom;
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int profile;
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_AAC_MAIN 0
#define FF_PROFILE_AAC_LOW 1
#define FF_PROFILE_AAC_SSR 2
#define FF_PROFILE_AAC_LTP 3
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int level;
#define FF_LEVEL_UNKNOWN -99
* low resolution decoding, 1-> 1/2 size, 2->1/4 size
* Bitstream width / height, may be different from width/height if lowres
* or other things are used.
* - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
*/
int coded_width, coded_height;
* - decoding: unused
*/
int frame_skip_threshold;
/**
* frame skip factor
* - decoding: unused
*/
int frame_skip_factor;
/**
* frame skip exponent
* - decoding: unused
*/
int frame_skip_exp;
/**
* frame skip comparison function
* - encoding: Set by user.
* - decoding: unused
*/
int frame_skip_cmp;
Christophe Massiot
committed
/**
* Border processing masking, raises the quantizer for mbs on the borders
Christophe Massiot
committed
* of the picture.
Christophe Massiot
committed
* - decoding: unused
*/
float border_masking;
Michael Niedermayer
committed
/**
* minimum MB lagrange multipler
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int mb_lmin;
/**
* maximum MB lagrange multipler
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int mb_lmax;
* - decoding: unused
*/
int me_penalty_compensation;
* - decoding: unused
*/
int bidir_refine;
/**
*
* - decoding: unused