r468: Temporal swap of fields implemented by Jerome Cornet <jcornet at sympatico...
[cinelerra_cv.git] / plugins / deinterlace / deinterlace.h
blob7d5a0aaa4eaf49c6863ac7b2540bc7840fab7877
1 #ifndef DEINTERLACE_H
2 #define DEINTERLACE_H
4 // the simplest plugin possible
6 class DeInterlaceMain;
8 #include "defaults.inc"
9 #include "deinterwindow.h"
10 #include "pluginvclient.h"
11 #include "vframe.inc"
15 #define THRESHOLD_SCALAR 1000
17 enum
19 DEINTERLACE_NONE,
20 DEINTERLACE_EVEN,
21 DEINTERLACE_ODD,
22 DEINTERLACE_AVG,
23 DEINTERLACE_SWAP_ODD,
24 DEINTERLACE_SWAP_EVEN,
25 DEINTERLACE_TEMPORALSWAP_TOP,
26 DEINTERLACE_TEMPORALSWAP_BOTTOM,
27 DEINTERLACE_AVG_ODD,
28 DEINTERLACE_AVG_EVEN
31 class DeInterlaceConfig
33 public:
34 DeInterlaceConfig();
36 int equivalent(DeInterlaceConfig &that);
37 void copy_from(DeInterlaceConfig &that);
38 void interpolate(DeInterlaceConfig &prev,
39 DeInterlaceConfig &next,
40 int64_t prev_frame,
41 int64_t next_frame,
42 int64_t current_frame);
44 int mode;
45 int adaptive;
46 int threshold;
49 class DeInterlaceMain : public PluginVClient
51 public:
52 DeInterlaceMain(PluginServer *server);
53 ~DeInterlaceMain();
56 PLUGIN_CLASS_MEMBERS(DeInterlaceConfig, DeInterlaceThread)
58 // required for all realtime plugins
59 int process_realtime(VFrame *input, VFrame *output);
60 int is_realtime();
61 int hide_gui();
62 void update_gui();
63 void save_data(KeyFrame *keyframe);
64 void read_data(KeyFrame *keyframe);
65 int load_defaults();
66 int save_defaults();
67 void render_gui(void *data);
69 void deinterlace_avg_even(VFrame *input, VFrame *output, int dominance);
70 void deinterlace_even(VFrame *input, VFrame *output, int dominance);
71 void deinterlace_avg(VFrame *input, VFrame *output);
72 void deinterlace_swap(VFrame *input, VFrame *output, int dominance);
73 void deinterlace_temporalswap(VFrame *input, VFrame *nextfrane, VFrame *output, int dominance);
75 int changed_rows;
76 VFrame *temp;
77 VFrame *temp_prevframe;
81 #endif