r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / plugins / ivtc / ivtc.h
blob0950c722b16a1e86072d8189a061cf54fdc247a9
1 #ifndef IVTC_H
2 #define IVTC_H
4 class IVTCMain;
5 class IVTCEngine;
7 #define TOTAL_PATTERNS 3
9 static char *pattern_text[] =
11 "A B BC CD D",
12 "AB BC CD DE EF",
13 "Automatic"
16 #include "defaults.h"
17 #include "loadbalance.h"
18 #include "mutex.h"
19 #include "pluginvclient.h"
20 #include "ivtcwindow.h"
21 #include <sys/types.h>
23 class IVTCEngine;
25 class IVTCConfig
27 public:
28 IVTCConfig();
29 int frame_offset;
30 // 0 - even 1 - odd
31 int first_field;
32 int automatic;
33 float auto_threshold;
34 int pattern;
35 enum
37 PULLDOWN32,
38 SHIFTFIELD,
39 AUTOMATIC
43 class IVTCMain : public PluginVClient
45 public:
46 IVTCMain(PluginServer *server);
47 ~IVTCMain();
49 // required for all realtime plugins
50 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
51 int is_realtime();
52 void save_data(KeyFrame *keyframe);
53 void read_data(KeyFrame *keyframe);
54 PLUGIN_CLASS_MEMBERS(IVTCConfig, IVTCThread)
55 void update_gui();
57 int load_defaults();
58 int save_defaults();
60 void compare_fields(VFrame *frame1,
61 VFrame *frame2,
62 int64_t &field1,
63 int64_t &field2);
64 int64_t compare(VFrame *current_avg,
65 VFrame *current_orig,
66 VFrame *previous,
67 int field);
69 void deinterlace_avg(VFrame *output, VFrame *input, int dominance);
72 VFrame *temp_frame[2];
73 VFrame *input, *output;
74 int64_t even_vs_current;
75 int64_t even_vs_prev;
76 int64_t odd_vs_current;
77 int64_t odd_vs_prev;
78 IVTCEngine *engine;
82 class IVTCPackage : public LoadPackage
84 public:
85 IVTCPackage();
86 int y1, y2;
89 class IVTCUnit : public LoadClient
91 public:
92 IVTCUnit(IVTCEngine *server, IVTCMain *plugin);
93 void process_package(LoadPackage *package);
94 void clear_totals();
95 IVTCEngine *server;
96 IVTCMain *plugin;
97 int64_t even_vs_current;
98 int64_t even_vs_prev;
99 int64_t odd_vs_current;
100 int64_t odd_vs_prev;
104 class IVTCEngine : public LoadServer
106 public:
107 IVTCEngine(IVTCMain *plugin, int cpus);
108 ~IVTCEngine();
109 void init_packages();
110 LoadClient* new_client();
111 LoadPackage* new_package();
112 IVTCMain *plugin;
115 #endif