X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_encoder.cpp;h=8463d1bae285744a420aa47a1155504eb3f07b00;hb=6ffaabac0a523617b686f40c154a25cb548cc561;hp=ccf6942e1813ef7aa4748b45b531d108dd06d64f;hpb=79cff66d44285fa9cb4548104746d1cc6fb81e9c;p=nageru diff --git a/x264_encoder.cpp b/x264_encoder.cpp index ccf6942..8463d1b 100644 --- a/x264_encoder.cpp +++ b/x264_encoder.cpp @@ -150,6 +150,9 @@ void X264Encoder::init_x264() if (global_flags.x264_speedcontrol) { param.i_frame_reference = 16; // Because speedcontrol is never allowed to change this above what we set at start. } +#if X264_BUILD >= 153 + param.i_bitdepth = global_flags.x264_bit_depth; +#endif // NOTE: These should be in sync with the ones in quicksync_encoder.cpp (sps_rbsp()). param.vui.i_vidformat = 5; // Unspecified. @@ -343,7 +346,12 @@ void X264Encoder::encode_frame(X264Encoder::QueuedFrame qf) } if (speed_control) { - speed_control->before_frame(float(free_frames.size()) / X264_QUEUE_LENGTH, X264_QUEUE_LENGTH, 1e6 * qf.duration / TIMEBASE); + float queue_fill_ratio; + { + lock_guard lock(mu); + queue_fill_ratio = float(free_frames.size()) / X264_QUEUE_LENGTH; + } + speed_control->before_frame(queue_fill_ratio, X264_QUEUE_LENGTH, 1e6 * qf.duration / TIMEBASE); } dyn.x264_encoder_encode(x264, &nal, &num_nal, input_pic, &pic); if (speed_control) {