--- trunk/vfw/src/config.c 2002/06/23 03:59:49 235 +++ trunk/vfw/src/config.c 2002/07/12 12:26:55 295 @@ -59,6 +59,9 @@ #include #include #include +#ifdef _SMP +#include +#endif #include "codec.h" #include "config.h" @@ -66,6 +69,7 @@ #include "resource.h" + /* registry info structs */ CONFIG reg; @@ -92,7 +96,7 @@ {"packed", ®.packed, 0}, {"dx50bvop", ®.dx50bvop, 0}, {"debug", ®.debug, 0}, -#endif BFRAMES +#endif {"min_iquant", ®.min_iquant, 1}, {"max_iquant", ®.max_iquant, 31}, @@ -158,6 +162,10 @@ xvid_init(0, 0, &init_param, NULL); reg.cpu = init_param.cpu_flags; +#ifdef _SMP + reg.num_threads = pthread_num_processors_np(); +#endif + RegOpenKeyEx(XVID_REG_KEY, XVID_REG_PARENT "\\" XVID_REG_CHILD, 0, KEY_READ, &hKey); for (i=0 ; icpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO ); +#ifdef _SMP + SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE); +#endif + SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE); SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE); SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE); @@ -850,6 +862,10 @@ config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0; config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; +#ifdef _SMP + config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); +#endif + config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor); config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period); config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer); @@ -1084,6 +1100,13 @@ SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium"); SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High"); } +#ifndef _SMP + else if (psi->page == DLG_CPU) + { + EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); + } +#endif if (hTooltip) {