103 |
{"packed", ®.packed, 0}, |
{"packed", ®.packed, 0}, |
104 |
{"dx50bvop", ®.dx50bvop, 1}, |
{"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}, |
108 |
|
|
109 |
{"min_iquant", ®.min_iquant, 2}, |
{"min_iquant", ®.min_iquant, 2}, |
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[] = { |
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 |
|
|
663 |
|
CheckDlgButton(hDlg, IDC_REDUCED, config->reduced_resolution ? BST_CHECKED : BST_UNCHECKED); |
664 |
break; |
break; |
665 |
|
|
666 |
case DLG_QUANT : |
case DLG_QUANT : |
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 |
|
config->reduced_resolution = ISDLGSET(IDC_REDUCED); |
798 |
break; |
break; |
799 |
|
|
800 |
case DLG_QUANT : |
case DLG_QUANT : |
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); |
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 |
|
/* XXX: reduced resolution is not ready for prime-time */ |
1277 |
|
ShowWindow(GetDlgItem(hDlg, IDC_REDUCED), SW_HIDE); |
1278 |
} |
} |
1279 |
else if (psi->page == DLG_2PASSALT) |
else if (psi->page == DLG_2PASSALT) |
1280 |
{ |
{ |