refactor(libvideo2x): convert the video processor into a class (#1246)

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
K4YT3X
2024-12-03 05:22:07 +00:00
committed by GitHub
parent a379c7481e
commit d4d1e58f8d
16 changed files with 612 additions and 665 deletions

View File

@@ -1,6 +1,7 @@
#ifndef PROCESSOR_H
#define PROCESSOR_H
#include <variant>
#include <vector>
extern "C" {
@@ -9,7 +10,46 @@ extern "C" {
#include <libavutil/buffer.h>
}
#include "libvideo2x.h"
#include "fsutils.h"
enum class ProcessingMode {
Filter,
Interpolate,
};
enum class ProcessorType {
Libplacebo,
RealESRGAN,
RIFE,
};
struct LibplaceboConfig {
StringType shader_path;
};
struct RealESRGANConfig {
bool tta_mode;
StringType model_name;
};
struct RIFEConfig {
bool tta_mode;
bool tta_temporal_mode;
bool uhd_mode;
int num_threads;
StringType model_name;
};
// Unified filter configuration
struct ProcessorConfig {
ProcessorType processor_type;
int width;
int height;
int scaling_factor;
int frm_rate_mul;
float scn_det_thresh;
std::variant<LibplaceboConfig, RealESRGANConfig, RIFEConfig> config;
};
class Processor {
public: