104 |
/* MPEG-4 PROFILES/LEVELS ============================================================== */ |
/* MPEG-4 PROFILES/LEVELS ============================================================== */ |
105 |
/* ===================================================================================== */ |
/* ===================================================================================== */ |
106 |
|
|
107 |
#define DXN_PROFILES |
/* #define EXTRA_PROFILES */ |
108 |
|
|
109 |
/* default vbv_occupancy is (64/170)*vbv_buffer_size */ |
/* default vbv_occupancy is (64/170)*vbv_buffer_size */ |
110 |
|
|
121 |
/* <=qcif must be used */ |
/* <=qcif must be used */ |
122 |
{ "Simple @ L1", 0x01, 176, 144, 15, 4, 198, 99, 1485, 100, 10*16368, 2048, 64000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
{ "Simple @ L1", 0x01, 176, 144, 15, 4, 198, 99, 1485, 100, 10*16368, 2048, 64000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
123 |
{ "Simple @ L2", 0x02, 352, 288, 15, 4, 792, 396, 5940, 100, 40*16368, 4096, 128000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
{ "Simple @ L2", 0x02, 352, 288, 15, 4, 792, 396, 5940, 100, 40*16368, 4096, 128000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
124 |
{ "Simple @ L3", 0x03, 352, 288, 15, 4, 792, 396, 11880, 100, 40*16368, 8192, 384000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
{ "Simple @ L3", 0x03, 352, 288, 30, 4, 792, 396, 11880, 100, 40*16368, 8192, 384000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
125 |
|
/* From ISO/IEC 14496-2:2004/FPDAM 2: New Levels for Simple Profile */ |
126 |
|
{ "Simple @ L4a", 0x04, 640, 480, 30, 4, 2400, 1200, 36000, 100, 80*16368, 16384, 4000000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
127 |
|
{ "Simple @ L5", 0x05, 720, 576, 30, 4, 3240, 1620, 40500, 100, 112*16368, 16384, 8000000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
128 |
|
/* From ISO/IEC 14496-2:2004/FPDAM 4: Simple profile level 6 */ |
129 |
|
{ "Simple @ L6", 0x06, 1280, 720, 30, 4, 7200, 3600, 108000, 100, 248*16368, 16384,12000000, 0, -1, PROFILE_S|PROFILE_ADAPTQUANT }, |
130 |
|
|
131 |
#if 0 /* since rrv encoding is no longer support, these profiles have little use */ |
#if 0 /* since rrv encoding is no longer support, these profiles have little use */ |
132 |
{ "ARTS @ L1", 0x91, 176, 144, 15, 4, 198, 99, 1485, 100, 10*16368, 8192, 64000, 0, -1, PROFILE_ARTS }, |
{ "ARTS @ L1", 0x91, 176, 144, 15, 4, 198, 99, 1485, 100, 10*16368, 8192, 64000, 0, -1, PROFILE_ARTS }, |
135 |
{ "ARTS @ L4", 0x94, 352, 288, 30, 16, 792, 396, 11880, 100, 80*16368, 16384, 2000000, 0, -1, PROFILE_ARTS }, |
{ "ARTS @ L4", 0x94, 352, 288, 30, 16, 792, 396, 11880, 100, 80*16368, 16384, 2000000, 0, -1, PROFILE_ARTS }, |
136 |
#endif |
#endif |
137 |
|
|
138 |
{ "AS @ L0", 0xf0, 176, 144, 30, 1, 297, 99, 2970, 100, 10*16368, 2048, 128000, 0, -1, PROFILE_AS }, |
{ "Advanced Simple @ L0", 0xf0, 176, 144, 30, 1, 297, 99, 2970, 100, 10*16368, 2048, 128000, 0, -1, PROFILE_AS }, |
139 |
{ "AS @ L1", 0xf1, 176, 144, 30, 4, 297, 99, 2970, 100, 10*16368, 2048, 128000, 0, -1, PROFILE_AS }, |
{ "Advanced Simple @ L1", 0xf1, 176, 144, 30, 4, 297, 99, 2970, 100, 10*16368, 2048, 128000, 0, -1, PROFILE_AS }, |
140 |
{ "AS @ L2", 0xf2, 352, 288, 15, 4, 1188, 396, 5940, 100, 40*16368, 4096, 384000, 0, -1, PROFILE_AS }, |
{ "Advanced Simple @ L2", 0xf2, 352, 288, 15, 4, 1188, 396, 5940, 100, 40*16368, 4096, 384000, 0, -1, PROFILE_AS }, |
141 |
{ "AS @ L3", 0xf3, 352, 288, 30, 4, 1188, 396, 11880, 100, 40*16368, 4096, 768000, 0, -1, PROFILE_AS }, |
{ "Advanced Simple @ L3", 0xf3, 352, 288, 30, 4, 1188, 396, 11880, 100, 40*16368, 4096, 768000, 0, -1, PROFILE_AS }, |
142 |
/* ISMA Profile 1, (ASP) @ L3b (CIF, 1.5 Mb/s) CIF(352x288), 30fps, 1.5Mbps max ??? */ |
/* ISMA Profile 1, (ASP) @ L3b (CIF, 1.5 Mb/s) CIF(352x288), 30fps, 1.5Mbps max ??? */ |
143 |
{ "AS @ L4", 0xf4, 352, 576, 30, 4, 2376, 792, 23760, 50, 80*16368, 8192, 3000000, 0, -1, PROFILE_AS }, |
{ "Advanced Simple @ L4", 0xf4, 352, 576, 30, 4, 2376, 792, 23760, 50, 80*16368, 8192, 3000000, 0, -1, PROFILE_AS }, |
144 |
{ "AS @ L5", 0xf5, 720, 576, 30, 4, 4860, 1620, 48600, 25, 112*16368, 16384, 8000000, 0, -1, PROFILE_AS }, |
{ "Advanced Simple @ L5", 0xf5, 720, 576, 30, 4, 4860, 1620, 48600, 25, 112*16368, 16384, 8000000, 0, -1, PROFILE_AS }, |
145 |
|
|
146 |
#ifdef DXN_PROFILES |
#ifndef EXTRA_PROFILES |
147 |
// information provided by DivXNetworks, USA. |
{ "Mobile", 0x00, 352, 240, 30, 1, 990, 330, 36000, 100, 128*8192, -1, 1334850, 8000000, 5, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_MPEGQUANT|PROFILE_QPEL }, |
148 |
// "DivX Certified Profile Compatibility v1.1", February 2005 |
{ "Portable", 0x00, 640, 480, 30, 1, 3600, 1200, 36000, 100, 384*8192, -1, 4854000, 8000000, 5, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_MPEGQUANT|PROFILE_QPEL|PROFILE_INTERLACE }, |
149 |
{ "DXN Handheld", 0x00, 176, 144, 15, 1, 198, 99, 1485, 100, 32*8192, -1, 537600, 800000, 0, PROFILE_ADAPTQUANT|PROFILE_DXN }, |
{ "Home", 0x00, 720, 576, 25, 1, 4860, 1620, 40500, 100, 384*8192, -1, 4854000, 8000000, 5, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_MPEGQUANT|PROFILE_QPEL|PROFILE_INTERLACE }, |
150 |
{ "DXN Portable NTSC",0x00, 352, 240, 30, 1, 990, 330, 36000, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_DXN }, |
{ "Highdef", 0x00, 1280, 720, 30, 1,10800, 3600, 108000, 100, 768*8192, -1, 9708400, 16000000, 5, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_MPEGQUANT|PROFILE_QPEL|PROFILE_INTERLACE }, |
151 |
{ "DXN Portable PAL", 0x00, 352, 288, 25, 1, 1188, 396, 36000, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_DXN }, |
#else |
152 |
{ "DXN HT NTSC", 0x00, 720, 480, 30, 1, 4050, 1350, 40500, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE|PROFILE_DXN }, |
{ "Handheld", 0x00, 176, 144, 15, 1, 198, 99, 1485, 100, 32*8192, -1, 537600, 800000, 0, PROFILE_ADAPTQUANT|PROFILE_EXTRA }, |
153 |
{ "DXN HT PAL", 0x00, 720, 576, 25, 1, 4860, 1620, 40500, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE|PROFILE_DXN }, |
{ "Portable NTSC", 0x00, 352, 240, 30, 1, 990, 330, 36000, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_EXTRA }, |
154 |
{ "DXN HDTV", 0x00, 1280, 720, 30, 1,10800, 3600, 108000, 100, 768*8192, -1, 9708400, 16000000, 2, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE|PROFILE_DXN }, |
{ "Portable PAL", 0x00, 352, 288, 25, 1, 1188, 396, 36000, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_EXTRA }, |
155 |
|
{ "Home Theatre NTSC", 0x00, 720, 480, 30, 1, 4050, 1350, 40500, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_INTERLACE|PROFILE_EXTRA }, |
156 |
|
{ "Home Theatre PAL", 0x00, 720, 576, 25, 1, 4860, 1620, 40500, 100, 384*8192, -1, 4854000, 8000000, 1, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_INTERLACE|PROFILE_EXTRA }, |
157 |
|
{ "HDTV", 0x00, 1280, 720, 30, 1,10800, 3600, 108000, 100, 768*8192, -1, 9708400, 16000000, 2, PROFILE_4MV|PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_PACKED|PROFILE_INTERLACE|PROFILE_EXTRA }, |
158 |
#endif |
#endif |
159 |
|
|
160 |
{ "(unrestricted)", 0x00, 0, 0, 0, 0, 0, 0, 0, 100, 0*16368, -1, 0, 0, -1, 0xffffffff & ~PROFILE_DXN }, |
{ "(unrestricted)", 0x00, 0, 0, 0, 0, 0, 0, 0, 100, 0*16368, -1, 0, 0, -1, 0xffffffff & ~(PROFILE_EXTRA | PROFILE_PACKED)}, |
161 |
}; |
}; |
162 |
|
|
163 |
|
|
301 |
{"vop_debug", ®.vop_debug, 0}, |
{"vop_debug", ®.vop_debug, 0}, |
302 |
{"display_status", ®.display_status, 1}, |
{"display_status", ®.display_status, 1}, |
303 |
|
|
304 |
|
/* smp */ |
305 |
|
{"num_threads", ®.num_threads, 0}, |
306 |
|
|
307 |
/* decoder, shared with dshow */ |
/* decoder, shared with dshow */ |
308 |
{"Brightness", &pp_brightness, 0}, |
{"Brightness", &pp_brightness, 0}, |
309 |
{"Deblock_Y", &pp_dy, 0}, |
{"Deblock_Y", &pp_dy, 0}, |
384 |
} |
} |
385 |
|
|
386 |
reg.cpu = info.cpu_flags; |
reg.cpu = info.cpu_flags; |
|
reg.num_threads = info.num_threads; |
|
387 |
|
|
388 |
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); |
389 |
|
|
551 |
#define UINT_BUF_SZ 20 |
#define UINT_BUF_SZ 20 |
552 |
static int config_get_cbuint(HWND hDlg, UINT item, int def) |
static int config_get_cbuint(HWND hDlg, UINT item, int def) |
553 |
{ |
{ |
554 |
int sel = SendMessage(GetDlgItem(hDlg, item), CB_GETCURSEL, 0, 0); |
LRESULT sel = SendMessage(GetDlgItem(hDlg, item), CB_GETCURSEL, 0, 0); |
555 |
char buf[UINT_BUF_SZ]; |
char buf[UINT_BUF_SZ]; |
556 |
|
|
557 |
if (sel<0) { |
if (sel<0) { |
708 |
|
|
709 |
/* quantization matrix dialog proc */ |
/* quantization matrix dialog proc */ |
710 |
|
|
711 |
static BOOL CALLBACK quantmatrix_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
static INT_PTR CALLBACK quantmatrix_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
712 |
{ |
{ |
713 |
CONFIG* config = (CONFIG*)GetWindowLong(hDlg, GWL_USERDATA); |
CONFIG* config = (CONFIG*)GetWindowLongPtr(hDlg, GWLP_USERDATA); |
714 |
|
|
715 |
switch (uMsg) |
switch (uMsg) |
716 |
{ |
{ |
717 |
case WM_INITDIALOG : |
case WM_INITDIALOG : |
718 |
SetWindowLong(hDlg, GWL_USERDATA, lParam); |
SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam); |
719 |
config = (CONFIG*)lParam; |
config = (CONFIG*)lParam; |
720 |
quant_upload(hDlg, config); |
quant_upload(hDlg, config); |
721 |
|
|
777 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"H.263"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"H.263"); |
778 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG"); |
779 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom"); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_ADDSTRING, 0, (LPARAM)"MPEG-Custom"); |
780 |
|
|
781 |
|
SendDlgItemMessage(hDlg, IDC_LUMMASK, CB_ADDSTRING, 0, (LPARAM)"Off"); |
782 |
|
SendDlgItemMessage(hDlg, IDC_LUMMASK, CB_ADDSTRING, 0, (LPARAM)"Luminance-Masking"); |
783 |
|
SendDlgItemMessage(hDlg, IDC_LUMMASK, CB_ADDSTRING, 0, (LPARAM)"Variance-Masking"); |
784 |
break; |
break; |
785 |
|
|
786 |
case IDD_AR: |
case IDD_AR: |
851 |
break; |
break; |
852 |
|
|
853 |
case IDD_ENC : |
case IDD_ENC : |
|
/* force threads disabled */ |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE); |
|
|
EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE); |
|
|
|
|
854 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID"); |
855 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX"); |
856 |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50"); |
897 |
EnableDlgWindow(hDlg, IDC_MAXBFRAMES_S, bvops); |
EnableDlgWindow(hDlg, IDC_MAXBFRAMES_S, bvops); |
898 |
EnableDlgWindow(hDlg, IDC_BQUANTRATIO_S, bvops); |
EnableDlgWindow(hDlg, IDC_BQUANTRATIO_S, bvops); |
899 |
EnableDlgWindow(hDlg, IDC_BQUANTOFFSET_S, bvops); |
EnableDlgWindow(hDlg, IDC_BQUANTOFFSET_S, bvops); |
900 |
EnableDlgWindow(hDlg, IDC_PACKED, bvops && !(profiles[profile].flags & PROFILE_DXN)); |
EnableDlgWindow(hDlg, IDC_PACKED, bvops && !(profiles[profile].flags & PROFILE_PACKED)); |
901 |
break; |
break; |
902 |
|
|
903 |
case IDD_AR: |
case IDD_AR: |
1114 |
EnableDlgWindow(hDlg, IDC_CPU_MMXEXT, cpu_force); |
EnableDlgWindow(hDlg, IDC_CPU_MMXEXT, cpu_force); |
1115 |
EnableDlgWindow(hDlg, IDC_CPU_SSE, cpu_force); |
EnableDlgWindow(hDlg, IDC_CPU_SSE, cpu_force); |
1116 |
EnableDlgWindow(hDlg, IDC_CPU_SSE2, cpu_force); |
EnableDlgWindow(hDlg, IDC_CPU_SSE2, cpu_force); |
1117 |
|
EnableDlgWindow(hDlg, IDC_CPU_SSE3, cpu_force); |
1118 |
|
EnableDlgWindow(hDlg, IDC_CPU_SSE4, cpu_force); |
1119 |
EnableDlgWindow(hDlg, IDC_CPU_3DNOW, cpu_force); |
EnableDlgWindow(hDlg, IDC_CPU_3DNOW, cpu_force); |
1120 |
EnableDlgWindow(hDlg, IDC_CPU_3DNOWEXT, cpu_force); |
EnableDlgWindow(hDlg, IDC_CPU_3DNOWEXT, cpu_force); |
1121 |
break; |
break; |
1132 |
SendDlgItemMessage(hDlg, IDC_PROFILE_PROFILE, CB_SETCURSEL, config->profile, 0); |
SendDlgItemMessage(hDlg, IDC_PROFILE_PROFILE, CB_SETCURSEL, config->profile, 0); |
1133 |
|
|
1134 |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_SETCURSEL, config->quant_type, 0); |
1135 |
CheckDlg(hDlg, IDC_LUMMASK, config->lum_masking); |
SendDlgItemMessage(hDlg, IDC_LUMMASK, CB_SETCURSEL, config->lum_masking, 0); |
1136 |
CheckDlg(hDlg, IDC_INTERLACING, config->interlacing); |
CheckDlg(hDlg, IDC_INTERLACING, config->interlacing); |
1137 |
CheckDlg(hDlg, IDC_TFF, config->tff); |
CheckDlg(hDlg, IDC_TFF, config->tff); |
1138 |
CheckDlg(hDlg, IDC_QPEL, config->qpel); |
CheckDlg(hDlg, IDC_QPEL, config->qpel); |
1267 |
CheckDlg(hDlg, IDC_CPU_MMXEXT, (config->cpu & XVID_CPU_MMXEXT)); |
CheckDlg(hDlg, IDC_CPU_MMXEXT, (config->cpu & XVID_CPU_MMXEXT)); |
1268 |
CheckDlg(hDlg, IDC_CPU_SSE, (config->cpu & XVID_CPU_SSE)); |
CheckDlg(hDlg, IDC_CPU_SSE, (config->cpu & XVID_CPU_SSE)); |
1269 |
CheckDlg(hDlg, IDC_CPU_SSE2, (config->cpu & XVID_CPU_SSE2)); |
CheckDlg(hDlg, IDC_CPU_SSE2, (config->cpu & XVID_CPU_SSE2)); |
1270 |
|
CheckDlg(hDlg, IDC_CPU_SSE3, (config->cpu & XVID_CPU_SSE3)); |
1271 |
|
CheckDlg(hDlg, IDC_CPU_SSE4, (config->cpu & XVID_CPU_SSE41)); |
1272 |
CheckDlg(hDlg, IDC_CPU_3DNOW, (config->cpu & XVID_CPU_3DNOW)); |
CheckDlg(hDlg, IDC_CPU_3DNOW, (config->cpu & XVID_CPU_3DNOW)); |
1273 |
CheckDlg(hDlg, IDC_CPU_3DNOWEXT, (config->cpu & XVID_CPU_3DNOWEXT)); |
CheckDlg(hDlg, IDC_CPU_3DNOWEXT, (config->cpu & XVID_CPU_3DNOWEXT)); |
1274 |
|
|
1308 |
config->profile = SendDlgItemMessage(hDlg, IDC_PROFILE_PROFILE, CB_GETCURSEL, 0, 0); |
config->profile = SendDlgItemMessage(hDlg, IDC_PROFILE_PROFILE, CB_GETCURSEL, 0, 0); |
1309 |
|
|
1310 |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0); |
1311 |
config->lum_masking = IsDlgChecked(hDlg, IDC_LUMMASK); |
config->lum_masking = SendDlgItemMessage(hDlg, IDC_LUMMASK, CB_GETCURSEL, 0, 0); |
1312 |
config->interlacing = IsDlgChecked(hDlg, IDC_INTERLACING); |
config->interlacing = IsDlgChecked(hDlg, IDC_INTERLACING); |
1313 |
config->tff = IsDlgChecked(hDlg, IDC_TFF); |
config->tff = IsDlgChecked(hDlg, IDC_TFF); |
1314 |
config->qpel = IsDlgChecked(hDlg, IDC_QPEL); |
config->qpel = IsDlgChecked(hDlg, IDC_QPEL); |
1466 |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_MMXEXT) ? XVID_CPU_MMXEXT : 0; |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_MMXEXT) ? XVID_CPU_MMXEXT : 0; |
1467 |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_SSE) ? XVID_CPU_SSE : 0; |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_SSE) ? XVID_CPU_SSE : 0; |
1468 |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_SSE2) ? XVID_CPU_SSE2 : 0; |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_SSE2) ? XVID_CPU_SSE2 : 0; |
1469 |
|
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_SSE3) ? XVID_CPU_SSE3 : 0; |
1470 |
|
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_SSE4) ? XVID_CPU_SSE41 : 0; |
1471 |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_3DNOW) ? XVID_CPU_3DNOW : 0; |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_3DNOW) ? XVID_CPU_3DNOW : 0; |
1472 |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT : 0; |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT : 0; |
1473 |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
config->cpu |= IsDlgChecked(hDlg, IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0; |
1475 |
break; |
break; |
1476 |
|
|
1477 |
case IDD_ENC : |
case IDD_ENC : |
1478 |
config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads); |
config->num_threads = min(4, config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads)); |
1479 |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0); |
1480 |
config->vop_debug = IsDlgChecked(hDlg, IDC_VOPDEBUG); |
config->vop_debug = IsDlgChecked(hDlg, IDC_VOPDEBUG); |
1481 |
config->display_status = IsDlgChecked(hDlg, IDC_DISPLAY_STATUS); |
config->display_status = IsDlgChecked(hDlg, IDC_DISPLAY_STATUS); |
1496 |
|
|
1497 |
/* advanced dialog proc */ |
/* advanced dialog proc */ |
1498 |
|
|
1499 |
static BOOL CALLBACK adv_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
static INT_PTR CALLBACK adv_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
1500 |
{ |
{ |
1501 |
PROPSHEETINFO *psi; |
PROPSHEETINFO *psi; |
1502 |
|
|
1503 |
psi = (PROPSHEETINFO*)GetWindowLong(hDlg, GWL_USERDATA); |
psi = (PROPSHEETINFO*)GetWindowLongPtr(hDlg, GWLP_USERDATA); |
1504 |
|
|
1505 |
switch (uMsg) |
switch (uMsg) |
1506 |
{ |
{ |
1507 |
case WM_INITDIALOG : |
case WM_INITDIALOG : |
1508 |
psi = (PROPSHEETINFO*) ((LPPROPSHEETPAGE)lParam)->lParam; |
psi = (PROPSHEETINFO*) ((LPPROPSHEETPAGE)lParam)->lParam; |
1509 |
SetWindowLong(hDlg, GWL_USERDATA, (LPARAM)psi); |
SetWindowLongPtr(hDlg, GWLP_USERDATA, (LPARAM)psi); |
1510 |
|
|
1511 |
if (g_hTooltip) |
if (g_hTooltip) |
1512 |
EnumChildWindows(hDlg, enum_tooltips, 0); |
EnumChildWindows(hDlg, enum_tooltips, 0); |
1694 |
DPRINTF("PSN_SET"); |
DPRINTF("PSN_SET"); |
1695 |
adv_upload(hDlg, psi->idd, psi->config); |
adv_upload(hDlg, psi->idd, psi->config); |
1696 |
adv_mode(hDlg, psi->idd, psi->config); |
adv_mode(hDlg, psi->idd, psi->config); |
1697 |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); |
1698 |
break; |
break; |
1699 |
|
|
1700 |
case PSN_KILLACTIVE : |
case PSN_KILLACTIVE : |
1701 |
DPRINTF("PSN_KILL"); |
DPRINTF("PSN_KILL"); |
1702 |
adv_download(hDlg, psi->idd, psi->config); |
adv_download(hDlg, psi->idd, psi->config); |
1703 |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); |
1704 |
break; |
break; |
1705 |
|
|
1706 |
case PSN_APPLY : |
case PSN_APPLY : |
1707 |
DPRINTF("PSN_APPLY"); |
DPRINTF("PSN_APPLY"); |
1708 |
psi->config->save = TRUE; |
psi->config->save = TRUE; |
1709 |
SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); |
1710 |
break; |
break; |
1711 |
} |
} |
1712 |
break; |
break; |
1760 |
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP; |
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP; |
1761 |
psh.hwndParent = hParent; |
psh.hwndParent = hParent; |
1762 |
psh.hInstance = g_hInst; |
psh.hInstance = g_hInst; |
1763 |
psh.pszCaption = (LPSTR) "XviD Configuration"; |
psh.pszCaption = (LPSTR) "Xvid Configuration"; |
1764 |
psh.nPages = size; |
psh.nPages = size; |
1765 |
psh.nStartPage = 0; |
psh.nStartPage = 0; |
1766 |
psh.ppsp = (LPCPROPSHEETPAGE)&psp; |
psh.ppsp = (LPCPROPSHEETPAGE)&psp; |
1927 |
static const int other_dlgs[] = { IDD_ENC, IDD_DEC, IDD_COMMON }; |
static const int other_dlgs[] = { IDD_ENC, IDD_DEC, IDD_COMMON }; |
1928 |
|
|
1929 |
|
|
1930 |
BOOL CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
INT_PTR CALLBACK main_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
1931 |
{ |
{ |
1932 |
CONFIG* config = (CONFIG*)GetWindowLong(hDlg, GWL_USERDATA); |
CONFIG* config = (CONFIG*)GetWindowLongPtr(hDlg, GWLP_USERDATA); |
1933 |
unsigned int i; |
unsigned int i; |
1934 |
|
|
1935 |
switch (uMsg) |
switch (uMsg) |
1936 |
{ |
{ |
1937 |
case WM_INITDIALOG : |
case WM_INITDIALOG : |
1938 |
SetWindowLong(hDlg, GWL_USERDATA, lParam); |
SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam); |
1939 |
config = (CONFIG*)lParam; |
config = (CONFIG*)lParam; |
1940 |
|
|
1941 |
for (i=0; i<sizeof(profiles)/sizeof(profile_t); i++) |
for (i=0; i<sizeof(profiles)/sizeof(profile_t); i++) |
1967 |
EnumChildWindows(hDlg, enum_tooltips, 0); |
EnumChildWindows(hDlg, enum_tooltips, 0); |
1968 |
} |
} |
1969 |
|
|
1970 |
SetClassLong(GetDlgItem(hDlg, IDC_BITRATE_S), GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_HAND)); |
SetClassLongPtr(GetDlgItem(hDlg, IDC_BITRATE_S), GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_HAND)); |
1971 |
|
|
1972 |
{ |
{ |
1973 |
DWORD ext_style = ListView_GetExtendedListViewStyle(GetDlgItem(hDlg,IDC_ZONES)); |
DWORD ext_style = ListView_GetExtendedListViewStyle(GetDlgItem(hDlg,IDC_ZONES)); |
2240 |
/* LICENSE DIALOG ====================================================================== */ |
/* LICENSE DIALOG ====================================================================== */ |
2241 |
/* ===================================================================================== */ |
/* ===================================================================================== */ |
2242 |
|
|
2243 |
static BOOL CALLBACK license_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
static INT_PTR CALLBACK license_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
2244 |
{ |
{ |
2245 |
switch (uMsg) |
switch (uMsg) |
2246 |
{ |
{ |
2258 |
} |
} |
2259 |
} |
} |
2260 |
} |
} |
2261 |
SetWindowLong(hDlg, GWL_USERDATA, (LONG)hGlobal); |
SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)hGlobal); |
2262 |
} |
} |
2263 |
break; |
break; |
2264 |
|
|
2265 |
case WM_DESTROY : |
case WM_DESTROY : |
2266 |
{ |
{ |
2267 |
HGLOBAL hGlobal = (HGLOBAL)GetWindowLong(hDlg, GWL_USERDATA); |
HGLOBAL hGlobal = (HGLOBAL)GetWindowLongPtr(hDlg, GWLP_USERDATA); |
2268 |
if (hGlobal) { |
if (hGlobal) { |
2269 |
FreeResource(hGlobal); |
FreeResource(hGlobal); |
2270 |
} |
} |
2296 |
/* ABOUT DIALOG ======================================================================== */ |
/* ABOUT DIALOG ======================================================================== */ |
2297 |
/* ===================================================================================== */ |
/* ===================================================================================== */ |
2298 |
|
|
2299 |
BOOL CALLBACK about_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
INT_PTR CALLBACK about_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
2300 |
{ |
{ |
2301 |
switch (uMsg) |
switch (uMsg) |
2302 |
{ |
{ |
2309 |
HINSTANCE m_hdll; |
HINSTANCE m_hdll; |
2310 |
|
|
2311 |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD); |
2312 |
SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, XVID_SPECIAL_BUILD); |
#ifdef _WIN64 |
2313 |
|
wsprintf(core, "(%s, 64-bit Edition)", XVID_SPECIAL_BUILD); |
2314 |
|
#else |
2315 |
|
wsprintf(core, "(%s)", XVID_SPECIAL_BUILD); |
2316 |
|
#endif |
2317 |
|
SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, core); |
2318 |
|
|
2319 |
memset(&info, 0, sizeof(info)); |
memset(&info, 0, sizeof(info)); |
2320 |
info.version = XVID_VERSION; |
info.version = XVID_VERSION; |
2349 |
} |
} |
2350 |
} |
} |
2351 |
|
|
2352 |
SetClassLong(GetDlgItem(hDlg, IDC_WEBSITE), GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_HAND)); |
SetClassLongPtr(GetDlgItem(hDlg, IDC_WEBSITE), GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_HAND)); |
2353 |
SetDlgItemText(hDlg, IDC_WEBSITE, XVID_WEBSITE); |
SetDlgItemText(hDlg, IDC_WEBSITE, XVID_WEBSITE); |
2354 |
} |
} |
2355 |
break; |
break; |
2358 |
{ |
{ |
2359 |
SetBkMode((HDC)wParam, TRANSPARENT) ; |
SetBkMode((HDC)wParam, TRANSPARENT) ; |
2360 |
SetTextColor((HDC)wParam, RGB(0x00,0x00,0xc0)); |
SetTextColor((HDC)wParam, RGB(0x00,0x00,0xc0)); |
2361 |
return (BOOL)GetStockObject(NULL_BRUSH); |
return (INT_PTR)GetStockObject(NULL_BRUSH); |
2362 |
} |
} |
2363 |
return 0; |
return 0; |
2364 |
|
|