?? codeccontext.h
字號:
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id: $ * * Copyright (C) 2005 Dave Chapman * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/#ifndef CODECCTX_H#define CODECCTX_H/** * external api header. 01/04/06 Marsdaddy <pajojo@gmail.com> */#ifdef __cplusplusextern "C" {#endifstruct AVCodec;enum CodecID { CODEC_ID_NONE, CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, /* prefered ID for MPEG Video 1 or 2 decoding */ CODEC_ID_MPEG2VIDEO_XVMC, CODEC_ID_H263, CODEC_ID_RV10, CODEC_ID_RV20, CODEC_ID_MP2, CODEC_ID_MP3, /* prefered ID for MPEG Audio layer 1, 2 or3 decoding */ CODEC_ID_VORBIS, CODEC_ID_AC3, CODEC_ID_MJPEG, CODEC_ID_MJPEGB, CODEC_ID_LJPEG, CODEC_ID_SP5X, CODEC_ID_MPEG4, CODEC_ID_RAWVIDEO, CODEC_ID_MSMPEG4V1, CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3, CODEC_ID_WMV1, CODEC_ID_WMV2, CODEC_ID_H263P, CODEC_ID_H263I, CODEC_ID_FLV1, CODEC_ID_SVQ1, CODEC_ID_SVQ3, CODEC_ID_DVVIDEO, CODEC_ID_DVAUDIO, CODEC_ID_WMAV1, CODEC_ID_WMAV2, CODEC_ID_MACE3, CODEC_ID_MACE6, CODEC_ID_HUFFYUV, CODEC_ID_CYUV, CODEC_ID_H264, CODEC_ID_INDEO3, CODEC_ID_VP3, CODEC_ID_THEORA, CODEC_ID_AAC, CODEC_ID_MPEG4AAC, CODEC_ID_ASV1, CODEC_ID_ASV2, CODEC_ID_FFV1, CODEC_ID_4XM, CODEC_ID_VCR1, CODEC_ID_CLJR, CODEC_ID_MDEC, CODEC_ID_ROQ, CODEC_ID_INTERPLAY_VIDEO, CODEC_ID_XAN_WC3, CODEC_ID_XAN_WC4, CODEC_ID_RPZA, CODEC_ID_CINEPAK, CODEC_ID_WS_VQA, CODEC_ID_MSRLE, CODEC_ID_MSVIDEO1, CODEC_ID_IDCIN, CODEC_ID_8BPS, CODEC_ID_SMC, CODEC_ID_FLIC, CODEC_ID_TRUEMOTION1, CODEC_ID_VMDVIDEO, CODEC_ID_VMDAUDIO, CODEC_ID_MSZH, CODEC_ID_ZLIB, CODEC_ID_QTRLE, /* various pcm "codecs" */ CODEC_ID_PCM_S16LE, CODEC_ID_PCM_S16BE, CODEC_ID_PCM_U16LE, CODEC_ID_PCM_U16BE, CODEC_ID_PCM_S8, CODEC_ID_PCM_U8, CODEC_ID_PCM_MULAW, CODEC_ID_PCM_ALAW, /* various adpcm codecs */ CODEC_ID_ADPCM_IMA_QT, CODEC_ID_ADPCM_IMA_WAV, CODEC_ID_ADPCM_IMA_DK3, CODEC_ID_ADPCM_IMA_DK4, CODEC_ID_ADPCM_IMA_WS, CODEC_ID_ADPCM_IMA_SMJPEG, CODEC_ID_ADPCM_MS, CODEC_ID_ADPCM_4XM, CODEC_ID_ADPCM_XA, CODEC_ID_ADPCM_ADX, CODEC_ID_ADPCM_EA, /* AMR */ CODEC_ID_AMR_NB, CODEC_ID_AMR_WB, /* RealAudio codecs*/ CODEC_ID_RA_144, CODEC_ID_RA_288, /* various DPCM codecs */ CODEC_ID_ROQ_DPCM, CODEC_ID_INTERPLAY_DPCM, CODEC_ID_XAN_DPCM, CODEC_ID_MPEG2TS, /* _FAKE_ codec to indicate a raw MPEG2 transport stream (only used by libavformat) */};enum CodecType { CODEC_TYPE_UNKNOWN = -1, CODEC_TYPE_VIDEO, CODEC_TYPE_AUDIO, CODEC_TYPE_DATA,};/** * main external api structure. */typedef struct CodecContext { /** * the average bitrate. * - encoding: set by user. unused for constant quantizer encoding * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream */ int bit_rate; int bits_per_sample; /** * 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 */ int bit_rate_tolerance; /** * CODEC_FLAG_*. * - encoding: set by user. * - decoding: set by user. */ int flags; /** * some codecs needs additionnal format info. It is stored here * - encoding: set by user. * - decoding: set by lavc. (FIXME is this ok?) */ int sub_id; /** * motion estimation algorithm used for video coding. * - encoding: MUST be set by user. * - decoding: unused */ int me_method; /** * 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) * - encoding: set/allocated/freed by lavc. * - decoding: set/allocated/freed by user. */ void *extradata; int extradata_size; /* video only */ /** * frames per sec multiplied by frame_rate_base. * for variable fps this is the precission, so if the timestamps * can be specified in msec precssion then this is 1000*frame_rate_base * - encoding: MUST be set by user * - decoding: set by lavc. 0 or the frame_rate if available */ int frame_rate; /** * width / height. * - encoding: MUST be set by user. * - decoding: set by user if known, codec should override / dynamically change if needed */ int width, height;#define FF_ASPECT_SQUARE 1#define FF_ASPECT_4_3_625 2#define FF_ASPECT_4_3_525 3#define FF_ASPECT_16_9_625 4#define FF_ASPECT_16_9_525 5#define FF_ASPECT_EXTENDED 15 /** * the number of pictures in a group of pitures, or 0 for intra_only. * - encoding: set by user. * - decoding: unused */ int gop_size; /** * 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. */ int rate_emu; /* audio only */ int sample_rate; ///< samples per sec int channels; int sample_fmt; ///< sample format, currenly unused /* the following data should not be initialized */ int frame_size; ///< in samples, initialized when calling 'init' int frame_number; ///< audio or video frame number int real_pict_num; ///< returns the real picture number of previous encoded frame struct AVCodec *codec; void *priv_data; // PJJ /* 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; int misc_bits; /** * number of bits used for the previously encoded frame. * - encoding: set by lavc * - decoding: unused */ int frame_bits; /** * private data of the user, can be used to carry app specific stuff. * - encoding: set by user * - decoding: set by user */ void *opaque; char codec_name[32]; 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 workaround some encoder bugs * - encoding: set by user, if not then the default based on codec_id will be used * - decoding: set by user, will be converted to upper case by lavc during init */ unsigned int codec_tag; /** * workaround bugs in encoders which sometimes cannot be detected automatically. * - encoding: unused * - decoding: set by user */ int workaround_bugs; int block_align; ///< used by some WAV based audio codecs int parse_only; /* - decoding only: if true, only parsing is done (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 */ int mpeg_quant; /** * pass1 encoding statistics output buffer. * - encoding: set by lavc * - 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 */ char *stats_in; int rc_override_count; /** * rate control equation. * - encoding: set by user
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -