Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 143565 | Differences between
and this patch

Collapse All | Expand All

(-)plugins/x264/x264.c (-28 / +31 lines)
Lines 437-443 Link Here
437
  codec->stats_filename = malloc(strlen(stats_file)+1);
437
  codec->stats_filename = malloc(strlen(stats_file)+1);
438
  strcpy(codec->stats_filename, stats_file);
438
  strcpy(codec->stats_filename, stats_file);
439
  
439
  
440
  fprintf(stderr, "set_pass_x264 %d %d %s\n", pass, total_passes, stats_file);
440
  //  fprintf(stderr, "set_pass_x264 %d %d %s\n", pass, total_passes, stats_file);
441
  return 1;
441
  return 1;
442
  }
442
  }
443
443
Lines 488-509 Link Here
488
    codec->params.i_fps_den = lqt_frame_duration(file, track, NULL);
488
    codec->params.i_fps_den = lqt_frame_duration(file, track, NULL);
489
489
490
    /* Set multipass control */
490
    /* Set multipass control */
491
    
492
    /* Open encoder */
493
491
494
    if(codec->pass == 1)
492
    if(codec->total_passes)
495
      {
493
      {
496
      /* Strings will be made private by x264 */
494
      /* Force ABR */
497
      codec->params.rc.psz_stat_out = codec->stats_filename;
495
      codec->params.rc.i_rc_method = X264_RC_ABR;
498
      codec->params.rc.b_stat_write = 1;
496
      codec->params.rc.i_rf_constant = 0;
499
      }
497
      if(codec->pass == 1)
500
    else if(codec->total_passes && (codec->pass == codec->total_passes))
498
        {
501
      {
499
        /* Strings will be made private by x264 */
502
      /* Strings will be made private by x264 */
500
        codec->params.rc.psz_stat_out = codec->stats_filename;
503
      codec->params.rc.psz_stat_in = codec->stats_filename;
501
        codec->params.rc.b_stat_write = 1;
504
      codec->params.rc.b_stat_read = 1;
502
        }
503
      else if(codec->pass == codec->total_passes)
504
        {
505
        /* Strings will be made private by x264 */
506
        codec->params.rc.psz_stat_in = codec->stats_filename;
507
        codec->params.rc.b_stat_read = 1;
508
        }
505
      }
509
      }
506
    
510
    
511
    /* Open encoder */
512
507
    codec->enc = x264_encoder_open(&codec->params);
513
    codec->enc = x264_encoder_open(&codec->params);
508
    if(!codec->enc)
514
    if(!codec->enc)
509
      {
515
      {
Lines 621-626 Link Here
621
    { "Auto",     X264_DIRECT_PRED_AUTO }
627
    { "Auto",     X264_DIRECT_PRED_AUTO }
622
  };
628
  };
623
629
630
enum_t rc_methods[] =
631
  {
632
    { "Constant quality", X264_RC_CQP },
633
    { "Average bitrate",  X264_RC_ABR },
634
    { "CRF based VBR",    X264_RC_CRF }
635
  };
636
                                     
