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 |
|
|
63 |
#include <pthread.h> |
#include <pthread.h> |
64 |
#endif |
#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 |
|
|
84 |
{"rc_averaging_period", ®.rc_averaging_period, 100}, |
{"rc_averaging_period", ®.rc_averaging_period, 100}, |
85 |
{"rc_buffer", ®.rc_buffer, 100}, |
{"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 |
{"max_key_interval", ®.max_key_interval, 300}, |
{"max_key_interval", ®.max_key_interval, 300}, |
91 |
{"min_key_interval", ®.min_key_interval, 1}, |
{"min_key_interval", ®.min_key_interval, 1}, |
92 |
{"lum_masking", ®.lum_masking, 0}, |
{"lum_masking", ®.lum_masking, 0}, |
93 |
{"interlacing", ®.interlacing, 0}, |
{"interlacing", ®.interlacing, 0}, |
94 |
#ifdef BFRAMES |
{"qpel", ®.qpel, 0}, |
95 |
|
{"gmc", ®.gmc, 0}, |
96 |
|
{"chromame", ®.chromame, 0}, |
97 |
|
//added by koepi for gruel's greyscale_mode |
98 |
|
{"greyscale", ®.greyscale, 0}, |
99 |
|
// end of koepi's additions |
100 |
{"max_bframes", ®.max_bframes, -1}, |
{"max_bframes", ®.max_bframes, -1}, |
101 |
{"bquant_ratio", ®.bquant_ratio, 200}, |
{"bquant_ratio", ®.bquant_ratio, 150}, |
102 |
|
{"bquant_offset", ®.bquant_offset, 100}, |
103 |
{"packed", ®.packed, 0}, |
{"packed", ®.packed, 0}, |
104 |
{"dx50bvop", ®.dx50bvop, 0}, |
{"dx50bvop", ®.dx50bvop, 1}, |
105 |
{"debug", ®.debug, 0}, |
{"debug", ®.debug, 0}, |
106 |
|
{"reduced_resolution", ®.reduced_resolution, 0}, |
107 |
{"frame_drop_ratio", ®.frame_drop_ratio, 0}, |
{"frame_drop_ratio", ®.frame_drop_ratio, 0}, |
|
#endif |
|
108 |
|
|
109 |
{"min_iquant", ®.min_iquant, 1}, |
{"min_iquant", ®.min_iquant, 2}, |
110 |
{"max_iquant", ®.max_iquant, 31}, |
{"max_iquant", ®.max_iquant, 31}, |
111 |
{"min_pquant", ®.min_pquant, 1}, |
{"min_pquant", ®.min_pquant, 2}, |
112 |
{"max_pquant", ®.max_pquant, 31}, |
{"max_pquant", ®.max_pquant, 31}, |
113 |
|
|
114 |
{"desired_size", ®.desired_size, 570000}, |
{"desired_size", ®.desired_size, 570000}, |
115 |
{"keyframe_boost", ®.keyframe_boost, 20}, |
{"keyframe_boost", ®.keyframe_boost, 0}, |
116 |
{"discard1pass", ®.discard1pass, 1}, |
{"discard1pass", ®.discard1pass, 1}, |
117 |
{"dummy2pass", ®.dummy2pass, 0}, |
{"dummy2pass", ®.dummy2pass, 0}, |
118 |
// added by koepi for new two-pass curve treatment |
// added by koepi for new two-pass curve treatment |
119 |
{"kftreshold", ®.kftreshold, 10}, |
{"kftreshold", ®.kftreshold, 10}, |
120 |
{"kfreduction", ®.kfreduction, 30}, |
{"kfreduction", ®.kfreduction, 20}, |
121 |
// end of koepi's additions |
// end of koepi's additions |
122 |
{"curve_compression_high", ®.curve_compression_high, 25}, |
{"curve_compression_high", ®.curve_compression_high, 0}, |
123 |
{"curve_compression_low", ®.curve_compression_low, 10}, |
{"curve_compression_low", ®.curve_compression_low, 0}, |
124 |
{"use_alt_curve", ®.use_alt_curve, 0}, |
{"use_alt_curve", ®.use_alt_curve, 0}, |
125 |
{"alt_curve_use_auto", ®.alt_curve_use_auto, 1}, |
{"alt_curve_use_auto", ®.alt_curve_use_auto, 1}, |
126 |
{"alt_curve_auto_str", ®.alt_curve_auto_str, 50}, |
{"alt_curve_auto_str", ®.alt_curve_auto_str, 30}, |
127 |
{"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}, |
128 |
{"alt_curve_bonus_bias", ®.alt_curve_bonus_bias, 50}, |
{"alt_curve_bonus_bias", ®.alt_curve_bonus_bias, 50}, |
129 |
{"alt_curve_type", ®.alt_curve_type, 1}, |
{"alt_curve_type", ®.alt_curve_type, 1}, |
130 |
{"alt_curve_high_dist", ®.alt_curve_high_dist, 300}, |
{"alt_curve_high_dist", ®.alt_curve_high_dist, 500}, |
131 |
{"alt_curve_low_dist", ®.alt_curve_low_dist, 300}, |
{"alt_curve_low_dist", ®.alt_curve_low_dist, 90}, |
132 |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
{"alt_curve_min_rel_qual", ®.alt_curve_min_rel_qual, 50}, |
133 |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 240}, |
{"bitrate_payback_delay", ®.bitrate_payback_delay, 250}, |
134 |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
{"bitrate_payback_method", ®.bitrate_payback_method, 0}, |
135 |
{"twopass_max_bitrate", ®.twopass_max_bitrate, 10000 * CONFIG_KBPS}, |
{"twopass_max_bitrate", ®.twopass_max_bitrate, 10000 * CONFIG_KBPS}, |
136 |
{"twopass_max_overflow_improvement", ®.twopass_max_overflow_improvement, 60}, |
{"twopass_max_overflow_improvement", ®.twopass_max_overflow_improvement, 60}, |
144 |
{"credits_end_begin", ®.credits_end_begin, 0}, |
{"credits_end_begin", ®.credits_end_begin, 0}, |
145 |
{"credits_end_end", ®.credits_end_end, 0}, |
{"credits_end_end", ®.credits_end_end, 0}, |
146 |
|
|
147 |
|
// added by koepi for greyscale credits |
148 |
|
{"credits_greyscale", ®.credits_greyscale, 0}, |
149 |
|
// end of koepi's addition |
150 |
{"credits_mode", ®.credits_mode, 0}, |
{"credits_mode", ®.credits_mode, 0}, |
151 |
{"credits_rate", ®.credits_rate, 20}, |
{"credits_rate", ®.credits_rate, 20}, |
152 |
{"credits_quant_i", ®.credits_quant_i, 20}, |
{"credits_quant_i", ®.credits_quant_i, 20}, |
153 |
{"credits_quant_p", ®.credits_quant_p, 20}, |
{"credits_quant_p", ®.credits_quant_p, 20}, |
154 |
{"credits_start_size", ®.credits_start_size, 10000}, |
{"credits_start_size", ®.credits_start_size, 10000}, |
155 |
{"credits_end_size", ®.credits_end_size, 10000} |
{"credits_end_size", ®.credits_end_size, 10000}, |
156 |
|
|
157 |
|
/* decoder */ |
158 |
|
{"deblock_y", ®.deblock_y, 0}, |
159 |
|
{"deblock_uv", ®.deblock_uv, 0} |
160 |
}; |
}; |
161 |
|
|
162 |
REG_STR const reg_strs[] = { |
REG_STR const reg_strs[] = { |
518 |
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, |
519 |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO, |
520 |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO, |
521 |
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, |
522 |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, IDC_CREDITS_GREYSCALE, IDC_HINTFILE |
523 |
}; |
}; |
524 |
|
|
525 |
const short qual_disable[] = { |
const short qual_disable[] = { |
526 |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
527 |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
528 |
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, |
529 |
|
IDC_HINTFILE |
530 |
}; |
}; |
531 |
|
|
532 |
const short quant_disable[] = { |
const short quant_disable[] = { |
533 |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME, |
534 |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
535 |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT, |
536 |
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, |
537 |
|
IDC_HINTFILE |
538 |
}; |
}; |
539 |
|
|
540 |
const short twopass1_disable[] = { |
const short twopass1_disable[] = { |
546 |
|
|
547 |
const short twopass2_ext_disable[] = { |
const short twopass2_ext_disable[] = { |
548 |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER, |
549 |
IDC_CREDITS_RATE_RADIO, IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, |
IDC_CREDITS_RATE_RADIO, |
550 |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, |
551 |
IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE |
552 |
}; |
}; |
553 |
|
|
554 |
const short twopass2_int_disable[] = { |
const short twopass2_int_disable[] = { |
646 |
SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE); |
SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE); |
647 |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED); |
648 |
CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED); |
649 |
#ifdef BFRAMES |
|
650 |
|
CheckDlgButton(hDlg, IDC_QPEL, config->qpel ? BST_CHECKED : BST_UNCHECKED); |
651 |
|
CheckDlgButton(hDlg, IDC_GMC, config->gmc ? BST_CHECKED : BST_UNCHECKED); |
652 |
|
CheckDlgButton(hDlg, IDC_CHROMAME, config->chromame ? BST_CHECKED : BST_UNCHECKED); |
653 |
|
// added by koepi for gruel's greyscale_mode |
654 |
|
CheckDlgButton(hDlg, IDC_GREYSCALE, config->greyscale ? BST_CHECKED : BST_UNCHECKED); |
655 |
|
// end of koepi's addition |
656 |
SetDlgItemInt(hDlg, IDC_MAXBFRAMES, config->max_bframes, TRUE); |
SetDlgItemInt(hDlg, IDC_MAXBFRAMES, config->max_bframes, TRUE); |
657 |
SetDlgItemInt(hDlg, IDC_BQUANTRATIO, config->bquant_ratio, FALSE); |
SetDlgItemInt(hDlg, IDC_BQUANTRATIO, config->bquant_ratio, FALSE); |
658 |
|
SetDlgItemInt(hDlg, IDC_BQUANTOFFSET, config->bquant_offset, FALSE); |
659 |
CheckDlgButton(hDlg, IDC_PACKED, config->packed ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_PACKED, config->packed ? BST_CHECKED : BST_UNCHECKED); |
660 |
CheckDlgButton(hDlg, IDC_DX50BVOP, config->dx50bvop ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DX50BVOP, config->dx50bvop ? BST_CHECKED : BST_UNCHECKED); |
661 |
CheckDlgButton(hDlg, IDC_DEBUG, config->debug ? BST_CHECKED : BST_UNCHECKED); |
CheckDlgButton(hDlg, IDC_DEBUG, config->debug ? BST_CHECKED : BST_UNCHECKED); |
662 |
#endif |
|
663 |
|
CheckDlgButton(hDlg, IDC_REDUCED, config->reduced_resolution ? BST_CHECKED : BST_UNCHECKED); |
664 |
break; |
break; |
665 |
|
|
666 |
case DLG_QUANT : |
case DLG_QUANT : |
717 |
SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE); |
718 |
SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE); |
719 |
|
|
720 |
|
// added by koepi for credits greyscale |
721 |
|
CheckDlgButton(hDlg, IDC_CREDITS_GREYSCALE, config->credits_greyscale ? BST_CHECKED : BST_UNCHECKED); |
722 |
|
// end of koepi's addition |
723 |
SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE); |
724 |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE); |
725 |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE); |
SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE); |
754 |
#ifdef _SMP |
#ifdef _SMP |
755 |
SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); |
SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); |
756 |
#endif |
#endif |
|
|
|
|
#ifdef BFRAMES |
|
757 |
SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE); |
SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE); |
|
#endif |
|
|
|
|
758 |
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
759 |
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
760 |
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
781 |
config->min_key_interval = config_get_uint(hDlg, IDC_MINKEY, config->min_key_interval); |
config->min_key_interval = config_get_uint(hDlg, IDC_MINKEY, config->min_key_interval); |
782 |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
config->lum_masking = ISDLGSET(IDC_LUMMASK); |
783 |
config->interlacing = ISDLGSET(IDC_INTERLACING); |
config->interlacing = ISDLGSET(IDC_INTERLACING); |
784 |
#ifdef BFRAMES |
|
785 |
|
config->qpel = ISDLGSET(IDC_QPEL); |
786 |
|
config->gmc = ISDLGSET(IDC_GMC); |
787 |
|
config->chromame = ISDLGSET(IDC_CHROMAME); |
788 |
|
// added by koepi for gruel's greyscale_mode |
789 |
|
config->greyscale = ISDLGSET(IDC_GREYSCALE); |
790 |
|
// end of koepi's addition |
791 |
config->max_bframes = config_get_int(hDlg, IDC_MAXBFRAMES, config->max_bframes); |
config->max_bframes = config_get_int(hDlg, IDC_MAXBFRAMES, config->max_bframes); |
792 |
config->bquant_ratio = config_get_uint(hDlg, IDC_BQUANTRATIO, config->bquant_ratio); |
config->bquant_ratio = config_get_uint(hDlg, IDC_BQUANTRATIO, config->bquant_ratio); |
793 |
|
config->bquant_offset = config_get_uint(hDlg, IDC_BQUANTOFFSET, config->bquant_offset); |
794 |
config->packed = ISDLGSET(IDC_PACKED); |
config->packed = ISDLGSET(IDC_PACKED); |
795 |
config->dx50bvop = ISDLGSET(IDC_DX50BVOP); |
config->dx50bvop = ISDLGSET(IDC_DX50BVOP); |
796 |
config->debug = ISDLGSET(IDC_DEBUG); |
config->debug = ISDLGSET(IDC_DEBUG); |
797 |
#endif |
config->reduced_resolution = ISDLGSET(IDC_REDUCED); |
798 |
break; |
break; |
799 |
|
|
800 |
case DLG_QUANT : |
case DLG_QUANT : |
874 |
config->credits_end_begin = config_get_uint(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); |
875 |
config->credits_end_end = config_get_uint(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); |
876 |
|
|
877 |
|
// added by koepi for gruel's greyscale_mode |
878 |
|
config->credits_greyscale = ISDLGSET(IDC_CREDITS_GREYSCALE); |
879 |
|
// end of koepi's addition |
880 |
config->credits_rate = config_get_uint(hDlg, IDC_CREDITS_RATE, config->credits_rate); |
config->credits_rate = config_get_uint(hDlg, IDC_CREDITS_RATE, config->credits_rate); |
881 |
config->credits_quant_i = config_get_uint(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i); |
config->credits_quant_i = config_get_uint(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i); |
882 |
config->credits_quant_p = config_get_uint(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p); |
config->credits_quant_p = config_get_uint(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p); |
917 |
#ifdef _SMP |
#ifdef _SMP |
918 |
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
919 |
#endif |
#endif |
|
#ifdef BFRAMES |
|
920 |
config->frame_drop_ratio = config_get_uint(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio); |
config->frame_drop_ratio = config_get_uint(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio); |
|
#endif |
|
|
|
|
921 |
config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor); |
config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor); |
922 |
config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period); |
config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period); |
923 |
config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer); |
config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer); |
980 |
} |
} |
981 |
|
|
982 |
|
|
983 |
|
|
984 |
|
/* --- decoder options dialog --- */ |
985 |
|
|
986 |
|
#define DEC_DLG_COUNT 1 |
987 |
|
#define DEC_DLG_POSTPROC 0 |
988 |
|
|
989 |
|
/* decoder dialog: upload config data */ |
990 |
|
|
991 |
|
void dec_upload(HWND hDlg, int page, CONFIG * config) |
992 |
|
{ |
993 |
|
switch (page) |
994 |
|
{ |
995 |
|
case DEC_DLG_POSTPROC : |
996 |
|
CheckDlgButton(hDlg, IDC_DEBLOCK_Y, config->deblock_y ? BST_CHECKED : BST_UNCHECKED); |
997 |
|
CheckDlgButton(hDlg, IDC_DEBLOCK_UV, config->deblock_uv ? BST_CHECKED : BST_UNCHECKED); |
998 |
|
break; |
999 |
|
} |
1000 |
|
} |
1001 |
|
|
1002 |
|
|
1003 |
|
/* dec dialog: download config data */ |
1004 |
|
|
1005 |
|
void dec_download(HWND hDlg, int page, CONFIG * config) |
1006 |
|
{ |
1007 |
|
switch (page) |
1008 |
|
{ |
1009 |
|
case DEC_DLG_POSTPROC : |
1010 |
|
config->deblock_y = ISDLGSET(IDC_DEBLOCK_Y); |
1011 |
|
config->deblock_uv = ISDLGSET(IDC_DEBLOCK_UV); |
1012 |
|
break; |
1013 |
|
} |
1014 |
|
} |
1015 |
|
|
1016 |
|
/* decoder dialog proc */ |
1017 |
|
|
1018 |
|
BOOL CALLBACK dec_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
1019 |
|
{ |
1020 |
|
PROPSHEETINFO *psi; |
1021 |
|
|
1022 |
|
psi = (PROPSHEETINFO*)GetWindowLong(hDlg, GWL_USERDATA); |
1023 |
|
|
1024 |
|
switch (uMsg) |
1025 |
|
{ |
1026 |
|
case WM_INITDIALOG : |
1027 |
|
psi = (PROPSHEETINFO*) ((LPPROPSHEETPAGE)lParam)->lParam; |
1028 |
|
|
1029 |
|
SetWindowLong(hDlg, GWL_USERDATA, (LPARAM)psi); |
1030 |
|
|
1031 |
|
if (hTooltip) |
1032 |
|
{ |
1033 |
|
EnumChildWindows(hDlg, enum_tooltips, 0); |
1034 |
|
} |
1035 |
|
|
1036 |
|
dec_upload(hDlg, psi->page, psi->config); |
1037 |
|
break; |
1038 |
|
|
1039 |
|
case WM_NOTIFY : |
1040 |
|
switch (((NMHDR *)lParam)->code) |
1041 |
|
{ |
1042 |
|
case PSN_KILLACTIVE : |
1043 |
|
/* validate */ |
1044 |
|
dec_download(hDlg, psi->page, psi->config); |
1045 |
|
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1046 |
|
break; |
1047 |
|
|
1048 |
|
case PSN_APPLY : |
1049 |
|
/* apply */ |
1050 |
|
dec_download(hDlg, psi->page, psi->config); |
1051 |
|
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
1052 |
|
psi->config->save = TRUE; |
1053 |
|
break; |
1054 |
|
} |
1055 |
|
break; |
1056 |
|
|
1057 |
|
default : |
1058 |
|
return 0; |
1059 |
|
} |
1060 |
|
|
1061 |
|
return 1; |
1062 |
|
} |
1063 |
|
|
1064 |
|
|
1065 |
|
void dec_dialog(HWND hParent, CONFIG * config) |
1066 |
|
{ |
1067 |
|
PROPSHEETINFO psi[DEC_DLG_COUNT]; |
1068 |
|
PROPSHEETPAGE psp[DEC_DLG_COUNT]; |
1069 |
|
PROPSHEETHEADER psh; |
1070 |
|
CONFIG temp; |
1071 |
|
int i; |
1072 |
|
|
1073 |
|
config->save = FALSE; |
1074 |
|
memcpy(&temp, config, sizeof(CONFIG)); |
1075 |
|
|
1076 |
|
for (i=0 ; i<DEC_DLG_COUNT ; ++i) |
1077 |
|
{ |
1078 |
|
psp[i].dwSize = sizeof(PROPSHEETPAGE); |
1079 |
|
psp[i].dwFlags = 0; |
1080 |
|
psp[i].hInstance = hInst; |
1081 |
|
psp[i].pfnDlgProc = dec_proc; |
1082 |
|
psp[i].lParam = (LPARAM)&psi[i]; |
1083 |
|
psp[i].pfnCallback = NULL; |
1084 |
|
|
1085 |
|
psi[i].page = i; |
1086 |
|
psi[i].config = &temp; |
1087 |
|
} |
1088 |
|
|
1089 |
|
psp[DEC_DLG_POSTPROC].pszTemplate = MAKEINTRESOURCE(IDD_POSTPROC); |
1090 |
|
|
1091 |
|
psh.dwSize = sizeof(PROPSHEETHEADER); |
1092 |
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; |
1093 |
|
psh.hwndParent = hParent; |
1094 |
|
psh.hInstance = hInst; |
1095 |
|
psh.pszCaption = (LPSTR) "XviD Configuration"; |
1096 |
|
psh.nPages = DEC_DLG_COUNT; |
1097 |
|
psh.nStartPage = DEC_DLG_POSTPROC; |
1098 |
|
psh.ppsp = (LPCPROPSHEETPAGE)&psp; |
1099 |
|
psh.pfnCallback = NULL; |
1100 |
|
|
1101 |
|
PropertySheet(&psh); |
1102 |
|
|
1103 |
|
if (temp.save) |
1104 |
|
{ |
1105 |
|
memcpy(config, &temp, sizeof(CONFIG)); |
1106 |
|
} |
1107 |
|
} |
1108 |
|
|
1109 |
|
|
1110 |
|
|
1111 |
/* main dialog proc */ |
/* main dialog proc */ |
1112 |
|
|
1113 |
BOOL CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
BOOL CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
1175 |
config_reg_set(config); |
config_reg_set(config); |
1176 |
} |
} |
1177 |
} |
} |
1178 |
|
else if (LOWORD(wParam) == IDC_DECODER && HIWORD(wParam) == BN_CLICKED) |
1179 |
|
{ |
1180 |
|
dec_dialog(hDlg, config); |
1181 |
|
|
1182 |
|
if (config->save) |
1183 |
|
{ |
1184 |
|
config_reg_set(config); |
1185 |
|
} |
1186 |
|
} |
1187 |
else if (LOWORD(wParam) == IDC_DEFAULTS && HIWORD(wParam) == BN_CLICKED) |
else if (LOWORD(wParam) == IDC_DEFAULTS && HIWORD(wParam) == BN_CLICKED) |
1188 |
{ |
{ |
1189 |
config_reg_default(config); |
config_reg_default(config); |
1267 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG"); |
1268 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom"); |
1269 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"Modulated"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"Modulated"); |
1270 |
|
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"New Modulated HQ"); |
1271 |
|
|
1272 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
1273 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
1274 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
1275 |
|
|
1276 |
#ifndef BFRAMES |
/* XXX: reduced resolution is not ready for prime-time */ |
1277 |
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC1), FALSE); |
ShowWindow(GetDlgItem(hDlg, IDC_REDUCED), SW_HIDE); |
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC2), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC3), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_MAXBFRAMES), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_BQUANTRATIO), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_PACKED), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_DX50BVOP), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_DEBUG), FALSE); |
|
|
#endif |
|
1278 |
} |
} |
1279 |
else if (psi->page == DLG_2PASSALT) |
else if (psi->page == DLG_2PASSALT) |
1280 |
{ |
{ |
1285 |
else if (psi->page == DLG_CPU) |
else if (psi->page == DLG_CPU) |
1286 |
{ |
{ |
1287 |
#ifndef _SMP |
#ifndef _SMP |
|
|
|
1288 |
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
1289 |
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
1290 |
#endif |
#endif |
|
#ifndef BFRAMES |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP_STATIC), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP), FALSE); |
|
|
#endif |
|
1291 |
} |
} |
1292 |
|
|
1293 |
if (hTooltip) |
if (hTooltip) |
1520 |
LOGFONT lfData; |
LOGFONT lfData; |
1521 |
|
|
1522 |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
1523 |
|
SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, XVID_SPECIAL_BUILD); |
1524 |
|
|
1525 |
init_param.cpu_flags = XVID_CPU_CHKONLY; |
init_param.cpu_flags = XVID_CPU_CHKONLY; |
1526 |
xvid_init(NULL, 0, &init_param, 0); |
xvid_init(NULL, 0, &init_param, 0); |