r851: Merge 2.1:
[cinelerra_cv/ct.git] / plugins / ivtc / ivtc.h
blob14d00dd00465b16710567de0e315db324bda62d0
1 #ifndef IVTC_H
2 #define IVTC_H
4 class IVTCMain;
5 class IVTCEngine;
7 #include "bchash.h"
8 #include "loadbalance.h"
9 #include "mutex.h"
10 #include "pluginvclient.h"
11 #include "ivtcwindow.h"
12 #include <sys/types.h>
14 class IVTCEngine;
16 class IVTCConfig
18 public:
19 IVTCConfig();
20 int frame_offset;
21 // 0 - even 1 - odd
22 int first_field;
23 int automatic;
24 float auto_threshold;
25 int pattern;
26 enum
28 PULLDOWN32,
29 SHIFTFIELD,
30 AUTOMATIC
34 class IVTCMain : public PluginVClient
36 public:
37 IVTCMain(PluginServer *server);
38 ~IVTCMain();
40 // required for all realtime plugins
41 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
42 int is_realtime();
43 void save_data(KeyFrame *keyframe);
44 void read_data(KeyFrame *keyframe);
45 PLUGIN_CLASS_MEMBERS(IVTCConfig, IVTCThread)
46 void update_gui();
47 void render_stop();
49 int load_defaults();
50 int save_defaults();
52 void compare_fields(VFrame *frame1,
53 VFrame *frame2,
54 int64_t &field1,
55 int64_t &field2);
56 int64_t compare(VFrame *current_avg,
57 VFrame *current_orig,
58 VFrame *previous,
59 int field);
61 void deinterlace_avg(VFrame *output, VFrame *input, int dominance);
64 VFrame *temp_frame[2];
65 VFrame *input, *output;
66 int64_t even_vs_current;
67 int64_t even_vs_prev;
68 int64_t odd_vs_current;
69 int64_t odd_vs_prev;
71 // Closest combination of fields in previous calculation.
72 int64_t previous_min;
73 IVTCEngine *engine;
77 class IVTCPackage : public LoadPackage
79 public:
80 IVTCPackage();
81 int y1, y2;
84 class IVTCUnit : public LoadClient
86 public:
87 IVTCUnit(IVTCEngine *server, IVTCMain *plugin);
88 void process_package(LoadPackage *package);
89 void clear_totals();
90 IVTCEngine *server;
91 IVTCMain *plugin;
92 int64_t even_vs_current;
93 int64_t even_vs_prev;
94 int64_t odd_vs_current;
95 int64_t odd_vs_prev;
99 class IVTCEngine : public LoadServer
101 public:
102 IVTCEngine(IVTCMain *plugin, int cpus);
103 ~IVTCEngine();
104 void init_packages();
105 LoadClient* new_client();
106 LoadPackage* new_package();
107 IVTCMain *plugin;
110 #endif