23 |
* |
* |
24 |
* History: |
* History: |
25 |
* |
* |
26 |
|
* 15.06.2002 added bframes options |
27 |
|
* 21.04.2002 fixed custom matrix support, tried to get dll size down |
28 |
|
* 17.04.2002 re-enabled lumi masking in 1st pass |
29 |
|
* 15.04.2002 updated cbr support |
30 |
|
* 07.04.2002 min keyframe interval checkbox |
31 |
|
* 2-pass max bitrate and overflow customization |
32 |
|
* 04.04.2002 interlacing support |
33 |
|
* hinted ME support |
34 |
|
* 24.03.2002 daniel smith <danielsmith@astroboymail.com> |
35 |
|
* added Foxer's new CBR engine |
36 |
|
* - cbr_buffer is being used as reaction delay (quick hack) |
37 |
* 23.03.2002 daniel smith <danielsmith@astroboymail.com> |
* 23.03.2002 daniel smith <danielsmith@astroboymail.com> |
38 |
* added load defaults button |
* added load defaults button |
39 |
* merged foxer's alternative 2-pass code (2-pass alt tab) |
* merged foxer's alternative 2-pass code (2-pass alt tab) |
50 |
* now get Core Version use xvid_init() |
* now get Core Version use xvid_init() |
51 |
* 05.03.2002 Min Chen <chenm001@163.com> |
* 05.03.2002 Min Chen <chenm001@163.com> |
52 |
* Add Core version display to about box |
* Add Core version display to about box |
53 |
* 01.12.2001 inital version; (c)2001 peter ross <suxen_drol@hotmail.com> |
* 01.12.2001 inital version; (c)2001 peter ross <pross@xvid.org> |
54 |
* |
* |
55 |
*************************************************************************/ |
*************************************************************************/ |
56 |
|
|
59 |
#include <commctrl.h> |
#include <commctrl.h> |
60 |
#include <shlobj.h> |
#include <shlobj.h> |
61 |
#include <prsht.h> |
#include <prsht.h> |
62 |
|
#ifdef _SMP |
63 |
|
#include <pthread.h> |
64 |
|
#endif |
65 |
|
|
66 |
|
#include <xvid.h> // XviD API |
67 |
|
|
68 |
#include "codec.h" |
#include "codec.h" |
69 |
#include "config.h" |
#include "config.h" |
|
#include "xvid.h" // cpu masks |
|
70 |
#include "resource.h" |
#include "resource.h" |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
/* registry info structs */ |
/* registry info structs */ |
75 |
|
|
76 |
CONFIG reg; |
CONFIG reg; |
77 |
|
|
78 |
REG_INT const reg_ints[] = { |
REG_INT const reg_ints[] = { |
79 |
{"mode", ®.mode, DLG_MODE_CBR}, |
{"mode", ®.mode, DLG_MODE_CBR}, |
|
{"bitrate", ®.bitrate, 900000}, |
|
80 |
{"quality", ®.quality, 85}, |
{"quality", ®.quality, 85}, |
81 |
{"quant", ®.quant, 5}, |
{"quant", ®.quant, 5}, |
82 |
{"rc_buffersize", ®.rc_buffersize, 2048000}, |
{"rc_bitrate", ®.rc_bitrate, 900000}, |
83 |
|
{"rc_reaction_delay_factor",®.rc_reaction_delay_factor, 16}, |
84 |
|
{"rc_averaging_period", ®.rc_averaging_period, 100}, |
85 |
|
{"rc_buffer", ®.rc_buffer, 100}, |
86 |
|
|
87 |
{"motion_search", ®.motion_search, 5}, |
{"motion_search", ®.motion_search, 6}, |
88 |
{"quant_type", ®.quant_type, 0}, |
{"quant_type", ®.quant_type, 0}, |
89 |
{"fourcc_used", ®.fourcc_used, 0}, |
{"fourcc_used", ®.fourcc_used, 0}, |
90 |
|
{"vhq_mode", ®.vhq_mode, 0}, |
91 |
{"max_key_interval", ®.max_key_interval, 300}, |
{"max_key_interval", ®.max_key_interval, 300}, |
92 |
|
{"min_key_interval", ®.min_key_interval, 1}, |
93 |
{"lum_masking", ®.lum_masking, 0}, |
{"lum_masking", ®.lum_masking, 0}, |
94 |
|
{"interlacing", ®.interlacing, 0}, |
95 |
|
{"qpel", ®.qpel, 0}, |
96 |
|
{"gmc", ®.gmc, 0}, |
97 |
|
{"chromame", ®.chromame, 0}, |
98 |
|
//added by koepi for gruel's greyscale_mode |
99 |
|
{"greyscale", ®.greyscale, 0}, |
100 |
|
// end of koepi's additions |
101 |
|
{"max_bframes", ®.max_bframes, -1}, |
102 |
|
{"bquant_ratio", ®.bquant_ratio, 150}, |
103 |
|
{"bquant_offset", ®.bquant_offset, 100}, |
104 |
|
{"packed", ®.packed, 0}, |
105 |
|
{"dx50bvop", ®.dx50bvop, 1}, |
106 |
|
{"debug", ®.debug, 0}, |
107 |
|
{"reduced_resolution", ®.reduced_resolution, 0}, |
108 |
|
{"chroma_opt", ®.chroma_opt, 0}, |
109 |
|
{"frame_drop_ratio", ®.frame_drop_ratio, 0}, |
110 |
|
|
111 |
{"min_iquant", ®.min_iquant, 1}, |
{"min_iquant", ®.min_iquant, 2}, |
112 |
{"max_iquant", ®.max_iquant, 31}, |
{"max_iquant", ®.max_iquant, 31}, |
113 |
{"min_pquant", ®.min_pquant, 1}, |
{"min_pquant", ®.min_pquant, 2}, |
114 |
{"max_pquant", ®.max_pquant, 31}, |
{"max_pquant", ®.max_pquant, 31}, |
115 |
|
|
116 |
{"desired_size", ®.desired_size, 570000}, |
{"desired_size", ®.desired_size, 570000}, |
117 |
{"keyframe_boost", ®.keyframe_boost, 20}, |
{"keyframe_boost", ®.keyframe_boost, 0}, |
|
{"min_key_interval", ®.min_key_interval, 6}, |
|
118 |
{"discard1pass", ®.discard1pass, 1}, |
{"discard1pass", ®.discard1pass, 1}, |
119 |
{"dummy2pass", ®.dummy2pass, 0}, |
{"dummy2pass", ®.dummy2pass, 0}, |
120 |
{"curve_compression_high", ®.curve_compression_high, 25}, |
// added by koepi for new two-pass curve treatment |
121 |
{"curve_compression_low", ®.curve_compression_low, 10}, |
{"kftreshold", ®.kftreshold, 10}, |
122 |
|
{"kfreduction", ®.kfreduction, 20}, |
123 |
|
// end of koepi's additions |
124 |
|
{"curve_compression_high", ®.curve_compression_high, 0}, |
125 |
|
{"curve_compression_low", ®.curve_compression_low, 0}, |
126 |
{"use_alt_curve", ®.use_alt_curve, 0}, |
{"use_alt_curve", ®.use_alt_curve, 0}, |
127 |
{"alt_curve_use_auto", ®.alt_curve_use_auto, 1}, |
{"alt_curve_use_auto", ®.alt_curve_use_auto, 1}, |
128 |
{"alt_curve_auto_str", ®.alt_curve_auto_str, 50}, |
{"alt_curve_auto_str", ®.alt_curve_auto_str, 30}, |
129 |
{"alt_curve_use_auto_bonus_bias", ®.alt_curve_use_auto_bonus_bias, 1}, |
{"alt_curve_use_auto_bonus_bias", ®.alt_curve_use_auto_bonus_bias, 1}, |
130 |
{"alt_curve_bonus_bias", ®.alt_curve_bonus_bias, 50}, |
{"alt_curve_bonus_bias", ®.alt_curve_bonus_bias, 50}, |
131 |
{"alt_curve_type", ®.alt_curve_type, 1}, |
{"alt_curve_type", ®.alt_curve_type, 1}, |
132 |
{"alt_curve_high_dist", ®.alt_curve_high_dist, 300}, |
{"alt_curve_high_dist", ®.alt_curve_high_dist, 500}, |
133 |
{"alt_curve_low_dist", ®.alt_curve_low_dist, 300}, |
{"alt_curve_low_dist", ®.alt_curve_low_dist, 90}, |
134 |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
135 |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 240}, |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 250}, |
136 |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
137 |
|
{"twopass_max_bitrate", ®.twopass_max_bitrate, 10000 * CONFIG_KBPS}, |
138 |
|
{"twopass_max_overflow_improvement", ®.twopass_max_overflow_improvement, 60}, |
139 |
|
{"twopass_max_overflow_degradation", ®.twopass_max_overflow_degradation, 60}, |
140 |
|
{"hinted_me", ®.hinted_me, 0}, |
141 |
|
|
142 |
{"credits_start", ®.credits_start, 0}, |
{"credits_start", ®.credits_start, 0}, |
143 |
{"credits_start_begin", ®.credits_start_begin, 0}, |
{"credits_start_begin", ®.credits_start_begin, 0}, |
146 |
{"credits_end_begin", ®.credits_end_begin, 0}, |
{"credits_end_begin", ®.credits_end_begin, 0}, |
147 |
{"credits_end_end", ®.credits_end_end, 0}, |
{"credits_end_end", ®.credits_end_end, 0}, |
148 |
|
|
149 |
|
// added by koepi for greyscale credits |
150 |
|
{"credits_greyscale", ®.credits_greyscale, 0}, |
151 |
|
// end of koepi's addition |
152 |
{"credits_mode", ®.credits_mode, 0}, |
{"credits_mode", ®.credits_mode, 0}, |
153 |
{"credits_rate", ®.credits_rate, 20}, |
{"credits_rate", ®.credits_rate, 20}, |
154 |
{"credits_quant_i", ®.credits_quant_i, 20}, |
{"credits_quant_i", ®.credits_quant_i, 20}, |
155 |
{"credits_quant_p", ®.credits_quant_p, 20}, |
{"credits_quant_p", ®.credits_quant_p, 20}, |
156 |
{"credits_start_size", ®.credits_start_size, 10000}, |
{"credits_start_size", ®.credits_start_size, 10000}, |
157 |
{"credits_end_size", ®.credits_end_size, 10000} |
{"credits_end_size", ®.credits_end_size, 10000}, |
158 |
|
|
159 |
|
/* decoder */ |
160 |
|
{"deblock_y", ®.deblock_y, 0}, |
161 |
|
{"deblock_uv", ®.deblock_uv, 0} |
162 |
}; |
}; |
163 |
|
|
164 |
REG_STR const reg_strs[] = { |
REG_STR const reg_strs[] = { |
165 |
|
{"hintfile", reg.hintfile, CONFIG_HINTFILE}, |
166 |
{"stats1", reg.stats1, CONFIG_2PASS_1_FILE}, |
{"stats1", reg.stats1, CONFIG_2PASS_1_FILE}, |
167 |
{"stats2", reg.stats2, CONFIG_2PASS_2_FILE} |
{"stats2", reg.stats2, CONFIG_2PASS_2_FILE} |
168 |
// {"build", reg.build, XVID_BUILD} |
// {"build", reg.build, XVID_BUILD} |
179 |
XVID_INIT_PARAM init_param; |
XVID_INIT_PARAM init_param; |
180 |
int i; |
int i; |
181 |
|
|
182 |
init_param.cpu_flags = 0; |
init_param.cpu_flags = XVID_CPU_CHKONLY; |
183 |
xvid_init(0, 0, &init_param, NULL); |
xvid_init(0, 0, &init_param, NULL); |
184 |
config->cpu = init_param.cpu_flags; |
reg.cpu = init_param.cpu_flags; |
185 |
|
|
186 |
|
#ifdef _SMP |
187 |
|
reg.num_threads = pthread_num_processors_np(); |
188 |
|
#endif |
189 |
|
|
190 |
RegOpenKeyEx(XVID_REG_KEY, XVID_REG_PARENT "\\" XVID_REG_CHILD, 0, KEY_READ, &hKey); |
RegOpenKeyEx(XVID_REG_KEY, XVID_REG_PARENT "\\" XVID_REG_CHILD, 0, KEY_READ, &hKey); |
191 |
|
|
312 |
|
|
313 |
/* leaves current config value if dialog item is empty */ |
/* leaves current config value if dialog item is empty */ |
314 |
|
|
315 |
int config_get_int(HWND hDlg, UINT item, int config) |
int config_get_int(HWND hDlg, INT item, int config) |
316 |
|
{ |
317 |
|
BOOL success = FALSE; |
318 |
|
|
319 |
|
int tmp = GetDlgItemInt(hDlg, item, &success, TRUE); |
320 |
|
|
321 |
|
return (success) ? tmp : config; |
322 |
|
} |
323 |
|
|
324 |
|
|
325 |
|
int config_get_uint(HWND hDlg, UINT item, int config) |
326 |
{ |
{ |
327 |
BOOL success = FALSE; |
BOOL success = FALSE; |
328 |
|
|
340 |
{ |
{ |
341 |
default : |
default : |
342 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
343 |
config->bitrate = config_get_int(hDlg, IDC_VALUE, config->bitrate) * CONFIG_KBPS; |
config->rc_bitrate = config_get_uint(hDlg, IDC_VALUE, config->rc_bitrate) * CONFIG_KBPS; |
344 |
break; |
break; |
345 |
|
|
346 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
347 |
config->quality = config_get_int(hDlg, IDC_VALUE, config->quality); |
config->quality = config_get_uint(hDlg, IDC_VALUE, config->quality); |
348 |
break; |
break; |
349 |
|
|
350 |
case DLG_MODE_VBR_QUANT : |
case DLG_MODE_VBR_QUANT : |
351 |
config->quant = config_get_int(hDlg, IDC_VALUE, config->quant); |
config->quant = config_get_uint(hDlg, IDC_VALUE, config->quant); |
352 |
break; |
break; |
353 |
|
|
354 |
case DLG_MODE_2PASS_2_INT : |
case DLG_MODE_2PASS_2_INT : |
355 |
config->desired_size = config_get_int(hDlg, IDC_VALUE, config->desired_size); |
config->desired_size = config_get_uint(hDlg, IDC_VALUE, config->desired_size); |
356 |
break; |
break; |
357 |
} |
} |
358 |
|
|
359 |
config->mode = SendDlgItemMessage(hDlg, IDC_MODE, CB_GETCURSEL, 0, 0); |
config->mode = SendDlgItemMessage(hDlg, IDC_MODE, CB_GETCURSEL, 0, 0); |
|
config->rc_buffersize = config_get_int(hDlg, IDC_CBRBUFFER, config->rc_buffersize); |
|
360 |
} |
} |
361 |
|
|
362 |
|
|
375 |
|
|
376 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
377 |
text = "Bitrate (Kbps):"; |
text = "Bitrate (Kbps):"; |
378 |
value = config->bitrate / CONFIG_KBPS; |
value = config->rc_bitrate / CONFIG_KBPS; |
379 |
break; |
break; |
380 |
|
|
381 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
399 |
|
|
400 |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled); |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled); |
401 |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE), enabled); |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE), enabled); |
|
EnableWindow(GetDlgItem(hDlg, IDC_CBRBUFFER_STATIC), (config->mode == DLG_MODE_CBR)); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_CBRBUFFER), (config->mode == DLG_MODE_CBR)); |
|
402 |
} |
} |
403 |
|
|
404 |
|
|
419 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
420 |
text = "Bitrate (Kbps):"; |
text = "Bitrate (Kbps):"; |
421 |
range = MAKELONG(0,10000); |
range = MAKELONG(0,10000); |
422 |
pos = config->bitrate / CONFIG_KBPS; |
pos = config->rc_bitrate / CONFIG_KBPS; |
423 |
break; |
break; |
424 |
|
|
425 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
506 |
void adv_mode(HWND hDlg, int mode) |
void adv_mode(HWND hDlg, int mode) |
507 |
{ |
{ |
508 |
// create arrays of controls to be disabled for each mode |
// create arrays of controls to be disabled for each mode |
509 |
const int cbr_disable[] = { |
const short twopass_disable[] = { |
510 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_KFBOOST, IDC_DUMMY2PASS, IDC_USEALT, |
511 |
|
// added by koepi for new curve treatment |
512 |
|
IDC_KFTRESHOLD, IDC_KFREDUCTION, |
513 |
|
//end of koepi's additions |
514 |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
515 |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
IDC_STATS2, IDC_STATS2_BROWSE, |
516 |
|
}; |
517 |
|
|
518 |
|
const short cbr_disable[] = { |
519 |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
520 |
IDC_CREDITS_START, IDC_CREDITS_END, IDC_CREDITS_START_BEGIN, IDC_CREDITS_START_END, |
IDC_CREDITS_START, IDC_CREDITS_END, IDC_CREDITS_START_BEGIN, IDC_CREDITS_START_END, |
521 |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
522 |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
523 |
IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, |
IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
524 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, IDC_CREDITS_GREYSCALE, IDC_HINTFILE |
525 |
}; |
}; |
526 |
|
|
527 |
const int qual_disable[] = { |
const short qual_disable[] = { |
528 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
529 |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
530 |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
531 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_HINTFILE |
532 |
}; |
}; |
533 |
|
|
534 |
const int quant_disable[] = { |
const short quant_disable[] = { |
535 |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
536 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
537 |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
538 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
539 |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
IDC_HINTFILE |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
|
|
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
|
540 |
}; |
}; |
541 |
|
|
542 |
const int twopass1_disable[] = { |
const short twopass1_disable[] = { |
543 |
IDC_LUMMASK, IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
544 |
IDC_KFBOOST, IDC_DUMMY2PASS, |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
|
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
|
|
IDC_STATS2, IDC_STATS2_BROWSE, |
|
545 |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_RATE, IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_RATE, IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, |
546 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
547 |
}; |
}; |
548 |
|
|
549 |
const int twopass2_ext_disable[] = { |
const short twopass2_ext_disable[] = { |
550 |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
551 |
|
IDC_CREDITS_RATE_RADIO, |
552 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
553 |
IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
554 |
}; |
}; |
555 |
|
|
556 |
const int twopass2_int_disable[] = { |
const short twopass2_int_disable[] = { |
557 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
558 |
IDC_STATS2, IDC_STATS2_BROWSE |
IDC_STATS2, IDC_STATS2_BROWSE |
559 |
}; |
}; |
560 |
|
|
561 |
// store pointers in order so we can lookup using config->mode |
// store pointers in order so we can lookup using config->mode |
562 |
const int* modes[] = { |
const short* modes[] = { |
563 |
cbr_disable, qual_disable, quant_disable, |
cbr_disable, qual_disable, quant_disable, |
564 |
twopass1_disable, twopass2_ext_disable, twopass2_int_disable |
twopass1_disable, twopass2_ext_disable, twopass2_int_disable |
565 |
}; |
}; |
566 |
|
|
567 |
// ditto modes[] |
// ditto modes[] |
568 |
const int lengths[] = { |
const int lengths[] = { |
569 |
sizeof(cbr_disable)/sizeof(int), sizeof(qual_disable)/sizeof(int), |
sizeof(cbr_disable)/sizeof(short), sizeof(qual_disable)/sizeof(short), |
570 |
sizeof(quant_disable)/sizeof(int), sizeof(twopass1_disable)/sizeof(int), |
sizeof(quant_disable)/sizeof(short), sizeof(twopass1_disable)/sizeof(short), |
571 |
sizeof(twopass2_ext_disable)/sizeof(int), sizeof(twopass2_int_disable)/sizeof(int) |
sizeof(twopass2_ext_disable)/sizeof(short), sizeof(twopass2_int_disable)/sizeof(short), 0 |
572 |
}; |
}; |
573 |
|
|
574 |
int i; |
int i; |
575 |
|
int hinted_me, use_alt, use_alt_auto, use_alt_auto_bonus; |
576 |
|
int credits_start, credits_end, credits_rate, credits_quant, credits_size; |
577 |
|
int cpu_force; |
578 |
|
|
579 |
// first perform checkbox-based enable/disable |
// first perform checkbox-based enable/disable |
580 |
CONTROLDLG(IDC_USEAUTO, ISDLGSET(IDC_USEALT)); |
hinted_me = ISDLGSET(IDC_HINTEDME); |
581 |
CONTROLDLG(IDC_AUTOSTR, ISDLGSET(IDC_USEALT) && ISDLGSET(IDC_USEAUTO)); |
CONTROLDLG(IDC_HINTFILE, hinted_me); |
582 |
CONTROLDLG(IDC_USEAUTOBONUS, ISDLGSET(IDC_USEALT)); |
CONTROLDLG(IDC_HINT_BROWSE, hinted_me); |
583 |
CONTROLDLG(IDC_BONUSBIAS, (ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTOBONUS)))); |
|
584 |
CONTROLDLG(IDC_CURVETYPE, ISDLGSET(IDC_USEALT)); |
use_alt = ISDLGSET(IDC_USEALT) && (mode == DLG_MODE_2PASS_2_EXT || mode == DLG_MODE_2PASS_2_INT); |
585 |
CONTROLDLG(IDC_ALTCURVEHIGH, ISDLGSET(IDC_USEALT)); |
use_alt_auto = ISDLGSET(IDC_USEAUTO); |
586 |
CONTROLDLG(IDC_ALTCURVELOW, ISDLGSET(IDC_USEALT)); |
use_alt_auto_bonus = ISDLGSET(IDC_USEAUTOBONUS); |
587 |
CONTROLDLG(IDC_MINQUAL, ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTO))); |
CONTROLDLG(IDC_USEAUTO, use_alt); |
588 |
|
CONTROLDLG(IDC_AUTOSTR, use_alt && use_alt_auto); |
589 |
CONTROLDLG(IDC_CREDITS_START_BEGIN, ISDLGSET(IDC_CREDITS_START)); |
CONTROLDLG(IDC_USEAUTOBONUS, use_alt); |
590 |
CONTROLDLG(IDC_CREDITS_START_END, ISDLGSET(IDC_CREDITS_START)); |
CONTROLDLG(IDC_BONUSBIAS, use_alt && !use_alt_auto_bonus); |
591 |
|
CONTROLDLG(IDC_CURVETYPE, use_alt); |
592 |
CONTROLDLG(IDC_CREDITS_END_BEGIN, ISDLGSET(IDC_CREDITS_END)); |
CONTROLDLG(IDC_ALTCURVEHIGH, use_alt); |
593 |
CONTROLDLG(IDC_CREDITS_END_END, ISDLGSET(IDC_CREDITS_END)); |
CONTROLDLG(IDC_ALTCURVELOW, use_alt); |
594 |
|
CONTROLDLG(IDC_MINQUAL, use_alt && !use_alt_auto); |
595 |
CONTROLDLG(IDC_CREDITS_RATE, ISDLGSET(IDC_CREDITS_RATE_RADIO)); |
|
596 |
CONTROLDLG(IDC_CREDITS_QUANTI, ISDLGSET(IDC_CREDITS_QUANT_RADIO)); |
credits_start = ISDLGSET(IDC_CREDITS_START); |
597 |
CONTROLDLG(IDC_CREDITS_QUANTP, ISDLGSET(IDC_CREDITS_QUANT_RADIO)); |
CONTROLDLG(IDC_CREDITS_START_BEGIN, credits_start); |
598 |
CONTROLDLG(IDC_CREDITS_START_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO)); |
CONTROLDLG(IDC_CREDITS_START_END, credits_start); |
599 |
CONTROLDLG(IDC_CREDITS_END_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO)); |
|
600 |
|
credits_end = ISDLGSET(IDC_CREDITS_END); |
601 |
CONTROLDLG(IDC_CPU_MMX, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_END_BEGIN, credits_end); |
602 |
CONTROLDLG(IDC_CPU_MMXEXT, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_END_END, credits_end); |
603 |
CONTROLDLG(IDC_CPU_SSE, ISDLGSET(IDC_CPU_FORCE)); |
|
604 |
CONTROLDLG(IDC_CPU_SSE2, ISDLGSET(IDC_CPU_FORCE)); |
credits_rate = ISDLGSET(IDC_CREDITS_RATE_RADIO); |
605 |
CONTROLDLG(IDC_CPU_3DNOW, ISDLGSET(IDC_CPU_FORCE)); |
credits_quant = ISDLGSET(IDC_CREDITS_QUANT_RADIO); |
606 |
CONTROLDLG(IDC_CPU_3DNOWEXT, ISDLGSET(IDC_CPU_FORCE)); |
credits_size = ISDLGSET(IDC_CREDITS_SIZE_RADIO); |
607 |
|
CONTROLDLG(IDC_CREDITS_RATE, credits_rate); |
608 |
|
CONTROLDLG(IDC_CREDITS_QUANTI, credits_quant); |
609 |
|
CONTROLDLG(IDC_CREDITS_QUANTP, credits_quant); |
610 |
|
CONTROLDLG(IDC_CREDITS_START_SIZE, credits_size); |
611 |
|
CONTROLDLG(IDC_CREDITS_END_SIZE, credits_size); |
612 |
|
|
613 |
|
cpu_force = ISDLGSET(IDC_CPU_FORCE); |
614 |
|
CONTROLDLG(IDC_CPU_MMX, cpu_force); |
615 |
|
CONTROLDLG(IDC_CPU_MMXEXT, cpu_force); |
616 |
|
CONTROLDLG(IDC_CPU_SSE, cpu_force); |
617 |
|
CONTROLDLG(IDC_CPU_SSE2, cpu_force); |
618 |
|
CONTROLDLG(IDC_CPU_3DNOW, cpu_force); |
619 |
|
CONTROLDLG(IDC_CPU_3DNOWEXT, cpu_force); |
620 |
|
|
621 |
// now perform codec mode enable/disable |
// now perform codec mode enable/disable |
622 |
for (i=0 ; i<lengths[mode] ; ++i) |
for (i=0 ; i<lengths[mode] ; ++i) |
623 |
{ |
{ |
624 |
EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE); |
EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE); |
625 |
} |
} |
626 |
|
|
627 |
|
if (mode != DLG_MODE_2PASS_2_EXT && mode != DLG_MODE_2PASS_2_INT) |
628 |
|
{ |
629 |
|
for (i=0 ; i<sizeof(twopass_disable)/sizeof(short) ; ++i) |
630 |
|
{ |
631 |
|
EnableWindow(GetDlgItem(hDlg, twopass_disable[i]), FALSE); |
632 |
|
} |
633 |
|
} |
634 |
} |
} |
635 |
|
|
636 |
|
|
644 |
SendDlgItemMessage(hDlg, IDC_MOTION, CB_SETCURSEL, config->motion_search, 0); |
SendDlgItemMessage(hDlg, IDC_MOTION, CB_SETCURSEL, config->motion_search, 0); |
645 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
646 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0); |
647 |
|
SendDlgItemMessage(hDlg, IDC_VHQ, CB_SETCURSEL, config->vhq_mode, 0); |
648 |
SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE); |
SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE); |
649 |
|
SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE); |
650 |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
651 |
|
CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED); |
652 |
|
|
653 |
|
CheckDlgButton(hDlg, IDC_QPEL, config->qpel ? BST_CHECKED : BST_UNCHECKED); |
654 |
|
CheckDlgButton(hDlg, IDC_GMC, config->gmc ? BST_CHECKED : BST_UNCHECKED); |
655 |
|
CheckDlgButton(hDlg, IDC_CHROMAME, config->chromame ? BST_CHECKED : BST_UNCHECKED); |
656 |
|
// added by koepi for gruel's greyscale_mode |
657 |
|
CheckDlgButton(hDlg, IDC_GREYSCALE, config->greyscale ? BST_CHECKED : BST_UNCHECKED); |
658 |
|
// end of koepi's addition |
659 |
|
SetDlgItemInt(hDlg, IDC_MAXBFRAMES, config->max_bframes, TRUE); |
660 |
|
SetDlgItemInt(hDlg, IDC_BQUANTRATIO, config->bquant_ratio, FALSE); |
661 |
|
SetDlgItemInt(hDlg, IDC_BQUANTOFFSET, config->bquant_offset, FALSE); |
662 |
|
CheckDlgButton(hDlg, IDC_PACKED, config->packed ? BST_CHECKED : BST_UNCHECKED); |
663 |
|
CheckDlgButton(hDlg, IDC_DX50BVOP, config->dx50bvop ? BST_CHECKED : BST_UNCHECKED); |
664 |
|
CheckDlgButton(hDlg, IDC_DEBUG, config->debug ? BST_CHECKED : BST_UNCHECKED); |
665 |
|
|
666 |
|
CheckDlgButton(hDlg, IDC_REDUCED, config->reduced_resolution ? BST_CHECKED : BST_UNCHECKED); |
667 |
break; |
break; |
668 |
|
|
669 |
case DLG_QUANT : |
case DLG_QUANT : |
675 |
|
|
676 |
case DLG_2PASS : |
case DLG_2PASS : |
677 |
SetDlgItemInt(hDlg, IDC_KFBOOST, config->keyframe_boost, FALSE); |
SetDlgItemInt(hDlg, IDC_KFBOOST, config->keyframe_boost, FALSE); |
|
SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE); |
|
678 |
CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED); |
679 |
CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED); |
680 |
|
// added by koepi for new 2pass curve treatment |
681 |
|
SetDlgItemInt(hDlg, IDC_KFTRESHOLD, config->kftreshold, FALSE); |
682 |
|
SetDlgItemInt(hDlg, IDC_KFREDUCTION, config->kfreduction, FALSE); |
683 |
|
// end of koepi's additions |
684 |
SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE); |
SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE); |
685 |
SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE); |
SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE); |
686 |
SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE); |
SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE); |
687 |
CheckDlgButton(hDlg, IDC_PAYBACKBIAS, (config->bitrate_payback_method == 0)); |
CheckDlgButton(hDlg, IDC_PAYBACKBIAS, (config->bitrate_payback_method == 0)); |
688 |
CheckDlgButton(hDlg, IDC_PAYBACKPROP, (config->bitrate_payback_method == 1)); |
CheckDlgButton(hDlg, IDC_PAYBACKPROP, (config->bitrate_payback_method == 1)); |
689 |
|
|
690 |
|
CheckDlgButton(hDlg, IDC_HINTEDME, config->hinted_me ? BST_CHECKED : BST_UNCHECKED); |
691 |
|
SetDlgItemText(hDlg, IDC_HINTFILE, config->hintfile); |
692 |
SetDlgItemText(hDlg, IDC_STATS1, config->stats1); |
SetDlgItemText(hDlg, IDC_STATS1, config->stats1); |
693 |
SetDlgItemText(hDlg, IDC_STATS2, config->stats2); |
SetDlgItemText(hDlg, IDC_STATS2, config->stats2); |
694 |
break; |
break; |
706 |
|
|
707 |
CheckDlgButton(hDlg, IDC_USEAUTOBONUS, config->alt_curve_use_auto_bonus_bias ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_USEAUTOBONUS, config->alt_curve_use_auto_bonus_bias ? BST_CHECKED : BST_UNCHECKED); |
708 |
SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE); |
SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE); |
709 |
|
|
710 |
|
SetDlgItemInt(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate / CONFIG_KBPS, FALSE); |
711 |
|
SetDlgItemInt(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement, FALSE); |
712 |
|
SetDlgItemInt(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation, FALSE); |
713 |
break; |
break; |
714 |
|
|
715 |
case DLG_CREDITS : |
case DLG_CREDITS : |
720 |
SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE); |
721 |
SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE); |
722 |
|
|
723 |
|
// added by koepi for credits greyscale |
724 |
|
CheckDlgButton(hDlg, IDC_CREDITS_GREYSCALE, config->credits_greyscale ? BST_CHECKED : BST_UNCHECKED); |
725 |
|
// end of koepi's addition |
726 |
SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE); |
727 |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE); |
728 |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE); |
753 |
|
|
754 |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
755 |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
756 |
|
|
757 |
|
#ifdef _SMP |
758 |
|
SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); |
759 |
|
#endif |
760 |
|
CheckDlgButton(hDlg, IDC_CHROMA_OPT, (config->chroma_opt) ? BST_CHECKED : BST_UNCHECKED); |
761 |
|
SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE); |
762 |
|
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
763 |
|
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
764 |
|
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
765 |
break; |
break; |
766 |
} |
} |
767 |
} |
} |
781 |
config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0); |
config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0); |
782 |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
783 |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
784 |
config->max_key_interval = config_get_int(hDlg, IDC_MAXKEY, config->max_key_interval); |
config->vhq_mode = SendDlgItemMessage(hDlg, IDC_VHQ, CB_GETCURSEL, 0, 0); |
785 |
|
config->max_key_interval = config_get_uint(hDlg, IDC_MAXKEY, config->max_key_interval); |
786 |
|
config->min_key_interval = config_get_uint(hDlg, IDC_MINKEY, config->min_key_interval); |
787 |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
788 |
|
config->interlacing = ISDLGSET(IDC_INTERLACING); |
789 |
|
|
790 |
|
config->qpel = ISDLGSET(IDC_QPEL); |
791 |
|
config->gmc = ISDLGSET(IDC_GMC); |
792 |
|
config->chromame = ISDLGSET(IDC_CHROMAME); |
793 |
|
// added by koepi for gruel's greyscale_mode |
794 |
|
config->greyscale = ISDLGSET(IDC_GREYSCALE); |
795 |
|
// end of koepi's addition |
796 |
|
config->max_bframes = config_get_int(hDlg, IDC_MAXBFRAMES, config->max_bframes); |
797 |
|
config->bquant_ratio = config_get_uint(hDlg, IDC_BQUANTRATIO, config->bquant_ratio); |
798 |
|
config->bquant_offset = config_get_uint(hDlg, IDC_BQUANTOFFSET, config->bquant_offset); |
799 |
|
config->packed = ISDLGSET(IDC_PACKED); |
800 |
|
config->dx50bvop = ISDLGSET(IDC_DX50BVOP); |
801 |
|
config->debug = ISDLGSET(IDC_DEBUG); |
802 |
|
config->reduced_resolution = ISDLGSET(IDC_REDUCED); |
803 |
break; |
break; |
804 |
|
|
805 |
case DLG_QUANT : |
case DLG_QUANT : |
806 |
config->min_iquant = config_get_int(hDlg, IDC_MINIQUANT, config->min_iquant); |
config->min_iquant = config_get_uint(hDlg, IDC_MINIQUANT, config->min_iquant); |
807 |
config->max_iquant = config_get_int(hDlg, IDC_MAXIQUANT, config->max_iquant); |
config->max_iquant = config_get_uint(hDlg, IDC_MAXIQUANT, config->max_iquant); |
808 |
config->min_pquant = config_get_int(hDlg, IDC_MINPQUANT, config->min_pquant); |
config->min_pquant = config_get_uint(hDlg, IDC_MINPQUANT, config->min_pquant); |
809 |
config->max_pquant = config_get_int(hDlg, IDC_MAXPQUANT, config->max_pquant); |
config->max_pquant = config_get_uint(hDlg, IDC_MAXPQUANT, config->max_pquant); |
810 |
|
|
811 |
CONSTRAINVAL(config->min_iquant, 1, 31); |
CONSTRAINVAL(config->min_iquant, 1, 31); |
812 |
CONSTRAINVAL(config->max_iquant, config->min_iquant, 31); |
CONSTRAINVAL(config->max_iquant, config->min_iquant, 31); |
816 |
|
|
817 |
case DLG_2PASS : |
case DLG_2PASS : |
818 |
config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE); |
config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE); |
819 |
config->min_key_interval = config_get_int(hDlg, IDC_MINKEY, config->min_key_interval); |
// added by koepi for the new 2pass curve treatment |
820 |
|
config->kftreshold = GetDlgItemInt(hDlg, IDC_KFTRESHOLD, NULL, FALSE); |
821 |
|
config->kfreduction = GetDlgItemInt(hDlg, IDC_KFREDUCTION, NULL, FALSE); |
822 |
|
//end of koepi's additions |
823 |
config->discard1pass = ISDLGSET(IDC_DISCARD1PASS); |
config->discard1pass = ISDLGSET(IDC_DISCARD1PASS); |
824 |
config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS); |
config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS); |
825 |
config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE); |
config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE); |
826 |
config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE); |
config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE); |
827 |
config->bitrate_payback_delay = config_get_int(hDlg, IDC_PAYBACK, config->bitrate_payback_delay); |
config->bitrate_payback_delay = config_get_uint(hDlg, IDC_PAYBACK, config->bitrate_payback_delay); |
828 |
config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP); |
config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP); |
829 |
|
config->hinted_me = ISDLGSET(IDC_HINTEDME); |
830 |
|
|
831 |
|
if (GetDlgItemText(hDlg, IDC_HINTFILE, config->hintfile, MAX_PATH) == 0) |
832 |
|
{ |
833 |
|
lstrcpy(config->hintfile, CONFIG_HINTFILE); |
834 |
|
} |
835 |
if (GetDlgItemText(hDlg, IDC_STATS1, config->stats1, MAX_PATH) == 0) |
if (GetDlgItemText(hDlg, IDC_STATS1, config->stats1, MAX_PATH) == 0) |
836 |
{ |
{ |
837 |
lstrcpy(config->stats1, CONFIG_2PASS_1_FILE); |
lstrcpy(config->stats1, CONFIG_2PASS_1_FILE); |
851 |
config->use_alt_curve = ISDLGSET(IDC_USEALT); |
config->use_alt_curve = ISDLGSET(IDC_USEALT); |
852 |
|
|
853 |
config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO); |
config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO); |
854 |
config->alt_curve_auto_str = config_get_int(hDlg, IDC_AUTOSTR, config->alt_curve_auto_str); |
config->alt_curve_auto_str = config_get_uint(hDlg, IDC_AUTOSTR, config->alt_curve_auto_str); |
855 |
|
|
856 |
config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS); |
config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS); |
857 |
config->alt_curve_bonus_bias = config_get_int(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias); |
config->alt_curve_bonus_bias = config_get_uint(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias); |
858 |
|
|
859 |
config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0); |
config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0); |
860 |
config->alt_curve_high_dist = config_get_int(hDlg, IDC_ALTCURVEHIGH, config->alt_curve_high_dist); |
config->alt_curve_high_dist = config_get_uint(hDlg, IDC_ALTCURVEHIGH, config->alt_curve_high_dist); |
861 |
config->alt_curve_low_dist = config_get_int(hDlg, IDC_ALTCURVELOW, config->alt_curve_low_dist); |
config->alt_curve_low_dist = config_get_uint(hDlg, IDC_ALTCURVELOW, config->alt_curve_low_dist); |
862 |
config->alt_curve_min_rel_qual = config_get_int(hDlg, IDC_MINQUAL, config->alt_curve_min_rel_qual); |
config->alt_curve_min_rel_qual = config_get_uint(hDlg, IDC_MINQUAL, config->alt_curve_min_rel_qual); |
863 |
|
|
864 |
|
config->twopass_max_bitrate /= CONFIG_KBPS; |
865 |
|
config->twopass_max_bitrate = config_get_uint(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate); |
866 |
|
config->twopass_max_bitrate *= CONFIG_KBPS; |
867 |
|
config->twopass_max_overflow_improvement = config_get_uint(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement); |
868 |
|
config->twopass_max_overflow_degradation = config_get_uint(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation); |
869 |
|
|
870 |
|
CONSTRAINVAL(config->twopass_max_overflow_improvement, 1, 80); |
871 |
|
CONSTRAINVAL(config->twopass_max_overflow_degradation, 1, 80); |
872 |
break; |
break; |
873 |
|
|
874 |
case DLG_CREDITS : |
case DLG_CREDITS : |
875 |
config->credits_start = ISDLGSET(IDC_CREDITS_START); |
config->credits_start = ISDLGSET(IDC_CREDITS_START); |
876 |
config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE); |
config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE); |
877 |
config->credits_start_end = config_get_int(hDlg, IDC_CREDITS_START_END, config->credits_start_end); |
config->credits_start_end = config_get_uint(hDlg, IDC_CREDITS_START_END, config->credits_start_end); |
878 |
config->credits_end = ISDLGSET(IDC_CREDITS_END); |
config->credits_end = ISDLGSET(IDC_CREDITS_END); |
879 |
config->credits_end_begin = config_get_int(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin); |
config->credits_end_begin = config_get_uint(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin); |
880 |
config->credits_end_end = config_get_int(hDlg, IDC_CREDITS_END_END, config->credits_end_end); |
config->credits_end_end = config_get_uint(hDlg, IDC_CREDITS_END_END, config->credits_end_end); |
881 |
|
|
882 |
config->credits_rate = config_get_int(hDlg, IDC_CREDITS_RATE, config->credits_rate); |
// added by koepi for gruel's greyscale_mode |
883 |
config->credits_quant_i = config_get_int(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i); |
config->credits_greyscale = ISDLGSET(IDC_CREDITS_GREYSCALE); |
884 |
config->credits_quant_p = config_get_int(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p); |
// end of koepi's addition |
885 |
config->credits_start_size = config_get_int(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size); |
config->credits_rate = config_get_uint(hDlg, IDC_CREDITS_RATE, config->credits_rate); |
886 |
config->credits_end_size = config_get_int(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size); |
config->credits_quant_i = config_get_uint(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i); |
887 |
|
config->credits_quant_p = config_get_uint(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p); |
888 |
|
config->credits_start_size = config_get_uint(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size); |
889 |
|
config->credits_end_size = config_get_uint(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size); |
890 |
|
|
891 |
config->credits_mode = 0; |
config->credits_mode = 0; |
892 |
config->credits_mode = ISDLGSET(IDC_CREDITS_RATE_RADIO) ? CREDITS_MODE_RATE : config->credits_mode; |
config->credits_mode = ISDLGSET(IDC_CREDITS_RATE_RADIO) ? CREDITS_MODE_RATE : config->credits_mode; |
918 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0; |
919 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
920 |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
921 |
|
|
922 |
|
#ifdef _SMP |
923 |
|
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
924 |
|
#endif |
925 |
|
config->chroma_opt = ISDLGSET(IDC_CHROMA_OPT); |
926 |
|
config->frame_drop_ratio = config_get_uint(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio); |
927 |
|
config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor); |
928 |
|
config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period); |
929 |
|
config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer); |
930 |
break; |
break; |
931 |
} |
} |
932 |
} |
} |
952 |
{ |
{ |
953 |
int temp; |
int temp; |
954 |
|
|
955 |
temp = config_get_int(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]); |
temp = config_get_uint(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]); |
956 |
CONSTRAINVAL(temp, 1, 255); |
CONSTRAINVAL(temp, 1, 255); |
957 |
temp = config->qmatrix_intra[i]; |
config->qmatrix_intra[i] = temp; |
958 |
|
|
959 |
temp = config_get_int(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]); |
temp = config_get_uint(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]); |
960 |
CONSTRAINVAL(temp, 1, 255); |
CONSTRAINVAL(temp, 1, 255); |
961 |
temp = config->qmatrix_inter[i]; |
config->qmatrix_inter[i] = temp; |
962 |
} |
} |
963 |
} |
} |
964 |
|
|
986 |
} |
} |
987 |
|
|
988 |
|
|
989 |
|
|
990 |
|
/* --- decoder options dialog --- */ |
991 |
|
|
992 |
|
#define DEC_DLG_COUNT 1 |
993 |
|
#define DEC_DLG_POSTPROC 0 |
994 |
|
|
995 |
|
/* decoder dialog: upload config data */ |
996 |
|
|
997 |
|
void dec_upload(HWND hDlg, int page, CONFIG * config) |
998 |
|
{ |
999 |
|
switch (page) |
1000 |
|
{ |
1001 |
|
case DEC_DLG_POSTPROC : |
1002 |
|
CheckDlgButton(hDlg, IDC_DEBLOCK_Y, config->deblock_y ? BST_CHECKED : BST_UNCHECKED); |
1003 |
|
CheckDlgButton(hDlg, IDC_DEBLOCK_UV, config->deblock_uv ? BST_CHECKED : BST_UNCHECKED); |
1004 |
|
break; |
1005 |
|
} |
1006 |
|
} |
1007 |
|
|
1008 |
|
|
1009 |
|
/* dec dialog: download config data */ |
1010 |
|
|
1011 |
|
void dec_download(HWND hDlg, int page, CONFIG * config) |
1012 |
|
{ |
1013 |
|
switch (page) |
1014 |
|
{ |
1015 |
|
case DEC_DLG_POSTPROC : |
1016 |
|
config->deblock_y = ISDLGSET(IDC_DEBLOCK_Y); |
1017 |
|
config->deblock_uv = ISDLGSET(IDC_DEBLOCK_UV); |
1018 |
|
break; |
1019 |
|
} |
1020 |
|
} |
1021 |
|
|
1022 |
|
/* decoder dialog proc */ |
1023 |
|
|
1024 |
|
BOOL CALLBACK dec_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
1025 |
|
{ |
1026 |
|
PROPSHEETINFO *psi; |
1027 |
|
|
1028 |
|
psi = (PROPSHEETINFO*)GetWindowLong(hDlg, GWL_USERDATA); |
1029 |
|
|
1030 |
|
switch (uMsg) |
1031 |
|
{ |
1032 |
|
case WM_INITDIALOG : |
1033 |
|
psi = (PROPSHEETINFO*) ((LPPROPSHEETPAGE)lParam)->lParam; |
1034 |
|
|
1035 |
|
SetWindowLong(hDlg, GWL_USERDATA, (LPARAM)psi); |
1036 |
|
|
1037 |
|
if (hTooltip) |
1038 |
|
{ |
1039 |
|
EnumChildWindows(hDlg, enum_tooltips, 0); |
1040 |
|
} |
1041 |
|
|
1042 |
|
dec_upload(hDlg, psi->page, psi->config); |
1043 |
|
break; |
1044 |
|
|
1045 |
|
case WM_NOTIFY : |
1046 |
|
switch (((NMHDR *)lParam)->code) |
1047 |
|
{ |
1048 |
|
case PSN_KILLACTIVE : |
1049 |
|
/* validate */ |
1050 |
|
dec_download(hDlg, psi->page, psi->config); |
1051 |
|
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1052 |
|
break; |
1053 |
|
|
1054 |
|
case PSN_APPLY : |
1055 |
|
/* apply */ |
1056 |
|
dec_download(hDlg, psi->page, psi->config); |
1057 |
|
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1058 |
|
psi->config->save = TRUE; |
1059 |
|
break; |
1060 |
|
} |
1061 |
|
break; |
1062 |
|
|
1063 |
|
default : |
1064 |
|
return 0; |
1065 |
|
} |
1066 |
|
|
1067 |
|
return 1; |
1068 |
|
} |
1069 |
|
|
1070 |
|
|
1071 |
|
void dec_dialog(HWND hParent, CONFIG * config) |
1072 |
|
{ |
1073 |
|
PROPSHEETINFO psi[DEC_DLG_COUNT]; |
1074 |
|
PROPSHEETPAGE psp[DEC_DLG_COUNT]; |
1075 |
|
PROPSHEETHEADER psh; |
1076 |
|
CONFIG temp; |
1077 |
|
int i; |
1078 |
|
|
1079 |
|
config->save = FALSE; |
1080 |
|
memcpy(&temp, config, sizeof(CONFIG)); |
1081 |
|
|
1082 |
|
for (i=0 ; i<DEC_DLG_COUNT ; ++i) |
1083 |
|
{ |
1084 |
|
psp[i].dwSize = sizeof(PROPSHEETPAGE); |
1085 |
|
psp[i].dwFlags = 0; |
1086 |
|
psp[i].hInstance = hInst; |
1087 |
|
psp[i].pfnDlgProc = dec_proc; |
1088 |
|
psp[i].lParam = (LPARAM)&psi[i]; |
1089 |
|
psp[i].pfnCallback = NULL; |
1090 |
|
|
1091 |
|
psi[i].page = i; |
1092 |
|
psi[i].config = &temp; |
1093 |
|
} |
1094 |
|
|
1095 |
|
psp[DEC_DLG_POSTPROC].pszTemplate = MAKEINTRESOURCE(IDD_POSTPROC); |
1096 |
|
|
1097 |
|
psh.dwSize = sizeof(PROPSHEETHEADER); |
1098 |
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; |
1099 |
|
psh.hwndParent = hParent; |
1100 |
|
psh.hInstance = hInst; |
1101 |
|
psh.pszCaption = (LPSTR) "XviD Configuration"; |
1102 |
|
psh.nPages = DEC_DLG_COUNT; |
1103 |
|
psh.nStartPage = DEC_DLG_POSTPROC; |
1104 |
|
psh.ppsp = (LPCPROPSHEETPAGE)&psp; |
1105 |
|
psh.pfnCallback = NULL; |
1106 |
|
|
1107 |
|
PropertySheet(&psh); |
1108 |
|
|
1109 |
|
if (temp.save) |
1110 |
|
{ |
1111 |
|
memcpy(config, &temp, sizeof(CONFIG)); |
1112 |
|
} |
1113 |
|
} |
1114 |
|
|
1115 |
|
|
1116 |
|
|
1117 |
/* main dialog proc */ |
/* main dialog proc */ |
1118 |
|
|
1119 |
BOOL CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
BOOL CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
1136 |
SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed"); |
SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed"); |
1137 |
|
|
1138 |
SendDlgItemMessage(hDlg, IDC_MODE, CB_SETCURSEL, config->mode, 0); |
SendDlgItemMessage(hDlg, IDC_MODE, CB_SETCURSEL, config->mode, 0); |
|
SetDlgItemInt(hDlg, IDC_CBRBUFFER, config->rc_buffersize, FALSE); |
|
1139 |
|
|
1140 |
InitCommonControls(); |
InitCommonControls(); |
1141 |
|
|
1181 |
config_reg_set(config); |
config_reg_set(config); |
1182 |
} |
} |
1183 |
} |
} |
1184 |
|
else if (LOWORD(wParam) == IDC_DECODER && HIWORD(wParam) == BN_CLICKED) |
1185 |
|
{ |
1186 |
|
dec_dialog(hDlg, config); |
1187 |
|
|
1188 |
|
if (config->save) |
1189 |
|
{ |
1190 |
|
config_reg_set(config); |
1191 |
|
} |
1192 |
|
} |
1193 |
else if (LOWORD(wParam) == IDC_DEFAULTS && HIWORD(wParam) == BN_CLICKED) |
else if (LOWORD(wParam) == IDC_DEFAULTS && HIWORD(wParam) == BN_CLICKED) |
1194 |
{ |
{ |
1195 |
config_reg_default(config); |
config_reg_default(config); |
1196 |
|
|
1197 |
SendDlgItemMessage(hDlg, IDC_MODE, CB_SETCURSEL, config->mode, 0); |
SendDlgItemMessage(hDlg, IDC_MODE, CB_SETCURSEL, config->mode, 0); |
|
SetDlgItemInt(hDlg, IDC_CBRBUFFER, config->rc_buffersize, FALSE); |
|
1198 |
|
|
1199 |
main_slider(hDlg, config); |
main_slider(hDlg, config); |
1200 |
main_value(hDlg, config); |
main_value(hDlg, config); |
1201 |
} |
} |
1202 |
else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE) |
else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE) |
1203 |
{ |
{ |
1204 |
int value = config_get_int(hDlg, IDC_VALUE, 1); |
int value = config_get_uint(hDlg, IDC_VALUE, 1); |
1205 |
int max = 1; |
int max = 1; |
1206 |
|
|
1207 |
max = (config->mode == DLG_MODE_CBR) ? 10000 : |
max = (config->mode == DLG_MODE_CBR) ? 10000 : |
1273 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG"); |
1274 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom"); |
1275 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"Modulated"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"Modulated"); |
1276 |
|
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"New Modulated HQ"); |
1277 |
|
|
1278 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
1279 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
1280 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
1281 |
|
|
1282 |
|
SendDlgItemMessage(hDlg, IDC_VHQ, CB_ADDSTRING, 0, (LPARAM)"0 - Off"); |
1283 |
|
SendDlgItemMessage(hDlg, IDC_VHQ, CB_ADDSTRING, 0, (LPARAM)"1 - Mode Decision"); |
1284 |
|
SendDlgItemMessage(hDlg, IDC_VHQ, CB_ADDSTRING, 0, (LPARAM)"2 - Limited Search"); |
1285 |
|
SendDlgItemMessage(hDlg, IDC_VHQ, CB_ADDSTRING, 0, (LPARAM)"3 - Medium Search"); |
1286 |
|
SendDlgItemMessage(hDlg, IDC_VHQ, CB_ADDSTRING, 0, (LPARAM)"4 - Wide Search"); |
1287 |
|
/* XXX: reduced resolution is not ready for prime-time */ |
1288 |
|
ShowWindow(GetDlgItem(hDlg, IDC_REDUCED), SW_HIDE); |
1289 |
} |
} |
1290 |
else if (psi->page == DLG_2PASSALT) |
else if (psi->page == DLG_2PASSALT) |
1291 |
{ |
{ |
1293 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
1294 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
1295 |
} |
} |
1296 |
|
else if (psi->page == DLG_CPU) |
1297 |
|
{ |
1298 |
|
#ifndef _SMP |
1299 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
1300 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
1301 |
|
#endif |
1302 |
|
} |
1303 |
|
|
1304 |
if (hTooltip) |
if (hTooltip) |
1305 |
{ |
{ |
1315 |
{ |
{ |
1316 |
switch (LOWORD(wParam)) |
switch (LOWORD(wParam)) |
1317 |
{ |
{ |
1318 |
|
case IDC_HINTEDME : |
1319 |
case IDC_USEALT : |
case IDC_USEALT : |
1320 |
case IDC_USEAUTO : |
case IDC_USEAUTO : |
1321 |
case IDC_USEAUTOBONUS : |
case IDC_USEAUTOBONUS : |
1330 |
break; |
break; |
1331 |
} |
} |
1332 |
} |
} |
1333 |
if ((LOWORD(wParam) == IDC_STATS1_BROWSE || LOWORD(wParam) == IDC_STATS2_BROWSE) && HIWORD(wParam) == BN_CLICKED) |
if ((LOWORD(wParam) == IDC_HINT_BROWSE || LOWORD(wParam) == IDC_STATS1_BROWSE || LOWORD(wParam) == IDC_STATS2_BROWSE) && HIWORD(wParam) == BN_CLICKED) |
1334 |
{ |
{ |
1335 |
OPENFILENAME ofn; |
OPENFILENAME ofn; |
1336 |
char tmp[MAX_PATH]; |
char tmp[MAX_PATH]; |
1347 |
ofn.nMaxFile = MAX_PATH; |
ofn.nMaxFile = MAX_PATH; |
1348 |
ofn.Flags = OFN_PATHMUSTEXIST; |
ofn.Flags = OFN_PATHMUSTEXIST; |
1349 |
|
|
1350 |
// display save box for stats1 using 1st-pass |
if (LOWORD(wParam) == IDC_HINT_BROWSE) |
1351 |
if (LOWORD(wParam) == IDC_STATS1_BROWSE && |
{ |
1352 |
|
ofn.lpstrFilter = "motion hints (*.mvh)\0*.mvh\0All files (*.*)\0*.*\0\0"; |
1353 |
|
if (GetOpenFileName(&ofn)) |
1354 |
|
{ |
1355 |
|
SetDlgItemText(hDlg, IDC_HINTFILE, tmp); |
1356 |
|
} |
1357 |
|
} |
1358 |
|
else if (LOWORD(wParam) == IDC_STATS1_BROWSE && |
1359 |
psi->config->mode == DLG_MODE_2PASS_1) |
psi->config->mode == DLG_MODE_2PASS_1) |
1360 |
{ |
{ |
1361 |
ofn.Flags |= OFN_OVERWRITEPROMPT; |
ofn.Flags |= OFN_OVERWRITEPROMPT; |
1531 |
LOGFONT lfData; |
LOGFONT lfData; |
1532 |
|
|
1533 |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
1534 |
|
SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, XVID_SPECIAL_BUILD); |
1535 |
|
|
1536 |
|
init_param.cpu_flags = XVID_CPU_CHKONLY; |
1537 |
xvid_init(NULL, 0, &init_param, 0); |
xvid_init(NULL, 0, &init_param, 0); |
1538 |
wsprintf(core, "Core Version %d.%d", (init_param.api_version>>16),(init_param.api_version&0xFFFFU)); |
wsprintf(core, "Core Version %d.%d", (init_param.api_version>>16),(init_param.api_version&0xFFFFU)); |
1539 |
SetDlgItemText(hDlg, IDC_CORE, core); |
SetDlgItemText(hDlg, IDC_CORE, core); |