[svn] / trunk / vfw / src / config.c Repository:
ViewVC logotype

Diff of /trunk/vfw/src/config.c

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

revision 131, Sun Apr 21 10:47:53 2002 UTC revision 362, Tue Aug 6 23:41:01 2002 UTC
# Line 23  Line 23 
23   *   *
24   *      History:   *      History:
25   *   *
26     *      15.06.2002      added bframes options
27   *      21.04.2002      fixed custom matrix support, tried to get dll size down   *      21.04.2002      fixed custom matrix support, tried to get dll size down
28   *      17.04.2002      re-enabled lumi masking in 1st pass   *      17.04.2002      re-enabled lumi masking in 1st pass
29   *      15.04.2002      updated cbr support   *      15.04.2002      updated cbr support
# Line 58  Line 59 
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"
68  #include "xvid.h"  // cpu masks  #include "..\..\xvidcore\src\xvid.h" // cpu masks
69  #include "resource.h"  #include "resource.h"
70    
71    
72    
73  /* registry info structs */  /* registry info structs */
74    
75  CONFIG reg;  CONFIG reg;
# Line 85  Line 90 
90          {"min_key_interval",            &reg.min_key_interval,                  1},          {"min_key_interval",            &reg.min_key_interval,                  1},
91          {"lum_masking",                         &reg.lum_masking,                               0},          {"lum_masking",                         &reg.lum_masking,                               0},
92          {"interlacing",                         &reg.interlacing,                               0},          {"interlacing",                         &reg.interlacing,                               0},
93    //added by koepi for gruel's greyscale_mode
94            {"greyscale",                           &reg.greyscale,                                 0},
95    // end of koepi's additions
96    #ifdef BFRAMES
97            {"max_bframes",                         &reg.max_bframes,                               -1},
98            {"bquant_ratio",                        &reg.bquant_ratio,                              200},
99            {"packed",                                      &reg.packed,                                    0},
100            {"dx50bvop",                            &reg.dx50bvop,                                  0},
101            {"debug",                                       &reg.debug,                                             0},
102            {"frame_drop_ratio",            &reg.frame_drop_ratio,                  0},
103    #endif
104    
105          {"min_iquant",                          &reg.min_iquant,                                1},          {"min_iquant",                          &reg.min_iquant,                                1},
106          {"max_iquant",                          &reg.max_iquant,                                31},          {"max_iquant",                          &reg.max_iquant,                                31},
# Line 95  Line 111 
111          {"keyframe_boost",                      &reg.keyframe_boost,                    20},          {"keyframe_boost",                      &reg.keyframe_boost,                    20},
112          {"discard1pass",                        &reg.discard1pass,                              1},          {"discard1pass",                        &reg.discard1pass,                              1},
113          {"dummy2pass",                          &reg.dummy2pass,                                0},          {"dummy2pass",                          &reg.dummy2pass,                                0},
114    // added by koepi for new two-pass curve treatment
115            {"kftreshold",                          &reg.kftreshold,                                10},
116            {"kfreduction",                         &reg.kfreduction,                               30},
117    // end of koepi's additions
118          {"curve_compression_high",      &reg.curve_compression_high,    25},          {"curve_compression_high",      &reg.curve_compression_high,    25},
119          {"curve_compression_low",       &reg.curve_compression_low,             10},          {"curve_compression_low",       &reg.curve_compression_low,             10},
120          {"use_alt_curve",                       &reg.use_alt_curve,                             0},          {"use_alt_curve",                       &reg.use_alt_curve,                             0},
# Line 120  Line 140 
140          {"credits_end_begin",           &reg.credits_end_begin,                 0},          {"credits_end_begin",           &reg.credits_end_begin,                 0},
141          {"credits_end_end",                     &reg.credits_end_end,                   0},          {"credits_end_end",                     &reg.credits_end_end,                   0},
142    
143    // added by koepi for greyscale credits
144            {"credits_greyscale",           &reg.credits_greyscale,                 0},
145    // end of koepi's addition
146          {"credits_mode",                        &reg.credits_mode,                              0},          {"credits_mode",                        &reg.credits_mode,                              0},
147          {"credits_rate",                        &reg.credits_rate,                              20},          {"credits_rate",                        &reg.credits_rate,                              20},
148          {"credits_quant_i",                     &reg.credits_quant_i,                   20},          {"credits_quant_i",                     &reg.credits_quant_i,                   20},
# Line 146  Line 169 
169          XVID_INIT_PARAM init_param;          XVID_INIT_PARAM init_param;
170          int i;          int i;
171    
172          init_param.cpu_flags = 0;          init_param.cpu_flags = XVID_CPU_CHKONLY;
173          xvid_init(0, 0, &init_param, NULL);          xvid_init(0, 0, &init_param, NULL);
174          config->cpu = init_param.cpu_flags;          reg.cpu = init_param.cpu_flags;
175    
176    #ifdef _SMP
177            reg.num_threads = pthread_num_processors_np();
178    #endif
179    
180          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);
181    
# Line 275  Line 302 
302    
303  /* leaves current config value if dialog item is empty */  /* leaves current config value if dialog item is empty */
304    
305  int config_get_int(HWND hDlg, UINT item, int config)  int config_get_int(HWND hDlg, INT item, int config)
306    {
307            BOOL success = FALSE;
308    
309            int tmp = GetDlgItemInt(hDlg, item, &success, TRUE);
310    
311            return (success) ? tmp : config;
312    }
313    
314    
315    int config_get_uint(HWND hDlg, UINT item, int config)
316  {  {
317          BOOL success = FALSE;          BOOL success = FALSE;
318    
# Line 293  Line 330 
330          {          {
331          default :          default :
332          case DLG_MODE_CBR :          case DLG_MODE_CBR :
333                  config->rc_bitrate = config_get_int(hDlg, IDC_VALUE, config->rc_bitrate) * CONFIG_KBPS;                  config->rc_bitrate = config_get_uint(hDlg, IDC_VALUE, config->rc_bitrate) * CONFIG_KBPS;
334                  break;                  break;
335    
336          case DLG_MODE_VBR_QUAL :          case DLG_MODE_VBR_QUAL :
337                  config->quality = config_get_int(hDlg, IDC_VALUE, config->quality);                  config->quality = config_get_uint(hDlg, IDC_VALUE, config->quality);
338                  break;                  break;
339    
340          case DLG_MODE_VBR_QUANT :          case DLG_MODE_VBR_QUANT :
341                  config->quant = config_get_int(hDlg, IDC_VALUE, config->quant);                  config->quant = config_get_uint(hDlg, IDC_VALUE, config->quant);
342                  break;                  break;
343    
344          case DLG_MODE_2PASS_2_INT :          case DLG_MODE_2PASS_2_INT :
345                  config->desired_size = config_get_int(hDlg, IDC_VALUE, config->desired_size);                  config->desired_size = config_get_uint(hDlg, IDC_VALUE, config->desired_size);
346                  break;                  break;
347          }          }
348    
# Line 461  Line 498 
498          // create arrays of controls to be disabled for each mode          // create arrays of controls to be disabled for each mode
499          const short twopass_disable[] = {          const short twopass_disable[] = {
500                  IDC_KFBOOST, IDC_DUMMY2PASS, IDC_USEALT,                  IDC_KFBOOST, IDC_DUMMY2PASS, IDC_USEALT,
501    // added by koepi for new curve treatment
502                    IDC_KFTRESHOLD, IDC_KFREDUCTION,
503    //end of koepi's additions
504                  IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP,                  IDC_CURVECOMPH, IDC_CURVECOMPL, IDC_PAYBACK, IDC_PAYBACKBIAS, IDC_PAYBACKPROP,
505                  IDC_STATS2, IDC_STATS2_BROWSE,                  IDC_STATS2, IDC_STATS2_BROWSE,
506          };          };
# Line 470  Line 510 
510                  IDC_CREDITS_START, IDC_CREDITS_END, IDC_CREDITS_START_BEGIN, IDC_CREDITS_START_END,                  IDC_CREDITS_START, IDC_CREDITS_END, IDC_CREDITS_START_BEGIN, IDC_CREDITS_START_END,
511                  IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO,                  IDC_CREDITS_END_BEGIN, IDC_CREDITS_END_END, IDC_CREDITS_RATE_RADIO,
512                  IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO,                  IDC_CREDITS_QUANT_RADIO, IDC_CREDITS_QUANT_STATIC, IDC_CREDITS_SIZE_RADIO,
513                  IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE, IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP,                  IDC_CREDITS_QUANTI, IDC_CREDITS_QUANTP, IDC_CREDITS_END_STATIC, IDC_CREDITS_RATE,
514                  IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE,                  IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE, IDC_CREDITS_GREYSCALE, IDC_HINTFILE
515          };          };
516    
517          const short qual_disable[] = {          const short qual_disable[] = {
518                  IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME,                  IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME,
519                  IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER,                  IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER,
520                  IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE                  IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE,
521                    IDC_HINTFILE
522          };          };
523    
524          const short quant_disable[] = {          const short quant_disable[] = {
525                  IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME,                  IDC_STATS1, IDC_STATS1_BROWSE, IDC_DISCARD1PASS, IDC_HINTEDME,
526                  IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER,                  IDC_CBR_REACTIONDELAY, IDC_CBR_AVERAGINGPERIOD, IDC_CBR_BUFFER,
527                  IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT,                  IDC_MINIQUANT, IDC_MAXIQUANT, IDC_MINPQUANT, IDC_MAXPQUANT,
528                  IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE                  IDC_CREDITS_SIZE_RADIO, IDC_CREDITS_END_STATIC, IDC_CREDITS_START_SIZE, IDC_CREDITS_END_SIZE,
529                    IDC_HINTFILE
530          };          };
531    
532          const short twopass1_disable[] = {          const short twopass1_disable[] = {
# Line 596  Line 638 
638                  SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE);                  SetDlgItemInt(hDlg, IDC_MINKEY, config->min_key_interval, FALSE);
639                  CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED);                  CheckDlgButton(hDlg, IDC_LUMMASK, config->lum_masking ? BST_CHECKED : BST_UNCHECKED);
640                  CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED);                  CheckDlgButton(hDlg, IDC_INTERLACING, config->interlacing ? BST_CHECKED : BST_UNCHECKED);
641    // added by koepi for gruel's greyscale_mode
642                    CheckDlgButton(hDlg, IDC_GREYSCALE, config->greyscale ? BST_CHECKED : BST_UNCHECKED);
643    // end of koepi's addition
644    #ifdef BFRAMES
645                    SetDlgItemInt(hDlg, IDC_MAXBFRAMES, config->max_bframes, TRUE);
646                    SetDlgItemInt(hDlg, IDC_BQUANTRATIO, config->bquant_ratio, FALSE);
647                    CheckDlgButton(hDlg, IDC_PACKED, config->packed ? BST_CHECKED : BST_UNCHECKED);
648                    CheckDlgButton(hDlg, IDC_DX50BVOP, config->dx50bvop ? BST_CHECKED : BST_UNCHECKED);
649                    CheckDlgButton(hDlg, IDC_DEBUG, config->debug ? BST_CHECKED : BST_UNCHECKED);
650    #endif
651                  break;                  break;
652    
653          case DLG_QUANT :          case DLG_QUANT :
# Line 609  Line 661 
661                  SetDlgItemInt(hDlg, IDC_KFBOOST, config->keyframe_boost, FALSE);                  SetDlgItemInt(hDlg, IDC_KFBOOST, config->keyframe_boost, FALSE);
662                  CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED);                  CheckDlgButton(hDlg, IDC_DISCARD1PASS, config->discard1pass ? BST_CHECKED : BST_UNCHECKED);
663                  CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED);                  CheckDlgButton(hDlg, IDC_DUMMY2PASS, config->dummy2pass ? BST_CHECKED : BST_UNCHECKED);
664    // added by koepi for new 2pass curve treatment
665                    SetDlgItemInt(hDlg, IDC_KFTRESHOLD, config->kftreshold, FALSE);
666                    SetDlgItemInt(hDlg, IDC_KFREDUCTION, config->kfreduction, FALSE);
667    // end of koepi's additions
668                  SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE);                  SetDlgItemInt(hDlg, IDC_CURVECOMPH, config->curve_compression_high, FALSE);
669                  SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE);                  SetDlgItemInt(hDlg, IDC_CURVECOMPL, config->curve_compression_low, FALSE);
670                  SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE);                  SetDlgItemInt(hDlg, IDC_PAYBACK, config->bitrate_payback_delay, FALSE);
# Line 649  Line 704 
704                  SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE);                  SetDlgItemInt(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin, FALSE);
705                  SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE);                  SetDlgItemInt(hDlg, IDC_CREDITS_END_END, config->credits_end_end, FALSE);
706    
707    // added by koepi for credits greyscale
708                    CheckDlgButton(hDlg, IDC_CREDITS_GREYSCALE, config->credits_greyscale ? BST_CHECKED : BST_UNCHECKED);
709    // end of koepi's addition
710                  SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE);                  SetDlgItemInt(hDlg, IDC_CREDITS_RATE, config->credits_rate, FALSE);
711                  SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE);                  SetDlgItemInt(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i, FALSE);
712                  SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE);                  SetDlgItemInt(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p, FALSE);
# Line 680  Line 738 
738                  CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE,                  CheckRadioButton(hDlg, IDC_CPU_AUTO, IDC_CPU_FORCE,
739                          config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO );                          config->cpu & XVID_CPU_FORCE ? IDC_CPU_FORCE : IDC_CPU_AUTO );
740    
741    #ifdef _SMP
742                    SetDlgItemInt(hDlg, IDC_NUMTHREADS, config->num_threads, FALSE);
743    #endif
744    
745    #ifdef BFRAMES
746                    SetDlgItemInt(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio, FALSE);
747    #endif
748    
749                  SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE);                  SetDlgItemInt(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor, FALSE);
750                  SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE);                  SetDlgItemInt(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period, FALSE);
751                  SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE);                  SetDlgItemInt(hDlg, IDC_CBR_BUFFER, config->rc_buffer, FALSE);
# Line 702  Line 768 
768                  config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0);                  config->motion_search = SendDlgItemMessage(hDlg, IDC_MOTION, CB_GETCURSEL, 0, 0);
769                  config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0);                  config->quant_type = SendDlgItemMessage(hDlg, IDC_QUANTTYPE, CB_GETCURSEL, 0, 0);
770                  config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0);                  config->fourcc_used = SendDlgItemMessage(hDlg, IDC_FOURCC, CB_GETCURSEL, 0, 0);
771                  config->max_key_interval = config_get_int(hDlg, IDC_MAXKEY, config->max_key_interval);                  config->max_key_interval = config_get_uint(hDlg, IDC_MAXKEY, config->max_key_interval);
772                  config->min_key_interval = config_get_int(hDlg, IDC_MINKEY, config->min_key_interval);                  config->min_key_interval = config_get_uint(hDlg, IDC_MINKEY, config->min_key_interval);
773                  config->lum_masking = ISDLGSET(IDC_LUMMASK);                  config->lum_masking = ISDLGSET(IDC_LUMMASK);
774                  config->interlacing = ISDLGSET(IDC_INTERLACING);                  config->interlacing = ISDLGSET(IDC_INTERLACING);
775    // added by koepi for gruel's greyscale_mode
776                    config->greyscale = ISDLGSET(IDC_GREYSCALE);
777    // end of koepi's addition
778    #ifdef BFRAMES
779                    config->max_bframes = config_get_int(hDlg, IDC_MAXBFRAMES, config->max_bframes);
780                    config->bquant_ratio = config_get_uint(hDlg, IDC_BQUANTRATIO, config->bquant_ratio);
781                    config->packed = ISDLGSET(IDC_PACKED);
782                    config->dx50bvop = ISDLGSET(IDC_DX50BVOP);
783                    config->debug = ISDLGSET(IDC_DEBUG);
784    #endif
785                  break;                  break;
786    
787          case DLG_QUANT :          case DLG_QUANT :
788                  config->min_iquant = config_get_int(hDlg, IDC_MINIQUANT, config->min_iquant);                  config->min_iquant = config_get_uint(hDlg, IDC_MINIQUANT, config->min_iquant);
789                  config->max_iquant = config_get_int(hDlg, IDC_MAXIQUANT, config->max_iquant);                  config->max_iquant = config_get_uint(hDlg, IDC_MAXIQUANT, config->max_iquant);
790                  config->min_pquant = config_get_int(hDlg, IDC_MINPQUANT, config->min_pquant);                  config->min_pquant = config_get_uint(hDlg, IDC_MINPQUANT, config->min_pquant);
791                  config->max_pquant = config_get_int(hDlg, IDC_MAXPQUANT, config->max_pquant);                  config->max_pquant = config_get_uint(hDlg, IDC_MAXPQUANT, config->max_pquant);
792    
793                  CONSTRAINVAL(config->min_iquant, 1, 31);                  CONSTRAINVAL(config->min_iquant, 1, 31);
794                  CONSTRAINVAL(config->max_iquant, config->min_iquant, 31);                  CONSTRAINVAL(config->max_iquant, config->min_iquant, 31);
# Line 722  Line 798 
798    
799          case DLG_2PASS :          case DLG_2PASS :
800                  config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE);                  config->keyframe_boost = GetDlgItemInt(hDlg, IDC_KFBOOST, NULL, FALSE);
801    // added by koepi for the new 2pass curve treatment
802                    config->kftreshold = GetDlgItemInt(hDlg, IDC_KFTRESHOLD, NULL, FALSE);
803                    config->kfreduction = GetDlgItemInt(hDlg, IDC_KFREDUCTION, NULL, FALSE);
804    //end of koepi's additions
805                  config->discard1pass = ISDLGSET(IDC_DISCARD1PASS);                  config->discard1pass = ISDLGSET(IDC_DISCARD1PASS);
806                  config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS);                  config->dummy2pass = ISDLGSET(IDC_DUMMY2PASS);
807                  config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE);                  config->curve_compression_high = GetDlgItemInt(hDlg, IDC_CURVECOMPH, NULL, FALSE);
808                  config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE);                  config->curve_compression_low = GetDlgItemInt(hDlg, IDC_CURVECOMPL, NULL, FALSE);
809                  config->bitrate_payback_delay = config_get_int(hDlg, IDC_PAYBACK, config->bitrate_payback_delay);                  config->bitrate_payback_delay = config_get_uint(hDlg, IDC_PAYBACK, config->bitrate_payback_delay);
810                  config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP);                  config->bitrate_payback_method = ISDLGSET(IDC_PAYBACKPROP);
811                  config->hinted_me = ISDLGSET(IDC_HINTEDME);                  config->hinted_me = ISDLGSET(IDC_HINTEDME);
812    
# Line 753  Line 833 
833                  config->use_alt_curve = ISDLGSET(IDC_USEALT);                  config->use_alt_curve = ISDLGSET(IDC_USEALT);
834    
835                  config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO);                  config->alt_curve_use_auto = ISDLGSET(IDC_USEAUTO);
836                  config->alt_curve_auto_str = config_get_int(hDlg, IDC_AUTOSTR, config->alt_curve_auto_str);                  config->alt_curve_auto_str = config_get_uint(hDlg, IDC_AUTOSTR, config->alt_curve_auto_str);
837    
838                  config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS);                  config->alt_curve_use_auto_bonus_bias = ISDLGSET(IDC_USEAUTOBONUS);
839                  config->alt_curve_bonus_bias = config_get_int(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias);                  config->alt_curve_bonus_bias = config_get_uint(hDlg, IDC_BONUSBIAS, config->alt_curve_bonus_bias);
840    
841                  config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0);                  config->alt_curve_type = SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_GETCURSEL, 0, 0);
842                  config->alt_curve_high_dist = config_get_int(hDlg, IDC_ALTCURVEHIGH, config->alt_curve_high_dist);                  config->alt_curve_high_dist = config_get_uint(hDlg, IDC_ALTCURVEHIGH, config->alt_curve_high_dist);
843                  config->alt_curve_low_dist = config_get_int(hDlg, IDC_ALTCURVELOW, config->alt_curve_low_dist);                  config->alt_curve_low_dist = config_get_uint(hDlg, IDC_ALTCURVELOW, config->alt_curve_low_dist);
844                  config->alt_curve_min_rel_qual = config_get_int(hDlg, IDC_MINQUAL, config->alt_curve_min_rel_qual);                  config->alt_curve_min_rel_qual = config_get_uint(hDlg, IDC_MINQUAL, config->alt_curve_min_rel_qual);
845    
846                  config->twopass_max_bitrate /= CONFIG_KBPS;                  config->twopass_max_bitrate /= CONFIG_KBPS;
847                  config->twopass_max_bitrate = config_get_int(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate);                  config->twopass_max_bitrate = config_get_uint(hDlg, IDC_MAXBITRATE, config->twopass_max_bitrate);
848                  config->twopass_max_bitrate *= CONFIG_KBPS;                  config->twopass_max_bitrate *= CONFIG_KBPS;
849                  config->twopass_max_overflow_improvement = config_get_int(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement);                  config->twopass_max_overflow_improvement = config_get_uint(hDlg, IDC_OVERIMP, config->twopass_max_overflow_improvement);
850                  config->twopass_max_overflow_degradation = config_get_int(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation);                  config->twopass_max_overflow_degradation = config_get_uint(hDlg, IDC_OVERDEG, config->twopass_max_overflow_degradation);
851    
852                  CONSTRAINVAL(config->twopass_max_overflow_improvement, 1, 80);                  CONSTRAINVAL(config->twopass_max_overflow_improvement, 1, 80);
853                  CONSTRAINVAL(config->twopass_max_overflow_degradation, 1, 80);                  CONSTRAINVAL(config->twopass_max_overflow_degradation, 1, 80);
# Line 776  Line 856 
856          case DLG_CREDITS :          case DLG_CREDITS :
857                  config->credits_start = ISDLGSET(IDC_CREDITS_START);                  config->credits_start = ISDLGSET(IDC_CREDITS_START);
858                  config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE);                  config->credits_start_begin = GetDlgItemInt(hDlg, IDC_CREDITS_START_BEGIN, NULL, FALSE);
859                  config->credits_start_end = config_get_int(hDlg, IDC_CREDITS_START_END, config->credits_start_end);                  config->credits_start_end = config_get_uint(hDlg, IDC_CREDITS_START_END, config->credits_start_end);
860                  config->credits_end = ISDLGSET(IDC_CREDITS_END);                  config->credits_end = ISDLGSET(IDC_CREDITS_END);
861                  config->credits_end_begin = config_get_int(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin);                  config->credits_end_begin = config_get_uint(hDlg, IDC_CREDITS_END_BEGIN, config->credits_end_begin);
862                  config->credits_end_end = config_get_int(hDlg, IDC_CREDITS_END_END, config->credits_end_end);                  config->credits_end_end = config_get_uint(hDlg, IDC_CREDITS_END_END, config->credits_end_end);
863    
864                  config->credits_rate = config_get_int(hDlg, IDC_CREDITS_RATE, config->credits_rate);  // added by koepi for gruel's greyscale_mode
865                  config->credits_quant_i = config_get_int(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i);                  config->credits_greyscale = ISDLGSET(IDC_CREDITS_GREYSCALE);
866                  config->credits_quant_p = config_get_int(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p);  // end of koepi's addition
867                  config->credits_start_size = config_get_int(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size);                  config->credits_rate = config_get_uint(hDlg, IDC_CREDITS_RATE, config->credits_rate);
868                  config->credits_end_size = config_get_int(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size);                  config->credits_quant_i = config_get_uint(hDlg, IDC_CREDITS_QUANTI, config->credits_quant_i);
869                    config->credits_quant_p = config_get_uint(hDlg, IDC_CREDITS_QUANTP, config->credits_quant_p);
870                    config->credits_start_size = config_get_uint(hDlg, IDC_CREDITS_START_SIZE, config->credits_start_size);
871                    config->credits_end_size = config_get_uint(hDlg, IDC_CREDITS_END_SIZE, config->credits_end_size);
872    
873                  config->credits_mode = 0;                  config->credits_mode = 0;
874                  config->credits_mode = ISDLGSET(IDC_CREDITS_RATE_RADIO) ? CREDITS_MODE_RATE : config->credits_mode;                  config->credits_mode = ISDLGSET(IDC_CREDITS_RATE_RADIO) ? CREDITS_MODE_RATE : config->credits_mode;
# Line 818  Line 901 
901                  config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0;                  config->cpu |= ISDLGSET(IDC_CPU_3DNOWEXT) ? XVID_CPU_3DNOWEXT: 0;
902                  config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0;                  config->cpu |= ISDLGSET(IDC_CPU_FORCE) ? XVID_CPU_FORCE : 0;
903    
904                  config->rc_reaction_delay_factor = config_get_int(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor);  #ifdef _SMP
905                  config->rc_averaging_period = config_get_int(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period);                  config->num_threads = config_get_uint(hDlg, IDC_NUMTHREADS, config->num_threads);
906                  config->rc_buffer = config_get_int(hDlg, IDC_CBR_BUFFER, config->rc_buffer);  #endif
907    #ifdef BFRAMES
908                    config->frame_drop_ratio = config_get_uint(hDlg, IDC_FRAMEDROP, config->frame_drop_ratio);
909    #endif
910    
911                    config->rc_reaction_delay_factor = config_get_uint(hDlg, IDC_CBR_REACTIONDELAY, config->rc_reaction_delay_factor);
912                    config->rc_averaging_period = config_get_uint(hDlg, IDC_CBR_AVERAGINGPERIOD, config->rc_averaging_period);
913                    config->rc_buffer = config_get_uint(hDlg, IDC_CBR_BUFFER, config->rc_buffer);
914                  break;                  break;
915          }          }
916  }  }
# Line 846  Line 936 
936          {          {
937                  int temp;                  int temp;
938    
939                  temp = config_get_int(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]);                  temp = config_get_uint(hDlg, i + IDC_QINTRA00, config->qmatrix_intra[i]);
940                  CONSTRAINVAL(temp, 1, 255);                  CONSTRAINVAL(temp, 1, 255);
941                  config->qmatrix_intra[i] = temp;                  config->qmatrix_intra[i] = temp;
942    
943                  temp = config_get_int(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]);                  temp = config_get_uint(hDlg, i + IDC_QINTER00, config->qmatrix_inter[i]);
944                  CONSTRAINVAL(temp, 1, 255);                  CONSTRAINVAL(temp, 1, 255);
945                  config->qmatrix_inter[i] = temp;                  config->qmatrix_inter[i] = temp;
946          }          }
# Line 958  Line 1048 
1048                  }                  }
1049                  else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE)                  else if (HIWORD(wParam) == EN_UPDATE && LOWORD(wParam) == IDC_VALUE)
1050                  {                  {
1051                          int value = config_get_int(hDlg, IDC_VALUE, 1);                          int value = config_get_uint(hDlg, IDC_VALUE, 1);
1052                          int max = 1;                          int max = 1;
1053    
1054                          max = (config->mode == DLG_MODE_CBR) ? 10000 :                          max = (config->mode == DLG_MODE_CBR) ? 10000 :
# Line 1034  Line 1124 
1124                          SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID");                          SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"XVID");
1125                          SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX");                          SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DIVX");
1126                          SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50");                          SendDlgItemMessage(hDlg, IDC_FOURCC, CB_ADDSTRING, 0, (LPARAM)"DX50");
1127    
1128    #ifndef BFRAMES
1129                            EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC1), FALSE);
1130                            EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC2), FALSE);
1131                            EnableWindow(GetDlgItem(hDlg, IDC_BSTATIC3), FALSE);
1132                            EnableWindow(GetDlgItem(hDlg, IDC_MAXBFRAMES), FALSE);
1133                            EnableWindow(GetDlgItem(hDlg, IDC_BQUANTRATIO), FALSE);
1134                            EnableWindow(GetDlgItem(hDlg, IDC_PACKED), FALSE);
1135                            EnableWindow(GetDlgItem(hDlg, IDC_DX50BVOP), FALSE);
1136                            EnableWindow(GetDlgItem(hDlg, IDC_DEBUG), FALSE);
1137    #endif
1138                  }                  }
1139                  else if (psi->page == DLG_2PASSALT)                  else if (psi->page == DLG_2PASSALT)
1140                  {                  {
# Line 1041  Line 1142 
1142                          SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium");                          SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"Medium");
1143                          SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High");                          SendDlgItemMessage(hDlg, IDC_CURVETYPE, CB_ADDSTRING, 0, (LPARAM)"High");
1144                  }                  }
1145                    else if (psi->page == DLG_CPU)
1146                    {
1147    #ifndef _SMP
1148    
1149                            EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS_STATIC), FALSE);
1150                            EnableWindow(GetDlgItem(hDlg, IDC_NUMTHREADS), FALSE);
1151    #endif
1152    #ifndef BFRAMES
1153                            EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP_STATIC), FALSE);
1154                            EnableWindow(GetDlgItem(hDlg, IDC_FRAMEDROP), FALSE);
1155    #endif
1156                    }
1157    
1158                  if (hTooltip)                  if (hTooltip)
1159                  {                  {
# Line 1272  Line 1385 
1385                          LOGFONT lfData;                          LOGFONT lfData;
1386    
1387                          SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD);                          SetDlgItemText(hDlg, IDC_BUILD, XVID_BUILD);
1388                            SetDlgItemText(hDlg, IDC_SPECIAL_BUILD, XVID_SPECIAL_BUILD);
1389    
1390                            init_param.cpu_flags = XVID_CPU_CHKONLY;
1391                          xvid_init(NULL, 0, &init_param, 0);                          xvid_init(NULL, 0, &init_param, 0);
1392                          wsprintf(core, "Core Version %d.%d", (init_param.api_version>>16),(init_param.api_version&0xFFFFU));                          wsprintf(core, "Core Version %d.%d", (init_param.api_version>>16),(init_param.api_version&0xFFFFU));
1393                          SetDlgItemText(hDlg, IDC_CORE, core);                          SetDlgItemText(hDlg, IDC_CORE, core);

Legend:
Removed from v.131  
changed lines
  Added in v.362

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