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 |
* 04.04.2002 interlacing support |
33 |
* hinted ME support |
* hinted ME support |
34 |
* 24.03.2002 daniel smith <danielsmith@astroboymail.com> |
* 24.03.2002 daniel smith <danielsmith@astroboymail.com> |
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}, |
{"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 |
|
{"frame_drop_ratio", ®.frame_drop_ratio, 0}, |
100 |
|
#endif |
101 |
|
|
102 |
{"min_iquant", ®.min_iquant, 1}, |
{"min_iquant", ®.min_iquant, 1}, |
103 |
{"max_iquant", ®.max_iquant, 31}, |
{"max_iquant", ®.max_iquant, 31}, |
106 |
|
|
107 |
{"desired_size", ®.desired_size, 570000}, |
{"desired_size", ®.desired_size, 570000}, |
108 |
{"keyframe_boost", ®.keyframe_boost, 20}, |
{"keyframe_boost", ®.keyframe_boost, 20}, |
|
{"min_key_interval", ®.min_key_interval, 6}, |
|
109 |
{"discard1pass", ®.discard1pass, 1}, |
{"discard1pass", ®.discard1pass, 1}, |
110 |
{"dummy2pass", ®.dummy2pass, 0}, |
{"dummy2pass", ®.dummy2pass, 0}, |
111 |
|
// added by koepi for new two-pass curve treatment |
112 |
|
{"kftreshold", ®.kftreshold, 10}, |
113 |
|
{"kfreduction", ®.kfreduction, 30}, |
114 |
|
// end of koepi's additions |
115 |
{"curve_compression_high", ®.curve_compression_high, 25}, |
{"curve_compression_high", ®.curve_compression_high, 25}, |
116 |
{"curve_compression_low", ®.curve_compression_low, 10}, |
{"curve_compression_low", ®.curve_compression_low, 10}, |
117 |
{"use_alt_curve", ®.use_alt_curve, 0}, |
{"use_alt_curve", ®.use_alt_curve, 0}, |
125 |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
126 |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 240}, |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 240}, |
127 |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
128 |
|
{"twopass_max_bitrate", ®.twopass_max_bitrate, 10000 * CONFIG_KBPS}, |
129 |
|
{"twopass_max_overflow_improvement", ®.twopass_max_overflow_improvement, 60}, |
130 |
|
{"twopass_max_overflow_degradation", ®.twopass_max_overflow_degradation, 60}, |
131 |
{"hinted_me", ®.hinted_me, 0}, |
{"hinted_me", ®.hinted_me, 0}, |
132 |
|
|
133 |
{"credits_start", ®.credits_start, 0}, |
{"credits_start", ®.credits_start, 0}, |
163 |
XVID_INIT_PARAM init_param; |
XVID_INIT_PARAM init_param; |
164 |
int i; |
int i; |
165 |
|
|
166 |
init_param.cpu_flags = 0; |
init_param.cpu_flags = XVID_CPU_CHKONLY; |
167 |
xvid_init(0, 0, &init_param, NULL); |
xvid_init(0, 0, &init_param, NULL); |
168 |
config->cpu = init_param.cpu_flags; |
reg.cpu = init_param.cpu_flags; |
169 |
|
|
170 |
|
#ifdef _SMP |
171 |
|
reg.num_threads = pthread_num_processors_np(); |
172 |
|
#endif |
173 |
|
|
174 |
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); |
175 |
|
|
296 |
|
|
297 |
/* leaves current config value if dialog item is empty */ |
/* leaves current config value if dialog item is empty */ |
298 |
|
|
299 |
int config_get_int(HWND hDlg, UINT item, int config) |
int config_get_int(HWND hDlg, INT item, int config) |
300 |
|
{ |
301 |
|
BOOL success = FALSE; |
302 |
|
|
303 |
|
int tmp = GetDlgItemInt(hDlg, item, &success, TRUE); |
304 |
|
|
305 |
|
return (success) ? tmp : config; |
306 |
|
} |
307 |
|
|
308 |
|
|
309 |
|
int config_get_uint(HWND hDlg, UINT item, int config) |
310 |
{ |
{ |
311 |
BOOL success = FALSE; |
BOOL success = FALSE; |
312 |
|
|
324 |
{ |
{ |
325 |
default : |
default : |
326 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
327 |
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; |
328 |
break; |
break; |
329 |
|
|
330 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
331 |
config->quality = config_get_int(hDlg, IDC_VALUE, config->quality); |
config->quality = config_get_uint(hDlg, IDC_VALUE, config->quality); |
332 |
break; |
break; |
333 |
|
|
334 |
case DLG_MODE_VBR_QUANT : |
case DLG_MODE_VBR_QUANT : |
335 |
config->quant = config_get_int(hDlg, IDC_VALUE, config->quant); |
config->quant = config_get_uint(hDlg, IDC_VALUE, config->quant); |
336 |
break; |
break; |
337 |
|
|
338 |
case DLG_MODE_2PASS_2_INT : |
case DLG_MODE_2PASS_2_INT : |
339 |
config->desired_size = config_get_int(hDlg, IDC_VALUE, config->desired_size); |
config->desired_size = config_get_uint(hDlg, IDC_VALUE, config->desired_size); |
340 |
break; |
break; |
341 |
} |
} |
342 |
|
|
343 |
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); |
|
344 |
} |
} |
345 |
|
|
346 |
|
|
359 |
|
|
360 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
361 |
text = "Bitrate (Kbps):"; |
text = "Bitrate (Kbps):"; |
362 |
value = config->bitrate / CONFIG_KBPS; |
value = config->rc_bitrate / CONFIG_KBPS; |
363 |
break; |
break; |
364 |
|
|
365 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
383 |
|
|
384 |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled); |
EnableWindow(GetDlgItem(hDlg, IDC_VALUE_STATIC), enabled); |
385 |
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)); |
|
386 |
} |
} |
387 |
|
|
388 |
|
|
403 |
case DLG_MODE_CBR : |
case DLG_MODE_CBR : |
404 |
text = "Bitrate (Kbps):"; |
text = "Bitrate (Kbps):"; |
405 |
range = MAKELONG(0,10000); |
range = MAKELONG(0,10000); |
406 |
pos = config->bitrate / CONFIG_KBPS; |
pos = config->rc_bitrate / CONFIG_KBPS; |
407 |
break; |
break; |
408 |
|
|
409 |
case DLG_MODE_VBR_QUAL : |
case DLG_MODE_VBR_QUAL : |
490 |
void adv_mode(HWND hDlg, int mode) |
void adv_mode(HWND hDlg, int mode) |
491 |
{ |
{ |
492 |
// create arrays of controls to be disabled for each mode |
// create arrays of controls to be disabled for each mode |
493 |
const int cbr_disable[] = { |
const short twopass_disable[] = { |
494 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_KFBOOST, IDC_DUMMY2PASS, IDC_USEALT, |
495 |
|
// added by koepi for new curve treatment |
496 |
|
IDC_KFTRESHOLD, IDC_KFREDUCTION, |
497 |
|
//end of koepi's additions |
498 |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP, |
499 |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_STATS2, IDC_STATS2_BROWSE, |
IDC_STATS2, IDC_STATS2_BROWSE, |
500 |
|
}; |
501 |
|
|
502 |
|
const short cbr_disable[] = { |
503 |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
504 |
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, |
505 |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
506 |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
508 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
509 |
}; |
}; |
510 |
|
|
511 |
const int qual_disable[] = { |
const short qual_disable[] = { |
512 |
IDC_KFBOOST, IDC_MINKEY, IDC_DISCARD1PASS, IDC_DUMMY2PASS, |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
513 |
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, |
|
514 |
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 |
515 |
}; |
}; |
516 |
|
|
517 |
const int quant_disable[] = { |
const short quant_disable[] = { |
518 |
|
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
519 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
520 |
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, |
|
521 |
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 |
522 |
}; |
}; |
523 |
|
|
524 |
const int twopass1_disable[] = { |
const short twopass1_disable[] = { |
525 |
IDC_LUMMASK, IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
526 |
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, |
|
527 |
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, |
528 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
529 |
}; |
}; |
530 |
|
|
531 |
const int twopass2_ext_disable[] = { |
const short twopass2_ext_disable[] = { |
532 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
533 |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, |
534 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
535 |
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 |
536 |
}; |
}; |
537 |
|
|
538 |
const int twopass2_int_disable[] = { |
const short twopass2_int_disable[] = { |
539 |
|
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
540 |
IDC_STATS2, IDC_STATS2_BROWSE |
IDC_STATS2, IDC_STATS2_BROWSE |
541 |
}; |
}; |
542 |
|
|
543 |
// store pointers in order so we can lookup using config->mode |
// store pointers in order so we can lookup using config->mode |
544 |
const int* modes[] = { |
const short* modes[] = { |
545 |
cbr_disable, qual_disable, quant_disable, |
cbr_disable, qual_disable, quant_disable, |
546 |
twopass1_disable, twopass2_ext_disable, twopass2_int_disable |
twopass1_disable, twopass2_ext_disable, twopass2_int_disable |
547 |
}; |
}; |
548 |
|
|
549 |
// ditto modes[] |
// ditto modes[] |
550 |
const int lengths[] = { |
const int lengths[] = { |
551 |
sizeof(cbr_disable)/sizeof(int), sizeof(qual_disable)/sizeof(int), |
sizeof(cbr_disable)/sizeof(short), sizeof(qual_disable)/sizeof(short), |
552 |
sizeof(quant_disable)/sizeof(int), sizeof(twopass1_disable)/sizeof(int), |
sizeof(quant_disable)/sizeof(short), sizeof(twopass1_disable)/sizeof(short), |
553 |
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 |
554 |
}; |
}; |
555 |
|
|
556 |
int i; |
int i; |
557 |
|
int hinted_me, use_alt, use_alt_auto, use_alt_auto_bonus; |
558 |
|
int credits_start, credits_end, credits_rate, credits_quant, credits_size; |
559 |
|
int cpu_force; |
560 |
|
|
561 |
// first perform checkbox-based enable/disable |
// first perform checkbox-based enable/disable |
562 |
CONTROLDLG(IDC_HINTFILE, ISDLGSET(IDC_HINTEDME)); |
hinted_me = ISDLGSET(IDC_HINTEDME); |
563 |
CONTROLDLG(IDC_HINT_BROWSE, ISDLGSET(IDC_HINTEDME)); |
CONTROLDLG(IDC_HINTFILE, hinted_me); |
564 |
|
CONTROLDLG(IDC_HINT_BROWSE, hinted_me); |
565 |
CONTROLDLG(IDC_USEAUTO, ISDLGSET(IDC_USEALT)); |
|
566 |
CONTROLDLG(IDC_AUTOSTR, ISDLGSET(IDC_USEALT) && ISDLGSET(IDC_USEAUTO)); |
use_alt = ISDLGSET(IDC_USEALT) && (mode == DLG_MODE_2PASS_2_EXT || mode == DLG_MODE_2PASS_2_INT); |
567 |
CONTROLDLG(IDC_USEAUTOBONUS, ISDLGSET(IDC_USEALT)); |
use_alt_auto = ISDLGSET(IDC_USEAUTO); |
568 |
CONTROLDLG(IDC_BONUSBIAS, (ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTOBONUS)))); |
use_alt_auto_bonus = ISDLGSET(IDC_USEAUTOBONUS); |
569 |
CONTROLDLG(IDC_CURVETYPE, ISDLGSET(IDC_USEALT)); |
CONTROLDLG(IDC_USEAUTO, use_alt); |
570 |
CONTROLDLG(IDC_ALTCURVEHIGH, ISDLGSET(IDC_USEALT)); |
CONTROLDLG(IDC_AUTOSTR, use_alt && use_alt_auto); |
571 |
CONTROLDLG(IDC_ALTCURVELOW, ISDLGSET(IDC_USEALT)); |
CONTROLDLG(IDC_USEAUTOBONUS, use_alt); |
572 |
CONTROLDLG(IDC_MINQUAL, ISDLGSET(IDC_USEALT) && !(ISDLGSET(IDC_USEAUTO))); |
CONTROLDLG(IDC_BONUSBIAS, use_alt && !use_alt_auto_bonus); |
573 |
|
CONTROLDLG(IDC_CURVETYPE, use_alt); |
574 |
CONTROLDLG(IDC_CREDITS_START_BEGIN, ISDLGSET(IDC_CREDITS_START)); |
CONTROLDLG(IDC_ALTCURVEHIGH, use_alt); |
575 |
CONTROLDLG(IDC_CREDITS_START_END, ISDLGSET(IDC_CREDITS_START)); |
CONTROLDLG(IDC_ALTCURVELOW, use_alt); |
576 |
|
CONTROLDLG(IDC_MINQUAL, use_alt && !use_alt_auto); |
577 |
CONTROLDLG(IDC_CREDITS_END_BEGIN, ISDLGSET(IDC_CREDITS_END)); |
|
578 |
CONTROLDLG(IDC_CREDITS_END_END, ISDLGSET(IDC_CREDITS_END)); |
credits_start = ISDLGSET(IDC_CREDITS_START); |
579 |
|
CONTROLDLG(IDC_CREDITS_START_BEGIN, credits_start); |
580 |
CONTROLDLG(IDC_CREDITS_RATE, ISDLGSET(IDC_CREDITS_RATE_RADIO)); |
CONTROLDLG(IDC_CREDITS_START_END, credits_start); |
581 |
CONTROLDLG(IDC_CREDITS_QUANTI, ISDLGSET(IDC_CREDITS_QUANT_RADIO)); |
|
582 |
CONTROLDLG(IDC_CREDITS_QUANTP, ISDLGSET(IDC_CREDITS_QUANT_RADIO)); |
credits_end = ISDLGSET(IDC_CREDITS_END); |
583 |
CONTROLDLG(IDC_CREDITS_START_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO)); |
CONTROLDLG(IDC_CREDITS_END_BEGIN, credits_end); |
584 |
CONTROLDLG(IDC_CREDITS_END_SIZE, ISDLGSET(IDC_CREDITS_SIZE_RADIO)); |
CONTROLDLG(IDC_CREDITS_END_END, credits_end); |
585 |
|
|
586 |
CONTROLDLG(IDC_CPU_MMX, ISDLGSET(IDC_CPU_FORCE)); |
credits_rate = ISDLGSET(IDC_CREDITS_RATE_RADIO); |
587 |
CONTROLDLG(IDC_CPU_MMXEXT, ISDLGSET(IDC_CPU_FORCE)); |
credits_quant = ISDLGSET(IDC_CREDITS_QUANT_RADIO); |
588 |
CONTROLDLG(IDC_CPU_SSE, ISDLGSET(IDC_CPU_FORCE)); |
credits_size = ISDLGSET(IDC_CREDITS_SIZE_RADIO); |
589 |
CONTROLDLG(IDC_CPU_SSE2, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_RATE, credits_rate); |
590 |
CONTROLDLG(IDC_CPU_3DNOW, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_QUANTI, credits_quant); |
591 |
CONTROLDLG(IDC_CPU_3DNOWEXT, ISDLGSET(IDC_CPU_FORCE)); |
CONTROLDLG(IDC_CREDITS_QUANTP, credits_quant); |
592 |
|
CONTROLDLG(IDC_CREDITS_START_SIZE, credits_size); |
593 |
|
CONTROLDLG(IDC_CREDITS_END_SIZE, credits_size); |
594 |
|
|
595 |
|
cpu_force = ISDLGSET(IDC_CPU_FORCE); |
596 |
|
CONTROLDLG(IDC_CPU_MMX, cpu_force); |
597 |
|
CONTROLDLG(IDC_CPU_MMXEXT, cpu_force); |
598 |
|
CONTROLDLG(IDC_CPU_SSE, cpu_force); |
599 |
|
CONTROLDLG(IDC_CPU_SSE2, cpu_force); |
600 |
|
CONTROLDLG(IDC_CPU_3DNOW, cpu_force); |
601 |
|
CONTROLDLG(IDC_CPU_3DNOWEXT, cpu_force); |
602 |
|
|
603 |
// now perform codec mode enable/disable |
// now perform codec mode enable/disable |
604 |
for (i=0 ; i<lengths[mode] ; ++i) |
for (i=0 ; i<lengths[mode] ; ++i) |
605 |
{ |
{ |
606 |
EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE); |
EnableWindow(GetDlgItem(hDlg, modes[mode][i]), FALSE); |
607 |
} |
} |
608 |
|
|
609 |
|
if (mode != DLG_MODE_2PASS_2_EXT && mode != DLG_MODE_2PASS_2_INT) |
610 |
|
{ |
611 |
|
for (i=0 ; i<sizeof(twopass_disable)/sizeof(short) ; ++i) |
612 |
|
{ |
613 |
|
EnableWindow(GetDlgItem(hDlg, twopass_disable[i]), FALSE); |
614 |
|
} |
615 |
|
} |
616 |
} |
} |
617 |
|
|
618 |
|
|
627 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
628 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_SETCURSEL, config->fourcc_used, 0); |
629 |
SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE); |
SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE); |
630 |
|
SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE); |
631 |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
632 |
CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED); |
633 |
|
#ifdef BFRAMES |
634 |
|
SetDlgItemInt(hDlg, IDC_MAXBFRAMES, config->max_bframes, TRUE); |
635 |
|
SetDlgItemInt(hDlg, IDC_BQUANTRATIO, config->bquant_ratio, FALSE); |
636 |
|
CheckDlgButton(hDlg, IDC_PACKED, config->packed ? BST_CHECKED : BST_UNCHECKED); |
637 |
|
CheckDlgButton(hDlg, IDC_DX50BVOP, config->dx50bvop ? BST_CHECKED : BST_UNCHECKED); |
638 |
|
CheckDlgButton(hDlg, IDC_DEBUG, config->debug ? BST_CHECKED : BST_UNCHECKED); |
639 |
|
#endif |
640 |
break; |
break; |
641 |
|
|
642 |
case DLG_QUANT : |
case DLG_QUANT : |
648 |
|
|
649 |
case DLG_2PASS : |
case DLG_2PASS : |
650 |
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); |
|
651 |
CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED); |
652 |
CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED); |
653 |
|
// added by koepi for new 2pass curve treatment |
654 |
|
SetDlgItemInt(hDlg, IDC_KFTRESHOLD, config->kftreshold, FALSE); |
655 |
|
SetDlgItemInt(hDlg, IDC_KFREDUCTION, config->kfreduction, FALSE); |
656 |
|
// end of koepi's additions |
657 |
SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE); |
SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE); |
658 |
SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE); |
SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE); |
659 |
SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE); |
SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE); |
679 |
|
|
680 |
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); |
681 |
SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE); |
SetDlgItemInt(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias, FALSE); |
682 |
|
|
683 |
|
SetDlgItemInt(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate / CONFIG_KBPS, FALSE); |
684 |
|
SetDlgItemInt(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement, FALSE); |
685 |
|
SetDlgItemInt(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation, FALSE); |
686 |
break; |
break; |
687 |
|
|
688 |
case DLG_CREDITS : |
case DLG_CREDITS : |
723 |
|
|
724 |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
725 |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
726 |
|
|
727 |
|
#ifdef _SMP |
728 |
|
SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); |
729 |
|
#endif |
730 |
|
|
731 |
|
#ifdef BFRAMES |
732 |
|
SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE); |
733 |
|
#endif |
734 |
|
|
735 |
|
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
736 |
|
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
737 |
|
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
738 |
break; |
break; |
739 |
} |
} |
740 |
} |
} |
754 |
config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0); |
config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0); |
755 |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
756 |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
757 |
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); |
758 |
|
config->min_key_interval = config_get_uint(hDlg, IDC_MINKEY, config->min_key_interval); |
759 |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
760 |
config->interlacing = ISDLGSET(IDC_INTERLACING); |
config->interlacing = ISDLGSET(IDC_INTERLACING); |
761 |
|
#ifdef BFRAMES |
762 |
|
config->max_bframes = config_get_int(hDlg, IDC_MAXBFRAMES, config->max_bframes); |
763 |
|
config->bquant_ratio = config_get_uint(hDlg, IDC_BQUANTRATIO, config->bquant_ratio); |
764 |
|
config->packed = ISDLGSET(IDC_PACKED); |
765 |
|
config->dx50bvop = ISDLGSET(IDC_DX50BVOP); |
766 |
|
config->debug = ISDLGSET(IDC_DEBUG); |
767 |
|
#endif |
768 |
break; |
break; |
769 |
|
|
770 |
case DLG_QUANT : |
case DLG_QUANT : |
771 |
config->min_iquant = config_get_int(hDlg, IDC_MINIQUANT, config->min_iquant); |
config->min_iquant = config_get_uint(hDlg, IDC_MINIQUANT, config->min_iquant); |
772 |
config->max_iquant = config_get_int(hDlg, IDC_MAXIQUANT, config->max_iquant); |
config->max_iquant = config_get_uint(hDlg, IDC_MAXIQUANT, config->max_iquant); |
773 |
config->min_pquant = config_get_int(hDlg, IDC_MINPQUANT, config->min_pquant); |
config->min_pquant = config_get_uint(hDlg, IDC_MINPQUANT, config->min_pquant); |
774 |
config->max_pquant = config_get_int(hDlg, IDC_MAXPQUANT, config->max_pquant); |
config->max_pquant = config_get_uint(hDlg, IDC_MAXPQUANT, config->max_pquant); |
775 |
|
|
776 |
CONSTRAINVAL(config->min_iquant, 1, 31); |
CONSTRAINVAL(config->min_iquant, 1, 31); |
777 |
CONSTRAINVAL(config->max_iquant, config->min_iquant, 31); |
CONSTRAINVAL(config->max_iquant, config->min_iquant, 31); |
781 |
|
|
782 |
case DLG_2PASS : |
case DLG_2PASS : |
783 |
config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE); |
config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE); |
784 |
config->min_key_interval = config_get_int(hDlg, IDC_MINKEY, config->min_key_interval); |
// added by koepi for the new 2pass curve treatment |
785 |
|
config->kftreshold = GetDlgItemInt(hDlg, IDC_KFTRESHOLD, NULL, FALSE); |
786 |
|
config->kfreduction = GetDlgItemInt(hDlg, IDC_KFREDUCTION, NULL, FALSE); |
787 |
|
//end of koepi's additions |
788 |
config->discard1pass = ISDLGSET(IDC_DISCARD1PASS); |
config->discard1pass = ISDLGSET(IDC_DISCARD1PASS); |
789 |
config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS); |
config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS); |
790 |
config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE); |
config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE); |
791 |
config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE); |
config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE); |
792 |
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); |
793 |
config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP); |
config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP); |
794 |
config->hinted_me = ISDLGSET(IDC_HINTEDME); |
config->hinted_me = ISDLGSET(IDC_HINTEDME); |
795 |
|
|
816 |
config->use_alt_curve = ISDLGSET(IDC_USEALT); |
config->use_alt_curve = ISDLGSET(IDC_USEALT); |
817 |
|
|
818 |
config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO); |
config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO); |
819 |
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); |
820 |
|
|
821 |
config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS); |
config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS); |
822 |
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); |
823 |
|
|
824 |
config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0); |
config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0); |
825 |
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); |
826 |
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); |
827 |
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); |
828 |
|
|
829 |
|
config->twopass_max_bitrate /= CONFIG_KBPS; |
830 |
|
config->twopass_max_bitrate = config_get_uint(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate); |
831 |
|
config->twopass_max_bitrate *= CONFIG_KBPS; |
832 |
|
config->twopass_max_overflow_improvement = config_get_uint(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement); |
833 |
|
config->twopass_max_overflow_degradation = config_get_uint(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation); |
834 |
|
|
835 |
|
CONSTRAINVAL(config->twopass_max_overflow_improvement, 1, 80); |
836 |
|
CONSTRAINVAL(config->twopass_max_overflow_degradation, 1, 80); |
837 |
break; |
break; |
838 |
|
|
839 |
case DLG_CREDITS : |
case DLG_CREDITS : |
840 |
config->credits_start = ISDLGSET(IDC_CREDITS_START); |
config->credits_start = ISDLGSET(IDC_CREDITS_START); |
841 |
config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE); |
config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE); |
842 |
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); |
843 |
config->credits_end = ISDLGSET(IDC_CREDITS_END); |
config->credits_end = ISDLGSET(IDC_CREDITS_END); |
844 |
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); |
845 |
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); |
846 |
|
|
847 |
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); |
848 |
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); |
849 |
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); |
850 |
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); |
851 |
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); |
852 |
|
|
853 |
config->credits_mode = 0; |
config->credits_mode = 0; |
854 |
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; |
880 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOW) ? XVID_CPU_3DNOW: 0; |
881 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
882 |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
883 |
|
|
884 |
|
#ifdef _SMP |
885 |
|
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
886 |
|
#endif |
887 |
|
#ifdef BFRAMES |
888 |
|
config->frame_drop_ratio = config_get_uint(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio); |
889 |
|
#endif |
890 |
|
|
891 |
|
config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor); |
892 |
|
config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period); |
893 |
|
config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer); |
894 |
break; |
break; |
895 |
} |
} |
896 |
} |
} |
916 |
{ |
{ |
917 |
int temp; |
int temp; |
918 |
|
|
919 |
temp = config_get_int(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]); |
temp = config_get_uint(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]); |
920 |
CONSTRAINVAL(temp, 1, 255); |
CONSTRAINVAL(temp, 1, 255); |
921 |
temp = config->qmatrix_intra[i]; |
config->qmatrix_intra[i] = temp; |
922 |
|
|
923 |
temp = config_get_int(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]); |
temp = config_get_uint(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]); |
924 |
CONSTRAINVAL(temp, 1, 255); |
CONSTRAINVAL(temp, 1, 255); |
925 |
temp = config->qmatrix_inter[i]; |
config->qmatrix_inter[i] = temp; |
926 |
} |
} |
927 |
} |
} |
928 |
|
|
972 |
SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed"); |
SendDlgItemMessage(hDlg, IDC_MODE, CB_ADDSTRING, 0, (LPARAM)"Null - test speed"); |
973 |
|
|
974 |
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); |
|
975 |
|
|
976 |
InitCommonControls(); |
InitCommonControls(); |
977 |
|
|
1022 |
config_reg_default(config); |
config_reg_default(config); |
1023 |
|
|
1024 |
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); |
|
1025 |
|
|
1026 |
main_slider(hDlg, config); |
main_slider(hDlg, config); |
1027 |
main_value(hDlg, config); |
main_value(hDlg, config); |
1028 |
} |
} |
1029 |
else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE) |
else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE) |
1030 |
{ |
{ |
1031 |
int value = config_get_int(hDlg, IDC_VALUE, 1); |
int value = config_get_uint(hDlg, IDC_VALUE, 1); |
1032 |
int max = 1; |
int max = 1; |
1033 |
|
|
1034 |
max = (config->mode == DLG_MODE_CBR) ? 10000 : |
max = (config->mode == DLG_MODE_CBR) ? 10000 : |
1104 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
1105 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
1106 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
1107 |
|
|
1108 |
|
#ifndef BFRAMES |
1109 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC1), FALSE); |
1110 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC2), FALSE); |
1111 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC3), FALSE); |
1112 |
|
EnableWindow(GetDlgItem(hDlg, IDC_MAXBFRAMES), FALSE); |
1113 |
|
EnableWindow(GetDlgItem(hDlg, IDC_BQUANTRATIO), FALSE); |
1114 |
|
EnableWindow(GetDlgItem(hDlg, IDC_PACKED), FALSE); |
1115 |
|
EnableWindow(GetDlgItem(hDlg, IDC_DX50BVOP), FALSE); |
1116 |
|
EnableWindow(GetDlgItem(hDlg, IDC_DEBUG), FALSE); |
1117 |
|
#endif |
1118 |
} |
} |
1119 |
else if (psi->page == DLG_2PASSALT) |
else if (psi->page == DLG_2PASSALT) |
1120 |
{ |
{ |
1122 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
1123 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
1124 |
} |
} |
1125 |
|
else if (psi->page == DLG_CPU) |
1126 |
|
{ |
1127 |
|
#ifndef _SMP |
1128 |
|
|
1129 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
1130 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
1131 |
|
#endif |
1132 |
|
#ifndef BFRAMES |
1133 |
|
EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP_STATIC), FALSE); |
1134 |
|
EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP), FALSE); |
1135 |
|
#endif |
1136 |
|
} |
1137 |
|
|
1138 |
if (hTooltip) |
if (hTooltip) |
1139 |
{ |
{ |
1366 |
|
|
1367 |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
1368 |
|
|
1369 |
|
init_param.cpu_flags = XVID_CPU_CHKONLY; |
1370 |
xvid_init(NULL, 0, &init_param, 0); |
xvid_init(NULL, 0, &init_param, 0); |
1371 |
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)); |
1372 |
SetDlgItemText(hDlg, IDC_CORE, core); |
SetDlgItemText(hDlg, IDC_CORE, core); |