X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_speed_control.h;h=b0a1739d022e462c48c7e80e7b73b905fcdb6411;hb=6ffaabac0a523617b686f40c154a25cb548cc561;hp=2a20414089450d78b9c03ad15f2ed967250010d5;hpb=0ec13fe273ceb4f0db4d1b431a8adec9f1f03b7e;p=nageru diff --git a/x264_speed_control.h b/x264_speed_control.h index 2a20414..b0a1739 100644 --- a/x264_speed_control.h +++ b/x264_speed_control.h @@ -1,3 +1,6 @@ +#ifndef _X264_SPEED_CONTROL_H +#define _X264_SPEED_CONTROL_H 1 + // The x264 speed control tries to encode video at maximum possible quality // without skipping frames (at the expense of higher encoding latency and // less even output rates, although VBV is still respected). It does this @@ -52,10 +55,9 @@ extern "C" { #include } +#include "metrics.h" #include "x264_dynamic.h" -#define SC_PRESETS 26 - class X264SpeedControl { public: // x264: Encoding object we are using; must be opened. Assumed to be @@ -132,10 +134,11 @@ private: std::function override_func = nullptr; // Metrics. - std::atomic metric_x264_speedcontrol_preset_used_frames[SC_PRESETS]{{0}}; - std::atomic metric_x264_speedcontrol_preset_used_frames_sum{0.0}; + Histogram metric_x264_speedcontrol_preset_used_frames; std::atomic metric_x264_speedcontrol_buffer_available_seconds{0.0}; std::atomic metric_x264_speedcontrol_buffer_size_seconds{0.0}; std::atomic metric_x264_speedcontrol_idle_frames{0}; std::atomic metric_x264_speedcontrol_late_frames{0}; }; + +#endif // !defined(_X264_SPEED_CONTROL_H)