mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-02-04 03:22:07 +08:00
feat(rife): add support for frame interpolation and RIFE (#1244)
* feat: add RIFE files and processor/interpolator abstractions * feat: add `rife` as processor option * feat: add frame interpolation math except first frame * feat: complete motion interpolation and add scene detection * feat: improve Vulkan device validation * fix: fix casting issues and variable names * refactor: improve error-checking; add abstractions and factories * refactor: improve readability of the frames processor * docs: update changelog Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
@@ -30,13 +30,17 @@ extern "C" {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Enum to specify filter type
|
||||
enum FilterType {
|
||||
FILTER_LIBPLACEBO,
|
||||
FILTER_REALESRGAN
|
||||
enum ProcessingMode {
|
||||
PROCESSING_MODE_FILTER,
|
||||
PROCESSING_MODE_INTERPOLATE,
|
||||
};
|
||||
|
||||
enum ProcessorType {
|
||||
PROCESSOR_LIBPLACEBO,
|
||||
PROCESSOR_REALESRGAN,
|
||||
PROCESSOR_RIFE,
|
||||
};
|
||||
|
||||
// Enum to specify log level
|
||||
enum Libvideo2xLogLevel {
|
||||
LIBVIDEO2X_LOG_LEVEL_TRACE,
|
||||
LIBVIDEO2X_LOG_LEVEL_DEBUG,
|
||||
@@ -47,26 +51,37 @@ enum Libvideo2xLogLevel {
|
||||
LIBVIDEO2X_LOG_LEVEL_OFF
|
||||
};
|
||||
|
||||
// Configuration for Libplacebo filter
|
||||
struct LibplaceboConfig {
|
||||
int out_width;
|
||||
int out_height;
|
||||
const CharType *shader_path;
|
||||
};
|
||||
|
||||
// Configuration for RealESRGAN filter
|
||||
struct RealESRGANConfig {
|
||||
bool tta_mode;
|
||||
int scaling_factor;
|
||||
const CharType *model_name;
|
||||
};
|
||||
|
||||
struct RIFEConfig {
|
||||
bool tta_mode;
|
||||
bool tta_temporal_mode;
|
||||
bool uhd_mode;
|
||||
int num_threads;
|
||||
bool rife_v2;
|
||||
bool rife_v4;
|
||||
const CharType *model_name;
|
||||
};
|
||||
|
||||
// Unified filter configuration
|
||||
struct FilterConfig {
|
||||
enum FilterType filter_type;
|
||||
struct ProcessorConfig {
|
||||
enum ProcessorType processor_type;
|
||||
int width;
|
||||
int height;
|
||||
int scaling_factor;
|
||||
int frm_rate_mul;
|
||||
float scn_det_thresh;
|
||||
union {
|
||||
struct LibplaceboConfig libplacebo;
|
||||
struct RealESRGANConfig realesrgan;
|
||||
struct RIFEConfig rife;
|
||||
} config;
|
||||
};
|
||||
|
||||
@@ -140,7 +155,7 @@ LIBVIDEO2X_API int process_video(
|
||||
bool benchmark,
|
||||
uint32_t vk_device_index,
|
||||
enum AVHWDeviceType hw_device_type,
|
||||
const struct FilterConfig *filter_config,
|
||||
const struct ProcessorConfig *filter_config,
|
||||
struct EncoderConfig *encoder_config,
|
||||
struct VideoProcessingContext *proc_ctx
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user