diff --git a/tools/video2x/include/argparse.h b/tools/video2x/include/argparse.h index 886458b..5c1a7d6 100644 --- a/tools/video2x/include/argparse.h +++ b/tools/video2x/include/argparse.h @@ -16,11 +16,11 @@ struct Arguments { [[nodiscard]] int parse_args( int argc, #ifdef _WIN32 - wchar_t *argv[], + wchar_t* argv[], #else - char *argv[], + char* argv[], #endif - Arguments &arguments, - video2x::processors::ProcessorConfig &proc_cfg, - video2x::encoder::EncoderConfig &enc_cfg + Arguments& arguments, + video2x::processors::ProcessorConfig& proc_cfg, + video2x::encoder::EncoderConfig& enc_cfg ); diff --git a/tools/video2x/include/newline_safe_sink.h b/tools/video2x/include/newline_safe_sink.h index bad1320..03b5a1b 100644 --- a/tools/video2x/include/newline_safe_sink.h +++ b/tools/video2x/include/newline_safe_sink.h @@ -9,10 +9,10 @@ class newline_safe_sink : public spdlog::sinks::ansicolor_stdout_sink_mt { newline_safe_sink() = default; ~newline_safe_sink() = default; - newline_safe_sink(const newline_safe_sink &) = delete; - newline_safe_sink &operator=(const newline_safe_sink &) = delete; + newline_safe_sink(const newline_safe_sink&) = delete; + newline_safe_sink& operator=(const newline_safe_sink&) = delete; - void log(const spdlog::details::log_msg &msg); + void log(const spdlog::details::log_msg& msg); void set_needs_newline(bool needs_newline) { needs_newline_.store(needs_newline); }; bool get_needs_newline() { return needs_newline_.load(); }; diff --git a/tools/video2x/include/validators.h b/tools/video2x/include/validators.h index 12e11cd..b81875f 100644 --- a/tools/video2x/include/validators.h +++ b/tools/video2x/include/validators.h @@ -6,7 +6,7 @@ namespace po = boost::program_options; template -void validate_positive(const T &value, const std::string &option_name) { +void validate_positive(const T& value, const std::string& option_name) { if (value < 0) { throw po::validation_error( po::validation_error::invalid_option_value, @@ -17,7 +17,7 @@ void validate_positive(const T &value, const std::string &option_name) { } template -void validate_min(const T &value, const std::string &option_name, const T &min) { +void validate_min(const T& value, const std::string& option_name, const T& min) { if (value < min) { throw po::validation_error( po::validation_error::invalid_option_value, @@ -28,7 +28,7 @@ void validate_min(const T &value, const std::string &option_name, const T &min) } template -void validate_max(const T &value, const std::string &option_name, const T &max) { +void validate_max(const T& value, const std::string& option_name, const T& max) { if (value > max) { throw po::validation_error( po::validation_error::invalid_option_value, @@ -39,7 +39,7 @@ void validate_max(const T &value, const std::string &option_name, const T &max) } template -void validate_range(const T &value, const std::string &option_name, const T &min, const T &max) { +void validate_range(const T& value, const std::string& option_name, const T& min, const T& max) { if (value < min || value > max) { throw po::validation_error( po::validation_error::invalid_option_value, @@ -51,7 +51,7 @@ void validate_range(const T &value, const std::string &option_name, const T &min } template -void validate_greater_equal_one(const T &value, const std::string &option_name) { +void validate_greater_equal_one(const T& value, const std::string& option_name) { if (value < 1) { throw po::validation_error( po::validation_error::invalid_option_value, @@ -61,10 +61,10 @@ void validate_greater_equal_one(const T &value, const std::string &option_name) } } -void validate_anime4k_shader_name(const video2x::fsutils::StringType &shader_name); +void validate_anime4k_shader_name(const video2x::fsutils::StringType& shader_name); -void validate_realesrgan_model_name(const video2x::fsutils::StringType &model_name); +void validate_realesrgan_model_name(const video2x::fsutils::StringType& model_name); -void validate_realcugan_model_name(const video2x::fsutils::StringType &model_name); +void validate_realcugan_model_name(const video2x::fsutils::StringType& model_name); -void validate_rife_model_name(const video2x::fsutils::StringType &model_name); +void validate_rife_model_name(const video2x::fsutils::StringType& model_name); diff --git a/tools/video2x/include/vulkan_utils.h b/tools/video2x/include/vulkan_utils.h index 26ee298..13eb969 100644 --- a/tools/video2x/include/vulkan_utils.h +++ b/tools/video2x/include/vulkan_utils.h @@ -4,4 +4,4 @@ int list_vulkan_devices(); -int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties *dev_props); +int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties* dev_props); diff --git a/tools/video2x/src/argparse.cpp b/tools/video2x/src/argparse.cpp index b32c26e..54218c1 100644 --- a/tools/video2x/src/argparse.cpp +++ b/tools/video2x/src/argparse.cpp @@ -25,7 +25,7 @@ namespace po = boost::program_options; #ifdef _WIN32 -std::string wstring_to_u8string(const std::wstring &wstr) { +std::string wstring_to_u8string(const std::wstring& wstr) { if (wstr.empty()) { return std::string(); } @@ -46,7 +46,7 @@ std::string wstring_to_u8string(const std::wstring &wstr) { return converted_str; } #else -std::string wstring_to_u8string(const std::string &str) { +std::string wstring_to_u8string(const std::string& str) { return str; } #endif @@ -54,13 +54,13 @@ std::string wstring_to_u8string(const std::string &str) { int parse_args( int argc, #ifdef _WIN32 - wchar_t *argv[], + wchar_t* argv[], #else - char *argv[], + char* argv[], #endif - Arguments &arguments, - video2x::processors::ProcessorConfig &proc_cfg, - video2x::encoder::EncoderConfig &enc_cfg + Arguments& arguments, + video2x::processors::ProcessorConfig& proc_cfg, + video2x::encoder::EncoderConfig& enc_cfg ) { try { // clang-format off @@ -310,7 +310,7 @@ int parse_args( enc_cfg.codec = AV_CODEC_ID_H264; if (vm.count("codec")) { video2x::fsutils::StringType codec_str = vm["codec"].as(); - const AVCodec *codec = + const AVCodec* codec = avcodec_find_encoder_by_name(wstring_to_u8string(codec_str).c_str()); if (codec == nullptr) { video2x::logger()->critical( @@ -342,7 +342,7 @@ int parse_args( // Parse extra AVOptions if (vm.count("extra-encoder-option")) { - for (const auto &opt : + for (const auto& opt : vm["extra-encoder-option"].as>()) { size_t eq_pos = opt.find('='); if (eq_pos != video2x::fsutils::StringType::npos) { @@ -467,10 +467,10 @@ int parse_args( video2x::logger()->critical("Invalid processor type."); return -1; } - } catch (const po::error &e) { + } catch (const po::error& e) { video2x::logger()->critical("Error parsing arguments: {}", e.what()); return -1; - } catch (const std::exception &e) { + } catch (const std::exception& e) { video2x::logger()->critical( "Unexpected exception caught while parsing options: {}", e.what() ); diff --git a/tools/video2x/src/newline_safe_sink.cpp b/tools/video2x/src/newline_safe_sink.cpp index 59cc654..27afd91 100644 --- a/tools/video2x/src/newline_safe_sink.cpp +++ b/tools/video2x/src/newline_safe_sink.cpp @@ -1,6 +1,6 @@ #include "newline_safe_sink.h" -void newline_safe_sink::log(const spdlog::details::log_msg &msg) { +void newline_safe_sink::log(const spdlog::details::log_msg& msg) { if (needs_newline_.exchange(false)) { std::fputs("\n", stdout); } diff --git a/tools/video2x/src/validators.cpp b/tools/video2x/src/validators.cpp index 14ef5e0..f2fbbda 100644 --- a/tools/video2x/src/validators.cpp +++ b/tools/video2x/src/validators.cpp @@ -2,7 +2,7 @@ #include -void validate_anime4k_shader_name(const video2x::fsutils::StringType &shader_name) { +void validate_anime4k_shader_name(const video2x::fsutils::StringType& shader_name) { static const std::unordered_set valid_anime4k_shaders = { STR("anime4k-v4-a"), STR("anime4k-v4-a+a"), @@ -22,7 +22,7 @@ void validate_anime4k_shader_name(const video2x::fsutils::StringType &shader_nam } } -void validate_realesrgan_model_name(const video2x::fsutils::StringType &model_name) { +void validate_realesrgan_model_name(const video2x::fsutils::StringType& model_name) { static const std::unordered_set valid_realesrgan_models = { STR("realesrgan-plus"), STR("realesrgan-plus-anime"), STR("realesr-animevideov3") }; @@ -36,7 +36,7 @@ void validate_realesrgan_model_name(const video2x::fsutils::StringType &model_na } } -void validate_realcugan_model_name(const video2x::fsutils::StringType &model_name) { +void validate_realcugan_model_name(const video2x::fsutils::StringType& model_name) { static const std::unordered_set valid_realcugan_models = { STR("models-nose"), STR("models-pro"), STR("models-se") }; @@ -49,7 +49,7 @@ void validate_realcugan_model_name(const video2x::fsutils::StringType &model_nam } } -void validate_rife_model_name(const video2x::fsutils::StringType &model_name) { +void validate_rife_model_name(const video2x::fsutils::StringType& model_name) { static const std::unordered_set valid_rife_models = { STR("rife"), STR("rife-HD"), diff --git a/tools/video2x/src/video2x.cpp b/tools/video2x/src/video2x.cpp index f5b8e0c..6a669f9 100644 --- a/tools/video2x/src/video2x.cpp +++ b/tools/video2x/src/video2x.cpp @@ -40,7 +40,7 @@ std::tuple calculate_time_components(int time_elapsed) { } #ifdef _WIN32 -int wmain(int argc, wchar_t *argv[]) { +int wmain(int argc, wchar_t* argv[]) { // Set console output code page to UTF-8 SetConsoleOutputCP(CP_UTF8); @@ -51,7 +51,7 @@ int wmain(int argc, wchar_t *argv[]) { console_mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; SetConsoleMode(console_handle, console_mode); #else -int main(int argc, char **argv) { +int main(int argc, char** argv) { #endif // Initialize newline-safe logger with custom formatting pattern std::shared_ptr logger_sink = std::make_shared(); diff --git a/tools/video2x/src/vulkan_utils.cpp b/tools/video2x/src/vulkan_utils.cpp index 6bb2c97..7950597 100644 --- a/tools/video2x/src/vulkan_utils.cpp +++ b/tools/video2x/src/vulkan_utils.cpp @@ -5,7 +5,7 @@ #include -static int enumerate_vulkan_devices(VkInstance *instance, std::vector &devices) { +static int enumerate_vulkan_devices(VkInstance* instance, std::vector& devices) { // Create a Vulkan instance VkInstanceCreateInfo create_info{}; create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; @@ -96,7 +96,7 @@ int list_vulkan_devices() { return 0; } -int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties *dev_props) { +int get_vulkan_device_prop(uint32_t vk_device_index, VkPhysicalDeviceProperties* dev_props) { if (dev_props == nullptr) { video2x::logger()->error("Invalid device properties pointer."); return -1;