[svn] / branches / dev-api-4 / xvidcore / vfw / src / config.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/vfw/src/config.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1277, Thu Dec 18 14:51:40 2003 UTC revision 1301, Fri Jan 2 13:18:28 2004 UTC
# Line 129  Line 129 
129          { "AS @ L5",           0xf5,  720, 576, 30,  4, 4860, 1620,  48600,  25, 112*16368, 16384, 8000, PROFILE_AS },          { "AS @ L5",           0xf5,  720, 576, 30,  4, 4860, 1620,  48600,  25, 112*16368, 16384, 8000, PROFILE_AS },
130    
131  #ifdef DXN_PROFILES  #ifdef DXN_PROFILES
   
132          { "DXN Handheld",          0x00,  176, 144, 15, -1,  198,   99,   1485, 100,  16*16368,    -1,  128, PROFILE_ADAPTQUANT },          { "DXN Handheld",          0x00,  176, 144, 15, -1,  198,   99,   1485, 100,  16*16368,    -1,  128, PROFILE_ADAPTQUANT },
133          { "DXN Portable NTSC", 0x00,  352, 240, 30, -1,  990,  330,   9900, 100,  64*16368,    -1,  768, PROFILE_ADAPTQUANT|PROFILE_BVOP },          { "DXN Portable NTSC", 0x00,  352, 240, 30, -1,  990,  330,   9900, 100,  64*16368,    -1,  768, PROFILE_ADAPTQUANT|PROFILE_BVOP },
134          { "DXN Portable PAL",  0x00,  352, 288, 25, -1, 1188,  396,   9900, 100,  64*16368,    -1,  768, PROFILE_ADAPTQUANT|PROFILE_BVOP },          { "DXN Portable PAL",  0x00,  352, 288, 25, -1, 1188,  396,   9900, 100,  64*16368,    -1,  768, PROFILE_ADAPTQUANT|PROFILE_BVOP },
135          { "DXN HT NTSC",           0x00,  720, 480, 30, -1, 4050, 1350,  40500, 100, 192*16368,    -1, 4000, PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE },          { "DXN HT NTSC",           0x00,  720, 480, 30, -1, 4050, 1350,  40500, 100, 192*16368,    -1, 4000, PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE },
136          { "DXN HT PAL",        0x00,  720, 576, 25, -1, 4860, 1620,  40500, 100, 192*16368,    -1, 4000, PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE },          { "DXN HT PAL",        0x00,  720, 576, 25, -1, 4860, 1620,  40500, 100, 192*16368,    -1, 4000, PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE },
137          { "DXN HDTV",          0x00, 1280, 720, 30, -1,10800, 3600, 108000, 100, 384*16368,    -1, 8000, PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE },          { "DXN HDTV",          0x00, 1280, 720, 30, -1,10800, 3600, 108000, 100, 384*16368,    -1, 8000, PROFILE_ADAPTQUANT|PROFILE_BVOP|PROFILE_INTERLACE },
   
