if (global_flags.x264_bitrate == -1) {
return;
}
- if (global_flags.x264_vbv_buffer_size < 0) {
- param->rc.i_vbv_buffer_size = param->rc.i_bitrate; // One-second VBV.
- } else {
- param->rc.i_vbv_buffer_size = global_flags.x264_vbv_buffer_size;
- }
- if (global_flags.x264_vbv_max_bitrate < 0) {
- param->rc.i_vbv_max_bitrate = param->rc.i_bitrate; // CBR.
- } else {
- param->rc.i_vbv_max_bitrate = global_flags.x264_vbv_max_bitrate;
- }
+ param->rc.i_vbv_buffer_size = param->rc.i_bitrate; // One-second VBV.
+ param->rc.i_vbv_max_bitrate = param->rc.i_bitrate; // CBR.
}
} // namespace
} else {
param.rc.i_rc_method = X264_RC_ABR;
param.rc.i_bitrate = bitrate;
- }
- if (!use_separate_disk_params) {
- update_vbv_settings(¶m);
- }
- if (param.rc.i_vbv_max_bitrate > 0) {
- // If the user wants VBV control to cap the max rate, it is
- // also reasonable to assume that they are fine with the stream
- // constantly being around that rate even for very low-complexity
- // content; the obvious and extreme example being a static
- // black picture.
+
+ // If the user wants to cap the max rate, it is also reasonable
+ // to assume that they are fine with the stream constantly
+ // being around that rate even for very low-complexity content;
+ // the obvious and extreme example being a static black picture.
//
// One would think it's fine to have low-complexity content use
// less bitrate, but it seems to cause problems in practice;
// thus ignores the parameter.)
param.rc.b_filler = 1;
}
+ if (!use_separate_disk_params) {
+ update_vbv_settings(¶m);
+ }
// Occasionally players have problem with extremely low quantizers;
// be on the safe side. Shouldn't affect quality in any meaningful way.