--- trunk/xvidcore/vfw/src/config.h 2004/07/11 08:54:38 1487 +++ trunk/xvidcore/vfw/src/config.h 2010/12/21 20:23:07 1915 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - VFW configuration header - * - * Copyright(C) 2002-2003 Anonymous + * Copyright(C) Peter Ross * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +19,10 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: config.h,v 1.3 2004-07-11 08:54:37 syskin Exp $ + * $Id: config.h,v 1.16 2010-12-21 20:23:07 Isibaar Exp $ * ****************************************************************************/ + #ifndef _CONFIG_H_ #define _CONFIG_H_ @@ -42,7 +43,7 @@ /* min/max bitrate when not specified by profile */ #define DEFAULT_MIN_KBPS 16 -#define DEFAULT_MAX_KBPS 10000 +#define DEFAULT_MAX_KBPS 20480 #define DEFAULT_QUANT 400 /* registry stuff */ @@ -53,19 +54,19 @@ #define XVID_BUILD __TIME__ ", " __DATE__ #define XVID_WEBSITE "http://www.xvid.org/" -#define XVID_SPECIAL_BUILD "(Vanilla CVS Build)" +#define XVID_SPECIAL_BUILD "Vanilla CVS Build" /* constants */ -#define CONFIG_2PASS_FILE "\\video.pass" +#define CONFIG_2PASS_FILE ".\\video.pass" /* codec modes */ -#define RC_MODE_1PASS 0 -#define RC_MODE_2PASS1 1 -#define RC_MODE_2PASS2 2 -#define RC_MODE_NULL 3 +#define RC_MODE_1PASS 0 +#define RC_MODE_2PASS1 1 +#define RC_MODE_2PASS2 2 +#define RC_MODE_NULL 3 -#define RC_ZONE_WEIGHT 0 -#define RC_ZONE_QUANT 1 +#define RC_ZONE_WEIGHT 0 +#define RC_ZONE_QUANT 1 /* vhq modes */ #define VHQ_OFF 0 @@ -93,9 +94,37 @@ unsigned int greyscale; unsigned int chroma_opt; unsigned int bvop_threshold; + unsigned int cartoon_mode; } zone_t; +/* this structure represents a quality preset. it encapsulates + options from the motion and quantizer config pages. */ +#define QUALITY_GENERAL_STRING "General purpose" +#define QUALITY_USER_STRING "(User defined)" +typedef struct { + char * name; + /* motion */ + int motion_search; + int vhq_mode; + int vhq_metric; + int vhq_bframe; + int chromame; + int turbo; + int max_key_interval; + int frame_drop_ratio; + + /* quant */ + int min_iquant; + int max_iquant; + int min_pquant; + int max_pquant; + int min_bquant; + int max_bquant; + int trellis_quant; +} quality_t; + + typedef struct { /********** ATTENTION **********/ @@ -111,6 +140,10 @@ char profile_name[MAX_PATH]; int profile; /* used internally; *not* written to registry */ + /* quality preset */ + char quality_name[MAX_PATH]; + int quality; /* used internally; *not* written to registry */ + int quant_type; BYTE qmatrix_intra[64]; BYTE qmatrix_inter[64]; @@ -119,13 +152,11 @@ int tff; int qpel; int gmc; - int reduced_resolution; int use_bvop; int max_bframes; int bquant_ratio; int bquant_offset; int packed; - int closed_gov; int display_aspect_ratio; /* aspect ratio */ int ar_x, ar_y; /* picture aspect ratio */ int par_x, par_y; /* custom pixel aspect ratio */ @@ -167,23 +198,8 @@ int audio_rate; int audio_size; - /* motion */ - int motion_search; - int vhq_mode; - int chromame; - int cartoon_mode; - int turbo; - int max_key_interval; - int frame_drop_ratio; - - /* quant */ - int min_iquant; - int max_iquant; - int min_pquant; - int max_pquant; - int min_bquant; - int max_bquant; - int trellis_quant; + /* user defined quality settings */ + quality_t quality_user; /* debug */ int num_threads; @@ -195,6 +211,8 @@ DWORD cpu; + int num_slices; + /* internal */ int ci_valid; VFWEXT_CONFIGURE_INFO_T ci; @@ -229,10 +247,10 @@ #define PROFILE_INTERLACE 0x00000008 #define PROFILE_QPEL 0x00000010 #define PROFILE_GMC 0x00000020 -#define PROFILE_REDUCED 0x00000040 /* dynamic resolution conversion */ - -#define PROFILE_AS (PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_MPEGQUANT|PROFILE_INTERLACE|PROFILE_QPEL|PROFILE_GMC) -#define PROFILE_ARTS (PROFILE_ADAPTQUANT|PROFILE_REDUCED) +#define PROFILE_4MV 0x00000040 +#define PROFILE_PACKED 0x00000080 +#define PROFILE_EXTRA 0x00000100 +#define PROFILE_XVID 0x00000200 static const int PARS[][2] = { {1, 1}, @@ -249,6 +267,7 @@ typedef struct { char * name; + char * short_name; int id; /* mpeg-4 profile id; iso/iec 14496-2:2001 table G-1 */ int width; int height; @@ -256,24 +275,29 @@ int max_objects; int total_vmv_buffer_sz; /* macroblock memory; when BVOPS=false, vmv = 2*vcv; when BVOPS=true, vmv = 3*vcv*/ int max_vmv_buffer_sz; /* max macroblocks per vop */ - int vcv_decoder_rate; /* macroblocks decoded per second */ - int max_acpred_mbs; /* percentage */ + int vcv_decoder_rate; /* macroblocks decoded per second */ + int max_acpred_mbs; /* percentage */ int max_vbv_size; /* max vbv size (bits) 16368 bits */ - int max_video_packet_length; /* bits */ - int max_bitrate; /* kbits/s */ + int max_video_packet_length;/* bits */ + int max_bitrate; /* bits per second */ + int vbv_peakrate; /* max bits over anyone second period; 0=don't care */ + int xvid_max_bframes; /* xvid: max consecutive bframes */ unsigned int flags; } profile_t; extern const profile_t profiles[]; +extern const quality_t quality_table[]; +extern const int quality_table_num; /* number of elements in quality table */ + void config_reg_get(CONFIG * config); void config_reg_set(CONFIG * config); void sort_zones(zone_t * zones, int zone_num, int * sel); -BOOL CALLBACK main_proc(HWND, UINT, WPARAM, LPARAM); -BOOL CALLBACK about_proc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK main_proc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK about_proc(HWND, UINT, WPARAM, LPARAM); #endif /* _CONFIG_H_ */