138  #endif  #endif
139    
140      { "(unrestricted)",    0x00,    0,   0,  0,  0,    0,    0,      0, 100,   0*16368,     0,    0, 0xffffffff },      { "(unrestricted)",    0x00,    0,   0,  0,  0,    0,    0,      0, 100,   0*16368,     0,    0, 0xffffffff },
# Line 163  Line 161 
161          {"qpel",                                        &reg.qpel,                                              0},          {"qpel",                                        &reg.qpel,                                              0},
162          {"gmc",                                         &reg.gmc,                                               0},          {"gmc",                                         &reg.gmc,                                               0},
163          {"reduced_resolution",          &reg.reduced_resolution,                0},          {"reduced_resolution",          &reg.reduced_resolution,                0},
164      {"use_bvop",                                &reg.use_bvop,                          0},      {"use_bvop",                                &reg.use_bvop,                          1},
165          {"max_bframes",                         &reg.max_bframes,                               2},          {"max_bframes",                         &reg.max_bframes,                               2},
166          {"bquant_ratio",                        &reg.bquant_ratio,                              150},   /* 100-base float */          {"bquant_ratio",                        &reg.bquant_ratio,                              150},   /* 100-base float */
167          {"bquant_offset",                       &reg.bquant_offset,                             100},   /* 100-base float */          {"bquant_offset",                       &reg.bquant_offset,                             100},   /* 100-base float */
168          {"packed",                                      &reg.packed,                                    0},          {"packed",                                      &reg.packed,                                    1},
169          {"closed_gov",                          &reg.closed_gov,                                1},          {"closed_gov",                          &reg.closed_gov,                                1},
170    
171          /* aspect ratio */          /* aspect ratio */
# Line 201  Line 199 
199    
200      /* motion */      /* motion */
201      {"motion_search",                   &reg.motion_search,                             6},      {"motion_search",                   &reg.motion_search,                             6},
202          {"vhq_mode",                            &reg.vhq_mode,                                  0},          {"vhq_mode",                            &reg.vhq_mode,                                  1},
203      {"chromame",                                &reg.chromame,                                  0},      {"chromame",                                &reg.chromame,                                  1},
204      {"cartoon_mode",                    &reg.cartoon_mode,                              0},      {"cartoon_mode",                    &reg.cartoon_mode,                              0},
205            {"turbo",                                       &reg.turbo,                                             0},
206          {"max_key_interval",            &reg.max_key_interval,                  300},          {"max_key_interval",            &reg.max_key_interval,                  300},
207          {"frame_drop_ratio",            &reg.frame_drop_ratio,                  0},          {"frame_drop_ratio",            &reg.frame_drop_ratio,                  0},
208    
# Line 267  Line 266 
266    
267  #define REG_GET_B(X, Y, Z) size=sizeof((Z));if(RegQueryValueEx(hKey, X, 0, 0, Y, &size) != ERROR_SUCCESS) {memcpy(Y, Z, sizeof((Z)));}  #define REG_GET_B(X, Y, Z) size=sizeof((Z));if(RegQueryValueEx(hKey, X, 0, 0, Y, &size) != ERROR_SUCCESS) {memcpy(Y, Z, sizeof((Z)));}
268    
269    #define XVID_DLL_NAME "xvidcore.dll"
270    
271  void config_reg_get(CONFIG * config)  void config_reg_get(CONFIG * config)
272  {  {
273      char tmp[32];      char tmp[32];
# Line 274  Line 275 
275          DWORD size;          DWORD size;
276      int i,j;      int i,j;
277          xvid_gbl_info_t info;          xvid_gbl_info_t info;
278            HINSTANCE m_hdll;
279    
280          memset(&info, 0, sizeof(info));          memset(&info, 0, sizeof(info));
281          info.version = XVID_VERSION;          info.version = XVID_VERSION;
282          xvid_global(0, XVID_GBL_INFO, &info, NULL);  
283            m_hdll = LoadLibrary(XVID_DLL_NAME);
284            if (m_hdll != NULL) {
285    
286                    ((int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global"))
287                            (0, XVID_GBL_INFO, &info, NULL);
288    
289                    FreeLibrary(m_hdll);
290            }
291    
292          reg.cpu = info.cpu_flags;          reg.cpu = info.cpu_flags;
293          reg.num_threads = info.num_threads;          reg.num_threads = info.num_threads;
294    
# Line 694  Line 705 
705      int weight_en, quant_en;      int weight_en, quant_en;
706      int cpu_force;      int cpu_force;
707      int custom_quant, bvops;      int custom_quant, bvops;
708          int ar_mode, ar_par, ar_select;          int ar_mode, ar_par;
709    
710      switch(idd) {      switch(idd) {
711      case IDD_PROFILE :      case IDD_PROFILE :
# Line 742  Line 753 
753                  }                  }
754    
755                  ar_mode = IsDlgChecked(hDlg, IDC_AR);                  ar_mode = IsDlgChecked(hDlg, IDC_AR);
756                  SetDlgItemInt(hDlg, IDC_ARX, config->ar_x, FALSE);  
757                  SetDlgItemInt(hDlg, IDC_ARY, config->ar_y, FALSE);                  config->ar_x = config_get_uint(hDlg, IDC_ARX, config->ar_x);
758                    config->ar_y = config_get_uint(hDlg, IDC_ARY, config->ar_y);
759    
760                  EnableDlgWindow(hDlg, IDC_ARX, ar_mode);                  EnableDlgWindow(hDlg, IDC_ARX, ar_mode);
761                  EnableDlgWindow(hDlg, IDC_ARY, ar_mode);                  EnableDlgWindow(hDlg, IDC_ARY, ar_mode);
762                  break;                  break;
# Line 822  Line 835 
835          case IDD_AR:          case IDD_AR:
836                  CheckRadioButton(hDlg, IDC_AR, IDC_PAR, config->ar_mode == 0 ? IDC_PAR : IDC_AR);                  CheckRadioButton(hDlg, IDC_AR, IDC_PAR, config->ar_mode == 0 ? IDC_PAR : IDC_AR);
837                  SendDlgItemMessage(hDlg, IDC_ASPECT_RATIO, CB_SETCURSEL, (config->display_aspect_ratio), 0);                  SendDlgItemMessage(hDlg, IDC_ASPECT_RATIO, CB_SETCURSEL, (config->display_aspect_ratio), 0);
838                    SetDlgItemInt(hDlg, IDC_ARX, config->ar_x, FALSE);
839                    SetDlgItemInt(hDlg, IDC_ARY, config->ar_y, FALSE);
840                  break;                  break;
841    
842      case IDD_LEVEL :      case IDD_LEVEL :
# Line 874  Line 889 
889                  SendDlgItemMessage(hDlg, IDC_VHQ, CB_SETCURSEL, config->vhq_mode, 0);                  SendDlgItemMessage(hDlg, IDC_VHQ, CB_SETCURSEL, config->vhq_mode, 0);
890          CheckDlg(hDlg, IDC_CHROMAME, config->chromame);          CheckDlg(hDlg, IDC_CHROMAME, config->chromame);
891          CheckDlg(hDlg, IDC_CARTOON, config->cartoon_mode);          CheckDlg(hDlg, IDC_CARTOON, config->cartoon_mode);
892            CheckDlg(hDlg, IDC_TURBO, config->turbo);
893                  SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE);                  SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE);
894                  SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE);                  SetDlgItemInt(hDlg, IDC_MAXKEY, config->max_key_interval, FALSE);
895          break;          break;
# Line 1009  Line 1025 
1025                  config->vhq_mode = SendDlgItemMessage(hDlg, IDC_VHQ, CB_GETCURSEL, 0, 0);                  config->vhq_mode = SendDlgItemMessage(hDlg, IDC_VHQ, CB_GETCURSEL, 0, 0);
1026                  config->chromame = IsDlgChecked(hDlg, IDC_CHROMAME);                  config->chromame = IsDlgChecked(hDlg, IDC_CHROMAME);
1027                  config->cartoon_mode = IsDlgChecked(hDlg, IDC_CARTOON);                  config->cartoon_mode = IsDlgChecked(hDlg, IDC_CARTOON);
1028                    config->turbo = IsDlgChecked(hDlg, IDC_TURBO);
1029    
1030          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);
1031    
# Line 1127  Line 1144 
1144                  SetDlgItemInt(hDlg, IDC_ZONE_FRAME, psi->config->ci.ciActiveFrame, FALSE);                  SetDlgItemInt(hDlg, IDC_ZONE_FRAME, psi->config->ci.ciActiveFrame, FALSE);
1145                  break;                  break;
1146    
1147                            case IDC_AR_DEFAULT:
1148                                    CheckRadioButton(hDlg, IDC_AR, IDC_PAR, IDC_PAR);
1149                                    SendDlgItemMessage(hDlg, IDC_ASPECT_RATIO, CB_SETCURSEL, 0, 0);
1150                                    adv_mode(hDlg, psi->idd, psi->config);
1151                                    break;
1152                            case IDC_AR_4_3:
1153                                    SetDlgItemInt(hDlg, IDC_ARX, 4, FALSE);
1154                                    SetDlgItemInt(hDlg, IDC_ARY, 3, FALSE);
1155                                    CheckRadioButton(hDlg, IDC_AR, IDC_PAR, IDC_AR);
1156                                    adv_mode(hDlg, psi->idd, psi->config);
1157                                    break;
1158                            case IDC_AR_16_9:
1159                                    SetDlgItemInt(hDlg, IDC_ARX, 16, FALSE);
1160                                    SetDlgItemInt(hDlg, IDC_ARY, 9, FALSE);
1161                                    CheckRadioButton(hDlg, IDC_AR, IDC_PAR, IDC_AR);
1162                                    adv_mode(hDlg, psi->idd, psi->config);
1163                                    break;
1164                            case IDC_AR_235_100:
1165                                    SetDlgItemInt(hDlg, IDC_ARX, 235, FALSE);
1166                                    SetDlgItemInt(hDlg, IDC_ARY, 100, FALSE);
1167                                    CheckRadioButton(hDlg, IDC_AR, IDC_PAR, IDC_AR);
1168                                    adv_mode(hDlg, psi->idd, psi->config);
1169                                    break;
1170    
1171              default :              default :
1172                  return TRUE;                  return TRUE;
1173              }              }
# Line 1660  Line 1701 
1701                          char core[100];                          char core[100];
1702                          HFONT hFont;                          HFONT hFont;
1703                          LOGFONT lfData;                          LOGFONT lfData;
1704                            HINSTANCE m_hdll;
1705    
1706                          SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD);                          SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD);
1707                          SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, XVID_SPECIAL_BUILD);                          SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, XVID_SPECIAL_BUILD);
1708    
1709                          memset(&info, 0, sizeof(info));                          memset(&info, 0, sizeof(info));
1710                          info.version = XVID_VERSION;                          info.version = XVID_VERSION;
1711                          xvid_global(0, XVID_GBL_INFO, &info, NULL);  
1712                          wsprintf(core, "libxvidcore version %d.%d.%d (\"%s\")",                          m_hdll = LoadLibrary(XVID_DLL_NAME);
1713                            if (m_hdll != NULL) {
1714    
1715                                    ((int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global"))
1716                                            (0, XVID_GBL_INFO, &info, NULL);
1717    
1718                                    wsprintf(core, "xvidcore.dll version %d.%d.%d (\"%s\")",
1719                                  XVID_VERSION_MAJOR(info.actual_version),                                  XVID_VERSION_MAJOR(info.actual_version),
1720                                  XVID_VERSION_MINOR(info.actual_version),                                  XVID_VERSION_MINOR(info.actual_version),
1721                                  XVID_VERSION_PATCH(info.actual_version),                                  XVID_VERSION_PATCH(info.actual_version),
1722                                  info.build);                                  info.build);
1723    
1724                                    FreeLibrary(m_hdll);
1725                            } else {
1726                                    wsprintf(core, "xvidcore.dll not found!");
1727                            }
1728    
1729                          SetDlgItemText(hDlg, IDC_CORE, core);                          SetDlgItemText(hDlg, IDC_CORE, core);
1730    
1731                          hFont = (HFONT)SendDlgItemMessage(hDlg, IDC_WEBSITE, WM_GETFONT, 0, 0L);                          hFont = (HFONT)SendDlgItemMessage(hDlg, IDC_WEBSITE, WM_GETFONT, 0, 0L);
# Line 1690  Line 1743 
1743                          SetDlgItemText(hDlg, IDC_WEBSITE, XVID_WEBSITE);                          SetDlgItemText(hDlg, IDC_WEBSITE, XVID_WEBSITE);
1744                  }                  }
1745                  break;                  break;
   
1746          case WM_CTLCOLORSTATIC :          case WM_CTLCOLORSTATIC :
1747                  if ((HWND)lParam == GetDlgItem(hDlg, IDC_WEBSITE))                  if ((HWND)lParam == GetDlgItem(hDlg, IDC_WEBSITE))
1748                  {                  {

Legend:
Removed from v.1277  
changed lines
  Added in v.1301

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4