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:
36
include/libvideo2x/processor_factory.h
Normal file
36
include/libvideo2x/processor_factory.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef PROCESSOR_FACTORY_H
|
||||
#define PROCESSOR_FACTORY_H
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "processor.h"
|
||||
|
||||
// Processor Factory Class
|
||||
class ProcessorFactory {
|
||||
public:
|
||||
using Creator = std::function<std::unique_ptr<Processor>(const ProcessorConfig *, uint32_t)>;
|
||||
|
||||
// Singleton instance accessor
|
||||
static ProcessorFactory &instance();
|
||||
|
||||
// Register a processor type with its creation function
|
||||
void register_processor(ProcessorType type, Creator creator);
|
||||
|
||||
// Create a processor instance based on configuration
|
||||
std::unique_ptr<Processor>
|
||||
create_processor(const ProcessorConfig *processor_config, uint32_t vk_device_index) const;
|
||||
|
||||
private:
|
||||
// Private constructor for Singleton
|
||||
ProcessorFactory() = default;
|
||||
|
||||
// Map of processor types to their creation functions
|
||||
std::unordered_map<ProcessorType, Creator> creators;
|
||||
|
||||
// Static initializer for default processors
|
||||
static void init_default_processors(ProcessorFactory &factory);
|
||||
};
|
||||
|
||||
#endif // PROCESSOR_FACTORY_H
|
||||
Reference in New Issue
Block a user