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> |
* 24.03.2002 daniel smith <danielsmith@astroboymail.com> |
35 |
* added Foxer's new CBR engine |
* added Foxer's new CBR engine |
36 |
* - cbr_buffer is being used as reaction delay (quick hack) |
* - cbr_buffer is being used as reaction delay (quick hack) |
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 "codec.h" |
#include "codec.h" |
67 |
#include "config.h" |
#include "config.h" |
69 |
#include "resource.h" |
#include "resource.h" |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
/* registry info structs */ |
/* registry info structs */ |
74 |
|
|
75 |
CONFIG reg; |
CONFIG reg; |
76 |
|
|
77 |
REG_INT const reg_ints[] = { |
REG_INT const reg_ints[] = { |
78 |
{"mode", ®.mode, DLG_MODE_CBR}, |
{"mode", ®.mode, DLG_MODE_CBR}, |
|
{"bitrate", ®.bitrate, 900000}, |
|
79 |
{"quality", ®.quality, 85}, |
{"quality", ®.quality, 85}, |
80 |
{"quant", ®.quant, 5}, |
{"quant", ®.quant, 5}, |
81 |
{"rc_buffersize", ®.rc_buffersize, 16}, |
{"rc_bitrate", ®.rc_bitrate, 900000}, |
82 |
|
{"rc_reaction_delay_factor",®.rc_reaction_delay_factor, 16}, |
83 |
|
{"rc_averaging_period", ®.rc_averaging_period, 100}, |
84 |
|
{"rc_buffer", ®.rc_buffer, 100}, |
85 |
|
|
86 |
{"motion_search", ®.motion_search, 5}, |
{"motion_search", ®.motion_search, 5}, |
87 |
{"quant_type", ®.quant_type, 0}, |
{"quant_type", ®.quant_type, 0}, |
88 |
{"fourcc_used", ®.fourcc_used, 0}, |
{"fourcc_used", ®.fourcc_used, 0}, |
89 |
{"max_key_interval", ®.max_key_interval, 300}, |
{"max_key_interval", ®.max_key_interval, 300}, |
90 |
|
{"min_key_interval", ®.min_key_interval, 1}, |
91 |
{"lum_masking", ®.lum_masking, 0}, |
{"lum_masking", ®.lum_masking, 0}, |
92 |
|
{"interlacing", ®.interlacing, 0}, |
93 |
|
#ifdef BFRAMES |
94 |
|
{"max_bframes", ®.max_bframes, -1}, |
95 |
|
{"bquant_ratio", ®.bquant_ratio, 200}, |
96 |
|
{"packed", ®.packed, 0}, |
97 |
|
{"dx50bvop", ®.dx50bvop, 0}, |
98 |
|
{"debug", ®.debug, 0}, |
99 |
|
#endif |
100 |
|
|
101 |
{"min_iquant", ®.min_iquant, 1}, |
{"min_iquant", ®.min_iquant, 1}, |
102 |
{"max_iquant", ®.max_iquant, 31}, |
{"max_iquant", ®.max_iquant, 31}, |
105 |
|
|
106 |
{"desired_size", ®.desired_size, 570000}, |
{"desired_size", ®.desired_size, 570000}, |
107 |
{"keyframe_boost", ®.keyframe_boost, 20}, |
{"keyframe_boost", ®.keyframe_boost, 20}, |
|
{"min_key_interval", ®.min_key_interval, 6}, |
|
108 |
{"discard1pass", ®.discard1pass, 1}, |
{"discard1pass", ®.discard1pass, 1}, |
109 |
{"dummy2pass", ®.dummy2pass, 0}, |
{"dummy2pass", ®.dummy2pass, 0}, |
110 |
{"curve_compression_high", ®.curve_compression_high, 25}, |
{"curve_compression_high", ®.curve_compression_high, 25}, |
120 |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
121 |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 240}, |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 240}, |
122 |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
123 |
|
{"twopass_max_bitrate", ®.twopass_max_bitrate, 10000 * CONFIG_KBPS}, |
124 |
|
{"twopass_max_overflow_improvement", ®.twopass_max_overflow_improvement, 60}, |
125 |
|
{"twopass_max_overflow_degradation", ®.twopass_max_overflow_degradation, 60}, |
126 |
|
{"hinted_me", ®.hinted_me, 0}, |
127 |
|
|
128 |
{"credits_start", ®.credits_start, 0}, |
{"credits_start", ®.credits_start, 0}, |
129 |
{"credits_start_begin", ®.credits_start_begin, 0}, |
{"credits_start_begin", ®.credits_start_begin, 0}, |
141 |
}; |
}; |
142 |
|
|
143 |
REG_STR const reg_strs[] = { |
REG_STR const reg_strs[] = { |
144 |
|
{"hintfile", reg.hintfile, CONFIG_HINTFILE}, |
145 |
{"stats1", reg.stats1, CONFIG_2PASS_1_FILE}, |
{"stats1", reg.stats1, CONFIG_2PASS_1_FILE}, |
146 |
{"stats2", reg.stats2, CONFIG_2PASS_2_FILE} |
{"stats2", reg.stats2, CONFIG_2PASS_2_FILE} |
147 |
// {"build", reg.build, XVID_BUILD} |
// {"build", reg.build, XVID_BUILD} |
158 |
XVID_INIT_PARAM init_param; |
XVID_INIT_PARAM init_param; |
159 |
int i; |
int i; |
160 |
|
|
161 |
init_param.cpu_flags = 0; |
init_param.cpu_flags = XVID_CPU_CHKONLY; |
162 |
xvid_init(0, 0, &init_param, NULL); |
xvid_init(0, 0, &init_param, NULL); |
163 |
config->cpu = init_param.cpu_flags; |
reg.cpu = init_param.cpu_flags; |
164 |
|
|
165 |
|
#ifdef _SMP |
166 |
|
reg.num_threads = pthread_num_processors_np(); |
167 |
|
#endif |
168 |
|
|
169 |
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); |
170 |
|
|
291 |
|
|
292 |
/* leaves current config value if dialog item is empty */ |
/* leaves current config value if dialog item is empty */ |
293 |
|
|
294 |
int config_get_int(HWND hDlg, UINT item, int config) |
int config_get_int(HWND hDlg, INT item, int config) |
295 |
|
{ |
296 |
|
BOOL success = FALSE; |
297 |
|
|
298 |
|
int tmp = GetDlgItemInt(hDlg, item, &success, TRUE); |
299 |
|
|
300 |
|
return (success) ? tmp : config; |
301 |
|
} |
302 |
|
|
303 |
|
|
304 |
|
int config_get_uint(HWND hDlg, UINT item, int config) |
305 |
{ |
{ |
306 |
BOOL success = FALSE; |
BOOL success = FALSE; |
307 |
|
|
319 |
{ |
{ |
320 |
default : |
default : |
321 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
322 |
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; |
323 |
break; |
break; |
324 |
|
|
325 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
326 |
config->quality = config_get_int(hDlg, IDC_VALUE, config->quality); |
config->quality = config_get_uint(hDlg, IDC_VALUE, config->quality); |
327 |
break; |
break; |
328 |
|
|
329 |
case DLG_MODE_VBR_QUANT : |
case DLG_MODE_VBR_QUANT : |
330 |
config->quant = config_get_int(hDlg, IDC_VALUE, config->quant); |
config->quant = config_get_uint(hDlg, IDC_VALUE, config->quant); |
331 |
break; |
break; |
332 |
|
|
333 |
case DLG_MODE_2PASS_2_INT : |
case DLG_MODE_2PASS_2_INT : |
334 |
config->desired_size = config_get_int(hDlg, IDC_VALUE, config->desired_size); |
config->desired_size = config_get_uint(hDlg, IDC_VALUE, config->desired_size); |
335 |
break; |
break; |
336 |
} |
} |
337 |
|
|
338 |
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); |
|
339 |
} |
} |
340 |
|
|
341 |
|
|
354 |
|
|
355 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
356 |
text = "Bitrate (Kbps):"; |
text = "Bitrate (Kbps):"; |
357 |
value = config->bitrate / CONFIG_KBPS; |
value = config->rc_bitrate / CONFIG_KBPS; |
358 |
break; |
break; |
359 |
|
|
360 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
378 |
|
|
379 |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled); |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled); |
380 |
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)); |
|
381 |
} |
} |
382 |
|
|
383 |
|
|
398 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
399 |
text = "Bitrate (Kbps):"; |
text = "Bitrate (Kbps):"; |
400 |
range = MAKELONG(0,10000); |
range = MAKELONG(0,10000); |
401 |
pos = config->bitrate / CONFIG_KBPS; |
pos = config->rc_bitrate / CONFIG_KBPS; |
402 |
break; |
break; |
403 |
|
|
404 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
485 |
void adv_mode(HWND hDlg, int mode) |
void adv_mode(HWND hDlg, int mode) |
486 |
{ |
{ |
487 |
// create arrays of controls to be disabled for each mode |
// create arrays of controls to be disabled for each mode |
488 |
const int cbr_disable[] = { |
const short twopass_disable[] = { |
489 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_KFBOOST, IDC_DUMMY2PASS, IDC_USEALT, |
490 |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
491 |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
IDC_STATS2, IDC_STATS2_BROWSE, |
492 |
|
}; |
493 |
|
|
494 |
|
const short cbr_disable[] = { |
495 |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
496 |
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, |
497 |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
498 |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
500 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
501 |
}; |
}; |
502 |
|
|
503 |
const int qual_disable[] = { |
const short qual_disable[] = { |
504 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
505 |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
|
506 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
507 |
}; |
}; |
508 |
|
|
509 |
const int quant_disable[] = { |
const short quant_disable[] = { |
510 |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
511 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
512 |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
|
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
|
|
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
|
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
|
513 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
514 |
}; |
}; |
515 |
|
|
516 |
const int twopass1_disable[] = { |
const short twopass1_disable[] = { |
517 |
IDC_LUMMASK, IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
518 |
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, |
|
519 |
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, |
520 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
521 |
}; |
}; |
522 |
|
|
523 |
const int twopass2_ext_disable[] = { |
const short twopass2_ext_disable[] = { |
524 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
525 |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, |
526 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
527 |
IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
528 |
}; |
}; |
529 |
|
|
530 |
const int twopass2_int_disable[] = { |
const short twopass2_int_disable[] = { |
531 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
532 |
IDC_STATS2, IDC_STATS2_BROWSE |
IDC_STATS2, IDC_STATS2_BROWSE |
533 |
}; |
}; |
534 |
|
|
535 |
// store pointers in order so we can lookup using config->mode |
// store pointers in order so we can lookup using config->mode |
536 |
const int* modes[] = { |
const short* modes[] = { |
537 |
cbr_disable, qual_disable, quant_disable, |
cbr_disable, qual_disable, quant_disable, |
538 |
twopass1_disable, twopass2_ext_disable, twopass2_int_disable |
twopass1_disable, twopass2_ext_disable, twopass2_int_disable |
539 |
}; |
}; |
540 |
|
|
541 |
// ditto modes[] |
// ditto modes[] |
542 |
const int lengths[] = { |
const int lengths[] = { |
543 |
sizeof(cbr_disable)/sizeof(int), sizeof(qual_disable)/sizeof(int), |
sizeof(cbr_disable)/sizeof(short), sizeof(qual_disable)/sizeof(short), |
544 |
sizeof(quant_disable)/sizeof(int), sizeof(twopass1_disable)/sizeof(int), |
sizeof(quant_disable)/sizeof(short), sizeof(twopass1_disable)/sizeof(short), |
545 |
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 |
546 |
}; |
}; |
547 |
|
|
548 |
int i; |
int i; |
549 |
|
int hinted_me, use_alt, use_alt_auto, use_alt_auto_bonus; |
550 |
|
int credits_start, credits_end, credits_rate, credits_quant, credits_size; |
551 |
|
int cpu_force; |
552 |
|
|
553 |
// first perform checkbox-based enable/disable |
// first perform checkbox-based enable/disable |
554 |
CONTROLDLG(IDC_USEAUTO, ISDLGSET(IDC_USEALT)); |
hinted_me = ISDLGSET(IDC_HINTEDME); |
555 |
CONTROLDLG(IDC_AUTOSTR, ISDLGSET(IDC_USEALT) && ISDLGSET(IDC_USEAUTO)); |
CONTROLDLG(IDC_HINTFILE, hinted_me); |
556 |
CONTROLDLG(IDC_USEAUTOBONUS, ISDLGSET(IDC_USEALT)); |
CONTROLDLG(IDC_HINT_BROWSE, hinted_me); |
557 |
CONTROLDLG(IDC_BONUSBIAS, (ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTOBONUS)))); |
|
558 |
CONTROLDLG(IDC_CURVETYPE, ISDLGSET(IDC_USEALT)); |
use_alt = ISDLGSET(IDC_USEALT) && (mode == DLG_MODE_2PASS_2_EXT || mode == DLG_MODE_2PASS_2_INT); |
559 |
CONTROLDLG(IDC_ALTCURVEHIGH, ISDLGSET(IDC_USEALT)); |
use_alt_auto = ISDLGSET(IDC_USEAUTO); |
560 |
CONTROLDLG(IDC_ALTCURVELOW, ISDLGSET(IDC_USEALT)); |
use_alt_auto_bonus = ISDLGSET(IDC_USEAUTOBONUS); |
561 |
CONTROLDLG(IDC_MINQUAL, ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTO))); |
CONTROLDLG(IDC_USEAUTO, use_alt); |
562 |
|
CONTROLDLG(IDC_AUTOSTR, use_alt && use_alt_auto); |
563 |
CONTROLDLG(IDC_CREDITS_START_BEGIN, ISDLGSET(IDC_CREDITS_START)); |
CONTROLDLG(IDC_USEAUTOBONUS, use_alt); |
564 |
CONTROLDLG(IDC_CREDITS_START_END, ISDLGSET(IDC_CREDITS_START)); |
CONTROLDLG(IDC_BONUSBIAS, use_alt && !use_alt_auto_bonus); |
565 |
|
CONTROLDLG(IDC_CURVETYPE, use_alt); |
566 |
CONTROLDLG(IDC_CREDITS_END_BEGIN, ISDLGSET(IDC_CREDITS_END)); |
CONTROLDLG(IDC_ALTCURVEHIGH, use_alt); |
567 |
CONTROLDLG(IDC_CREDITS_END_END, ISDLGSET(IDC_CREDITS_END)); |
CONTROLDLG(IDC_ALTCURVELOW, use_alt); |
568 |
|
CONTROLDLG(IDC_MINQUAL, use_alt && !use_alt_auto); |
569 |
CONTROLDLG(IDC_CREDITS_RATE, ISDLGSET(IDC_CREDITS_RATE_RADIO)); |
|
570 |
CONTROLDLG(IDC_CREDITS_QUANTI, ISDLGSET(IDC_CREDITS_QUANT_RADIO)); |
credits_start = ISDLGSET(IDC_CREDITS_START); |
571 |
CONTROLDLG(IDC_CREDITS_QUANTP, ISDLGSET(IDC_CREDITS_QUANT_RADIO)); |
CONTROLDLG(IDC_CREDITS_START_BEGIN, credits_start); |
572 |
CONTROLDLG(IDC_CREDITS_START_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO)); |
CONTROLDLG(IDC_CREDITS_START_END, credits_start); |
573 |
CONTROLDLG(IDC_CREDITS_END_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO)); |
|
574 |
|
credits_end = ISDLGSET(IDC_CREDITS_END); |
575 |
CONTROLDLG(IDC_CPU_MMX, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_END_BEGIN, credits_end); |
576 |
CONTROLDLG(IDC_CPU_MMXEXT, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_END_END, credits_end); |
577 |
CONTROLDLG(IDC_CPU_SSE, ISDLGSET(IDC_CPU_FORCE)); |
|
578 |
CONTROLDLG(IDC_CPU_SSE2, ISDLGSET(IDC_CPU_FORCE)); |
credits_rate = ISDLGSET(IDC_CREDITS_RATE_RADIO); |
579 |
CONTROLDLG(IDC_CPU_3DNOW, ISDLGSET(IDC_CPU_FORCE)); |
credits_quant = ISDLGSET(IDC_CREDITS_QUANT_RADIO); |
580 |
CONTROLDLG(IDC_CPU_3DNOWEXT, ISDLGSET(IDC_CPU_FORCE)); |
credits_size = ISDLGSET(IDC_CREDITS_SIZE_RADIO); |
581 |
|
CONTROLDLG(IDC_CREDITS_RATE, credits_rate); |
582 |
|
CONTROLDLG(IDC_CREDITS_QUANTI, credits_quant); |
583 |
|
CONTROLDLG(IDC_CREDITS_QUANTP, credits_quant); |
584 |
|
CONTROLDLG(IDC_CREDITS_START_SIZE, credits_size); |
585 |
|
CONTROLDLG(IDC_CREDITS_END_SIZE, credits_size); |
586 |
|
|
587 |
|
cpu_force = ISDLGSET(IDC_CPU_FORCE); |
588 |
|
CONTROLDLG(IDC_CPU_MMX, cpu_force); |
589 |
|
CONTROLDLG(IDC_CPU_MMXEXT, cpu_force); |
590 |
|
CONTROLDLG(IDC_CPU_SSE, cpu_force); |
591 |
|
CONTROLDLG(IDC_CPU_SSE2, cpu_force); |
592 |
|
CONTROLDLG(IDC_CPU_3DNOW, cpu_force); |
593 |
|
CONTROLDLG(IDC_CPU_3DNOWEXT, cpu_force); |
594 |
|
|
595 |
// now perform codec mode enable/disable |
// now perform codec mode enable/disable |
596 |
for (i=0 ; i<lengths[mode] ; ++i) |
for (i=0 ; i<lengths[mode] ; ++i) |
597 |
{ |
{ |
598 |
EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE); |
EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE); |
599 |
} |
} |
600 |
|
|
601 |
|
if (mode != DLG_MODE_2PASS_2_EXT && mode != DLG_MODE_2PASS_2_INT) |
602 |
|
{ |
603 |
|
for (i=0 ; i<sizeof(twopass_disable)/sizeof(short) ; ++i) |
604 |
|
{ |
605 |
|
EnableWindow(GetDlgItem(hDlg, twopass_disable[i]), FALSE); |
606 |
|
} |
607 |
|
} |
608 |
} |
} |
609 |
|
|
610 |
|
|
619 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
620 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0); |
621 |
SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE); |
SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE); |
622 |
|
SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE); |
623 |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
624 |
|
CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED); |
625 |
|
#ifdef BFRAMES |
626 |
|
SetDlgItemInt(hDlg, IDC_MAXBFRAMES, config->max_bframes, TRUE); |
627 |
|
SetDlgItemInt(hDlg, IDC_BQUANTRATIO, config->bquant_ratio, FALSE); |
628 |
|
CheckDlgButton(hDlg, IDC_PACKED, config->packed ? BST_CHECKED : BST_UNCHECKED); |
629 |
|
CheckDlgButton(hDlg, IDC_DX50BVOP, config->dx50bvop ? BST_CHECKED : BST_UNCHECKED); |
630 |
|
CheckDlgButton(hDlg, IDC_DEBUG, config->debug ? BST_CHECKED : BST_UNCHECKED); |
631 |
|
#endif |
632 |
break; |
break; |
633 |
|
|
634 |
case DLG_QUANT : |
case DLG_QUANT : |
640 |
|
|
641 |
case DLG_2PASS : |
case DLG_2PASS : |
642 |
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); |
|
643 |
CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED); |
644 |
CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED); |
645 |
|
|
649 |
CheckDlgButton(hDlg, IDC_PAYBACKBIAS, (config->bitrate_payback_method == 0)); |
CheckDlgButton(hDlg, IDC_PAYBACKBIAS, (config->bitrate_payback_method == 0)); |
650 |
CheckDlgButton(hDlg, IDC_PAYBACKPROP, (config->bitrate_payback_method == 1)); |
CheckDlgButton(hDlg, IDC_PAYBACKPROP, (config->bitrate_payback_method == 1)); |
651 |
|
|
652 |
|
CheckDlgButton(hDlg, IDC_HINTEDME, config->hinted_me ? BST_CHECKED : BST_UNCHECKED); |
653 |
|
SetDlgItemText(hDlg, IDC_HINTFILE, config->hintfile); |
654 |
SetDlgItemText(hDlg, IDC_STATS1, config->stats1); |
SetDlgItemText(hDlg, IDC_STATS1, config->stats1); |
655 |
SetDlgItemText(hDlg, IDC_STATS2, config->stats2); |
SetDlgItemText(hDlg, IDC_STATS2, config->stats2); |
656 |
break; |
break; |
668 |
|
|
669 |
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); |
670 |
SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE); |
SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE); |
671 |
|
|
672 |
|
SetDlgItemInt(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate / CONFIG_KBPS, FALSE); |
673 |
|
SetDlgItemInt(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement, FALSE); |
674 |
|
SetDlgItemInt(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation, FALSE); |
675 |
break; |
break; |
676 |
|
|
677 |
case DLG_CREDITS : |
case DLG_CREDITS : |
712 |
|
|
713 |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
714 |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
715 |
|
|
716 |
|
#ifdef _SMP |
717 |
|
SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); |
718 |
|
#endif |
719 |
|
|
720 |
|
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
721 |
|
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
722 |
|
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
723 |
break; |
break; |
724 |
} |
} |
725 |
} |
} |
739 |
config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0); |
config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0); |
740 |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
741 |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
742 |
config->max_key_interval = config_get_int(hDlg, IDC_MAXKEY, config->max_key_interval); |
config->max_key_interval = config_get_uint(hDlg, IDC_MAXKEY, config->max_key_interval); |
743 |
|
config->min_key_interval = config_get_uint(hDlg, IDC_MINKEY, config->min_key_interval); |
744 |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
745 |
|
config->interlacing = ISDLGSET(IDC_INTERLACING); |
746 |
|
#ifdef BFRAMES |
747 |
|
config->max_bframes = config_get_int(hDlg, IDC_MAXBFRAMES, config->max_bframes); |
748 |
|
config->bquant_ratio = config_get_uint(hDlg, IDC_BQUANTRATIO, config->bquant_ratio); |
749 |
|
config->packed = ISDLGSET(IDC_PACKED); |
750 |
|
config->dx50bvop = ISDLGSET(IDC_DX50BVOP); |
751 |
|
config->debug = ISDLGSET(IDC_DEBUG); |
752 |
|
#endif |
753 |
break; |
break; |
754 |
|
|
755 |
case DLG_QUANT : |
case DLG_QUANT : |
756 |
config->min_iquant = config_get_int(hDlg, IDC_MINIQUANT, config->min_iquant); |
config->min_iquant = config_get_uint(hDlg, IDC_MINIQUANT, config->min_iquant); |
757 |
config->max_iquant = config_get_int(hDlg, IDC_MAXIQUANT, config->max_iquant); |
config->max_iquant = config_get_uint(hDlg, IDC_MAXIQUANT, config->max_iquant); |
758 |
config->min_pquant = config_get_int(hDlg, IDC_MINPQUANT, config->min_pquant); |
config->min_pquant = config_get_uint(hDlg, IDC_MINPQUANT, config->min_pquant); |
759 |
config->max_pquant = config_get_int(hDlg, IDC_MAXPQUANT, config->max_pquant); |
config->max_pquant = config_get_uint(hDlg, IDC_MAXPQUANT, config->max_pquant); |
760 |
|
|
761 |
CONSTRAINVAL(config->min_iquant, 1, 31); |
CONSTRAINVAL(config->min_iquant, 1, 31); |
762 |
CONSTRAINVAL(config->max_iquant, config->min_iquant, 31); |
CONSTRAINVAL(config->max_iquant, config->min_iquant, 31); |
766 |
|
|
767 |
case DLG_2PASS : |
case DLG_2PASS : |
768 |
config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE); |
config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE); |
|
config->min_key_interval = config_get_int(hDlg, IDC_MINKEY, config->min_key_interval); |
|
769 |
config->discard1pass = ISDLGSET(IDC_DISCARD1PASS); |
config->discard1pass = ISDLGSET(IDC_DISCARD1PASS); |
770 |
config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS); |
config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS); |
771 |
config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE); |
config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE); |
772 |
config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE); |
config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE); |
773 |
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); |
774 |
config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP); |
config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP); |
775 |
|
config->hinted_me = ISDLGSET(IDC_HINTEDME); |
776 |
|
|
777 |
|
if (GetDlgItemText(hDlg, IDC_HINTFILE, config->hintfile, MAX_PATH) == 0) |
778 |
|
{ |
779 |
|
lstrcpy(config->hintfile, CONFIG_HINTFILE); |
780 |
|
} |
781 |
if (GetDlgItemText(hDlg, IDC_STATS1, config->stats1, MAX_PATH) == 0) |
if (GetDlgItemText(hDlg, IDC_STATS1, config->stats1, MAX_PATH) == 0) |
782 |
{ |
{ |
783 |
lstrcpy(config->stats1, CONFIG_2PASS_1_FILE); |
lstrcpy(config->stats1, CONFIG_2PASS_1_FILE); |
797 |
config->use_alt_curve = ISDLGSET(IDC_USEALT); |
config->use_alt_curve = ISDLGSET(IDC_USEALT); |
798 |
|
|
799 |
config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO); |
config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO); |
800 |
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); |
801 |
|
|
802 |
config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS); |
config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS); |
803 |
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); |
804 |
|
|
805 |
config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0); |
config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0); |
806 |
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); |
807 |
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); |
808 |
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); |
809 |
|
|
810 |
|
config->twopass_max_bitrate /= CONFIG_KBPS; |
811 |
|
config->twopass_max_bitrate = config_get_uint(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate); |
812 |
|
config->twopass_max_bitrate *= CONFIG_KBPS; |
813 |
|
config->twopass_max_overflow_improvement = config_get_uint(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement); |
814 |
|
config->twopass_max_overflow_degradation = config_get_uint(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation); |
815 |
|
|
816 |
|
CONSTRAINVAL(config->twopass_max_overflow_improvement, 1, 80); |
817 |
|
CONSTRAINVAL(config->twopass_max_overflow_degradation, 1, 80); |
818 |
break; |
break; |
819 |
|
|
820 |
case DLG_CREDITS : |
case DLG_CREDITS : |
821 |
config->credits_start = ISDLGSET(IDC_CREDITS_START); |
config->credits_start = ISDLGSET(IDC_CREDITS_START); |
822 |
config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE); |
config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE); |
823 |
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); |
824 |
config->credits_end = ISDLGSET(IDC_CREDITS_END); |
config->credits_end = ISDLGSET(IDC_CREDITS_END); |
825 |
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); |
826 |
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); |
827 |
|
|
828 |
config->credits_rate = config_get_int(hDlg, IDC_CREDITS_RATE, config->credits_rate); |
config->credits_rate = config_get_uint(hDlg, IDC_CREDITS_RATE, config->credits_rate); |
829 |
config->credits_quant_i = config_get_int(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i); |
config->credits_quant_i = config_get_uint(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i); |
830 |
config->credits_quant_p = config_get_int(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p); |
config->credits_quant_p = config_get_uint(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p); |
831 |
config->credits_start_size = config_get_int(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size); |
config->credits_start_size = config_get_uint(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size); |
832 |
config->credits_end_size = config_get_int(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size); |
config->credits_end_size = config_get_uint(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size); |
833 |
|
|
834 |
config->credits_mode = 0; |
config->credits_mode = 0; |
835 |
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; |
861 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0; |
862 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
863 |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
864 |
|
|
865 |
|
#ifdef _SMP |
866 |
|
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
867 |
|
#endif |
868 |
|
|
869 |
|
config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor); |
870 |
|
config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period); |
871 |
|
config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer); |
872 |
break; |
break; |
873 |
} |
} |
874 |
} |
} |
894 |
{ |
{ |
895 |
int temp; |
int temp; |
896 |
|
|
897 |
temp = config_get_int(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]); |
temp = config_get_uint(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]); |
898 |
CONSTRAINVAL(temp, 1, 255); |
CONSTRAINVAL(temp, 1, 255); |
899 |
temp = config->qmatrix_intra[i]; |
config->qmatrix_intra[i] = temp; |
900 |
|
|
901 |
temp = config_get_int(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]); |
temp = config_get_uint(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]); |
902 |
CONSTRAINVAL(temp, 1, 255); |
CONSTRAINVAL(temp, 1, 255); |
903 |
temp = config->qmatrix_inter[i]; |
config->qmatrix_inter[i] = temp; |
904 |
} |
} |
905 |
} |
} |
906 |
|
|
950 |
SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed"); |
SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed"); |
951 |
|
|
952 |
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); |
|
953 |
|
|
954 |
InitCommonControls(); |
InitCommonControls(); |
955 |
|
|
1000 |
config_reg_default(config); |
config_reg_default(config); |
1001 |
|
|
1002 |
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); |
|
1003 |
|
|
1004 |
main_slider(hDlg, config); |
main_slider(hDlg, config); |
1005 |
main_value(hDlg, config); |
main_value(hDlg, config); |
1006 |
} |
} |
1007 |
else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE) |
else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE) |
1008 |
{ |
{ |
1009 |
int value = config_get_int(hDlg, IDC_VALUE, 1); |
int value = config_get_uint(hDlg, IDC_VALUE, 1); |
1010 |
int max = 1; |
int max = 1; |
1011 |
|
|
1012 |
max = (config->mode == DLG_MODE_CBR) ? 10000 : |
max = (config->mode == DLG_MODE_CBR) ? 10000 : |
1082 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
1083 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
1084 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
1085 |
|
|
1086 |
|
#ifndef BFRAMES |
1087 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC1), FALSE); |
1088 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC2), FALSE); |
1089 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC3), FALSE); |
1090 |
|
EnableWindow(GetDlgItem(hDlg, IDC_MAXBFRAMES), FALSE); |
1091 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BQUANTRATIO), FALSE); |
1092 |
|
EnableWindow(GetDlgItem(hDlg, IDC_PACKED), FALSE); |
1093 |
|
EnableWindow(GetDlgItem(hDlg, IDC_DX50BVOP), FALSE); |
1094 |
|
EnableWindow(GetDlgItem(hDlg, IDC_DEBUG), FALSE); |
1095 |
|
#endif |
1096 |
} |
} |
1097 |
else if (psi->page == DLG_2PASSALT) |
else if (psi->page == DLG_2PASSALT) |
1098 |
{ |
{ |
1100 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
1101 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
1102 |
} |
} |
1103 |
|
#ifndef _SMP |
1104 |
|
else if (psi->page == DLG_CPU) |
1105 |
|
{ |
1106 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
1107 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
1108 |
|
} |
1109 |
|
#endif |
1110 |
|
|
1111 |
if (hTooltip) |
if (hTooltip) |
1112 |
{ |
{ |
1122 |
{ |
{ |
1123 |
switch (LOWORD(wParam)) |
switch (LOWORD(wParam)) |
1124 |
{ |
{ |
1125 |
|
case IDC_HINTEDME : |
1126 |
case IDC_USEALT : |
case IDC_USEALT : |
1127 |
case IDC_USEAUTO : |
case IDC_USEAUTO : |
1128 |
case IDC_USEAUTOBONUS : |
case IDC_USEAUTOBONUS : |
1137 |
break; |
break; |
1138 |
} |
} |
1139 |
} |
} |
1140 |
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) |
1141 |
{ |
{ |
1142 |
OPENFILENAME ofn; |
OPENFILENAME ofn; |
1143 |
char tmp[MAX_PATH]; |
char tmp[MAX_PATH]; |
1154 |
ofn.nMaxFile = MAX_PATH; |
ofn.nMaxFile = MAX_PATH; |
1155 |
ofn.Flags = OFN_PATHMUSTEXIST; |
ofn.Flags = OFN_PATHMUSTEXIST; |
1156 |
|
|
1157 |
// display save box for stats1 using 1st-pass |
if (LOWORD(wParam) == IDC_HINT_BROWSE) |
1158 |
if (LOWORD(wParam) == IDC_STATS1_BROWSE && |
{ |
1159 |
|
ofn.lpstrFilter = "motion hints (*.mvh)\0*.mvh\0All files (*.*)\0*.*\0\0"; |
1160 |
|
if (GetOpenFileName(&ofn)) |
1161 |
|
{ |
1162 |
|
SetDlgItemText(hDlg, IDC_HINTFILE, tmp); |
1163 |
|
} |
1164 |
|
} |
1165 |
|
else if (LOWORD(wParam) == IDC_STATS1_BROWSE && |
1166 |
psi->config->mode == DLG_MODE_2PASS_1) |
psi->config->mode == DLG_MODE_2PASS_1) |
1167 |
{ |
{ |
1168 |
ofn.Flags |= OFN_OVERWRITEPROMPT; |
ofn.Flags |= OFN_OVERWRITEPROMPT; |
1339 |
|
|
1340 |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
1341 |
|
|
1342 |
|
init_param.cpu_flags = XVID_CPU_CHKONLY; |
1343 |
xvid_init(NULL, 0, &init_param, 0); |
xvid_init(NULL, 0, &init_param, 0); |
1344 |
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)); |
1345 |
SetDlgItemText(hDlg, IDC_CORE, core); |
SetDlgItemText(hDlg, IDC_CORE, core); |