637
624
static int set_parameter(quicktime_t *file, 
638
static int set_parameter(quicktime_t *file, 
625
                         int track, 
639
                         int track, 
626
                         char *key, 
640
                         char *key, 
Lines 637-658 Link Here
637
  INTPARAM("x264_i_bframe_bias", codec->params.i_bframe_bias);
651
  INTPARAM("x264_i_bframe_bias", codec->params.i_bframe_bias);
638
  INTPARAM("x264_b_bframe_pyramid", codec->params.b_bframe_pyramid);
652
  INTPARAM("x264_b_bframe_pyramid", codec->params.b_bframe_pyramid);
639
653
640
  if(!strcasecmp(key, "x264_i_bitrate"))
654
  ENUMPARAM("x264_i_rc_method", codec->params.rc.i_rc_method, rc_methods);
641
    {
655
  INTPARAM("x264_i_bitrate", codec->params.rc.i_bitrate);
642
    if(*(int*)(value))
656
  
643
      {
644
      codec->params.rc.b_cbr = 1;
645
      codec->params.rc.i_bitrate = *(int*)(value);
646
      }
647
    else
648
      {
649
      codec->params.rc.b_cbr = 0;
650
      codec->params.rc.i_bitrate = 0;
651
      }
652
    found = 1;
653
    }
654
655
  INTPARAM("x264_i_qp_constant", codec->params.rc.i_qp_constant);
657
  INTPARAM("x264_i_qp_constant", codec->params.rc.i_qp_constant);
658
  INTPARAM("x264_i_rf_constant", codec->params.rc.i_rf_constant);
656
  INTPARAM("x264_i_qp_min", codec->params.rc.i_qp_min);
659
  INTPARAM("x264_i_qp_min", codec->params.rc.i_qp_min);
657
  INTPARAM("x264_i_qp_max", codec->params.rc.i_qp_max);
660
  INTPARAM("x264_i_qp_max", codec->params.rc.i_qp_max);
658
  INTPARAM("x264_i_qp_step", codec->params.rc.i_qp_step);
661
  INTPARAM("x264_i_qp_step", codec->params.rc.i_qp_step);
(-)plugins/x264/lqt_x264.c (-1 / +28 lines)
Lines 74-79 Link Here
74
      type:      LQT_PARAMETER_SECTION
74
      type:      LQT_PARAMETER_SECTION
75
    },
75
    },
76
    {
76
    {
77
      name:        "x264_i_rc_method",
78
      real_name:   "Ratecontrol method",
79
      type:        LQT_PARAMETER_STRINGLIST,
80
      val_default: { val_string: "Constant quality" },
81
      stringlist_options: (char*[]){ "Constant quality",
82
                                     "Average bitrate",
83
                                     "CRF based VBR",
84
                                     (char*)0 },
85
      help_string: "Ratecontrol method:\n\
86
Constant quality: Specify a quantizer parameter below\n\
87
Average bitrate: Specify a bitrate below\n\
88
CRF based VBR: Specify a rate factor below\n\
89
Selecting 2-pass encoding will force Average bitrate.",
90
    },
91
    {
77
      name:        "x264_i_bitrate",
92
      name:        "x264_i_bitrate",
78
      real_name:   "Bitrate",
93
      real_name:   "Bitrate",
79
      type:        LQT_PARAMETER_INT,
94
      type:        LQT_PARAMETER_INT,
Lines 81-86 Link Here
81
      help_string: "Bitrate in kbit/s. 0 means VBR (recommended)"
96
      help_string: "Bitrate in kbit/s. 0 means VBR (recommended)"
82
    },
97
    },
83
    {
98
    {
99
      name:        "x264_i_rf_constant",
100
      real_name:   "Nominal Quantizer parameter",
101
      type:        LQT_PARAMETER_INT,
102
      val_default: { val_int: 26 },
103
      val_min:     { val_int: 0 },
104
      val_max:     { val_int: 51 },
105
      help_string: "This selects the nominal quantizer to use (1 to 51). Lower values result in " \
106
    "better fidelity, but higher bitrates. 26 is a good default value. 0 means lossless."
107
    },
108
    {
84
      name:        "x264_i_qp_constant",
109
      name:        "x264_i_qp_constant",
85
      real_name:   "Quantizer parameter",
110
      real_name:   "Quantizer parameter",
86
      type:        LQT_PARAMETER_INT,
111
      type:        LQT_PARAMETER_INT,
Lines 90-96 Link Here
90
      help_string: "This selects the quantizer to use (1 to 51). Lower values result in " \
115
      help_string: "This selects the quantizer to use (1 to 51). Lower values result in " \
91
    "better fidelity, but higher bitrates. 26 is a good default value. 0 means lossless."
116
    "better fidelity, but higher bitrates. 26 is a good default value. 0 means lossless."
92
    },
117
    },
93
    {
118
119
120
{
94
      name:        "x264_i_qp_min",
121
      name:        "x264_i_qp_min",
95
      real_name:   "Minimum quantizer parameter",
122
      real_name:   "Minimum quantizer parameter",
96
      type:        LQT_PARAMETER_INT,
123
      type:        LQT_PARAMETER_INT,

Return to bug 143565