r134: Heroine Virtual's release 1.1.8
[cinelerra_cv/mob.git] / hvirtual / plugins / ivtc / ivtc.h
blobc1e87884f6c98a4706cb533aa2201afb1af73358
1 #ifndef IVTC_H
2 #define IVTC_H
4 class IVTCMain;
5 class IVTCEngine;
7 #define TOTAL_PATTERNS 2
9 #include "defaults.h"
10 #include "mutex.h"
11 #include "pluginvclient.h"
12 #include "ivtcwindow.h"
13 #include <sys/types.h>
15 class IVTCConfig
17 public:
18 IVTCConfig();
19 int frame_offset;
20 // 0 - even 1 - odd
21 int first_field;
22 int automatic;
23 float auto_threshold;
24 int pattern;
27 class IVTCMain : public PluginVClient
29 public:
30 IVTCMain(PluginServer *server);
31 ~IVTCMain();
33 // required for all realtime plugins
34 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
35 int is_realtime();
36 void save_data(KeyFrame *keyframe);
37 void read_data(KeyFrame *keyframe);
38 PLUGIN_CLASS_MEMBERS(IVTCConfig, IVTCThread)
39 void update_gui();
41 int load_defaults();
42 int save_defaults();
44 void compare_fields(VFrame *frame1,
45 VFrame *frame2,
46 int64_t &field1,
47 int64_t &field2);
50 // 0, 3, 4 indicating pattern frame the automatic algorithm is on
51 int state;
52 // New field detected in state 2
53 int new_field;
54 int64_t average, total_average;
55 VFrame *temp_frame[2];
57 IVTCEngine **engine;
60 class IVTCEngine : public Thread
62 public:
63 IVTCEngine(IVTCMain *plugin, int start_y, int end_y);
64 ~IVTCEngine();
66 void run();
67 int start_process_frame(VFrame *output, VFrame *input);
68 int wait_process_frame();
70 IVTCMain *plugin;
71 int start_y, end_y;
72 VFrame *output, *input;
73 Mutex input_lock, output_lock;
74 int last_frame;
75 int64_t field1, field2;
78 #endif