r870: Merge 2.1:
[cinelerra_cv.git] / plugins / deinterlace / deinterlace.h
blob9affdd47fd36982dd7c6034ce711b7b6a448b9a0
1 #ifndef DEINTERLACE_H
2 #define DEINTERLACE_H
4 // the simplest plugin possible
6 class DeInterlaceMain;
8 #include "bchash.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_KEEP,
21 DEINTERLACE_AVG_1F,
22 DEINTERLACE_AVG,
23 DEINTERLACE_BOBWEAVE,
24 DEINTERLACE_SWAP,
25 DEINTERLACE_TEMPORALSWAP,
28 class DeInterlaceConfig
30 public:
31 DeInterlaceConfig();
33 int equivalent(DeInterlaceConfig &that);
34 void copy_from(DeInterlaceConfig &that);
35 void interpolate(DeInterlaceConfig &prev,
36 DeInterlaceConfig &next,
37 int64_t prev_frame,
38 int64_t next_frame,
39 int64_t current_frame);
41 int mode;
42 int adaptive;
43 int threshold;
44 volatile int dominance; /* top or bottom field */
47 class DeInterlaceMain : public PluginVClient
49 public:
50 DeInterlaceMain(PluginServer *server);
51 ~DeInterlaceMain();
54 PLUGIN_CLASS_MEMBERS(DeInterlaceConfig, DeInterlaceThread)
57 // required for all realtime plugins
58 int process_buffer(VFrame *frame,
59 int64_t start_position,
60 double frame_rate);
61 int is_realtime();
62 int hide_gui();
63 void update_gui();
64 void save_data(KeyFrame *keyframe);
65 void read_data(KeyFrame *keyframe);
66 int load_defaults();
67 int save_defaults();
68 void render_gui(void *data);
70 void deinterlace_avg_top(VFrame *input, VFrame *output, int dominance);
71 void deinterlace_top(VFrame *input, VFrame *output, int dominance);
72 void deinterlace_avg(VFrame *input, VFrame *output);
73 void deinterlace_swap(VFrame *input, VFrame *output, int dominance);
74 void deinterlace_temporalswap(VFrame *input, VFrame *prevframe, VFrame *output, int dominance);
75 void deinterlace_bobweave(VFrame *input, VFrame *prevframe, VFrame *output, int dominance);
77 int changed_rows;
78 VFrame *temp;
79 VFrame *temp_prevframe;
83 #endif