// DR. ROBOTNIK'S RING RACERS //----------------------------------------------------------------------------- // Copyright (C) 2024 by James Robert Roman // Copyright (C) 2024 by Kart Krew // // This program is free software distributed under the // terms of the GNU General Public License, version 2. // See the 'LICENSE' file for more details. //----------------------------------------------------------------------------- #include #include #include "options.hpp" #include "vorbis.hpp" #include "vp8.hpp" using namespace srb2::media; // NOTE: Options::cvars_ MUST be initialized before any // Options instances construct. For static objects, they have // to be defined in the same translation unit as // Options::cvars_ to guarantee initialization order. std::vector Options::cvars_; // clang-format off const Options VorbisEncoder::options_("vorbis", { {"quality", Options::values("0", {-0.1f, 1.f})}, {"max_bitrate", Options::values("-1", {-1})}, {"nominal_bitrate", Options::values("-1", {-1})}, {"min_bitrate", Options::values("-1", {-1})}, }); const Options VP8Encoder::options_("vp8", { {"quality_mode", Options::values("q", {}, { {"vbr", VPX_VBR}, {"cbr", VPX_CBR}, {"cq", VPX_CQ}, {"q", VPX_Q}, })}, {"target_bitrate", Options::values("800", {1})}, {"min_q", Options::values("4", {4, 63})}, {"max_q", Options::values("55", {4, 63})}, {"kf_min", Options::values("0", {0})}, {"kf_max", Options::values("auto", {0}, { {"auto", static_cast(KeyFrameOption::kAuto)}, })}, {"cpu_used", Options::values("0", {-16, 16})}, {"cq_level", Options::values("10", {0, 63})}, {"deadline", Options::values("10", {1}, { {"infinite", static_cast(DeadlineOption::kInfinite)}, })}, {"sharpness", Options::values("7", {0, 7})}, {"token_parts", Options::values("0", {0, 3})}, {"threads", Options::values("1", {1})}, }); // clang-format on