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; |
96 |
{"packed", ®.packed, 0}, |
{"packed", ®.packed, 0}, |
97 |
{"dx50bvop", ®.dx50bvop, 0}, |
{"dx50bvop", ®.dx50bvop, 0}, |
98 |
{"debug", ®.debug, 0}, |
{"debug", ®.debug, 0}, |
99 |
#endif BFRAMES |
{"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}, |
163 |
xvid_init(0, 0, &init_param, NULL); |
xvid_init(0, 0, &init_param, NULL); |
164 |
reg.cpu = init_param.cpu_flags; |
reg.cpu = init_param.cpu_flags; |
165 |
|
|
166 |
|
#ifdef _SMP |
167 |
|
reg.num_threads = pthread_num_processors_np(); |
168 |
|
#endif |
169 |
|
|
170 |
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); |
171 |
|
|
172 |
for (i=0 ; i<sizeof(reg_ints)/sizeof(REG_INT) ; ++i) |
for (i=0 ; i<sizeof(reg_ints)/sizeof(REG_INT) ; ++i) |
714 |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE, |
715 |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); |
716 |
|
|
717 |
|
#ifdef _SMP |
718 |
|
SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); |
719 |
|
#endif |
720 |
|
|
721 |
|
#ifdef BFRAMES |
722 |
|
SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE); |
723 |
|
#endif |
724 |
|
|
725 |
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); |
726 |
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); |
727 |
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); |
867 |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; |
868 |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
869 |
|
|
870 |
|
#ifdef _SMP |
871 |
|
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
872 |
|
#endif |
873 |
|
#ifdef BFRAMES |
874 |
|
config->frame_drop_ratio = config_get_uint(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio); |
875 |
|
#endif |
876 |
|
|
877 |
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); |
878 |
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); |
879 |
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); |
1108 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); |
1109 |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); |
1110 |
} |
} |
1111 |
|
else if (psi->page == DLG_CPU) |
1112 |
|
{ |
1113 |
|
#ifndef _SMP |
1114 |
|
|
1115 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
1116 |
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
1117 |
|
#endif |
1118 |
|
#ifndef BFRAMES |
1119 |
|
EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP_STATIC), FALSE); |
1120 |
|
EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP), FALSE); |
1121 |
|
#endif |
1122 |
|
} |
1123 |
|
|
1124 |
if (hTooltip) |
if (hTooltip) |
1125 |
{ |
{ |