00001 #ifndef DEINTERLACE_H
00002 #define DEINTERLACE_H
00003
00004
00005
00006 class DeInterlaceMain;
00007
00008 #include "bchash.inc"
00009 #include "deinterwindow.h"
00010 #include "pluginvclient.h"
00011 #include "vframe.inc"
00012
00013
00014
00015 #define THRESHOLD_SCALAR 1000
00016
00017 enum
00018 {
00019 DEINTERLACE_NONE,
00020 DEINTERLACE_KEEP,
00021 DEINTERLACE_AVG_1F,
00022 DEINTERLACE_AVG,
00023 DEINTERLACE_BOBWEAVE,
00024 DEINTERLACE_SWAP,
00025 DEINTERLACE_TEMPORALSWAP,
00026 };
00027
00028 class DeInterlaceConfig
00029 {
00030 public:
00031 DeInterlaceConfig();
00032
00033 int equivalent(DeInterlaceConfig &that);
00034 void copy_from(DeInterlaceConfig &that);
00035 void interpolate(DeInterlaceConfig &prev,
00036 DeInterlaceConfig &next,
00037 int64_t prev_frame,
00038 int64_t next_frame,
00039 int64_t current_frame);
00040
00041 int mode;
00042 int adaptive;
00043 int threshold;
00044 volatile int dominance;
00045 };
00046
00047 class DeInterlaceMain : public PluginVClient
00048 {
00049 public:
00050 DeInterlaceMain(PluginServer *server);
00051 ~DeInterlaceMain();
00052
00053
00054 PLUGIN_CLASS_MEMBERS(DeInterlaceConfig, DeInterlaceThread)
00055
00056
00057
00058 int process_buffer(VFrame *frame,
00059 int64_t start_position,
00060 double frame_rate);
00061 int is_realtime();
00062 int hide_gui();
00063 void update_gui();
00064 void save_data(KeyFrame *keyframe);
00065 void read_data(KeyFrame *keyframe);
00066 int load_defaults();
00067 int save_defaults();
00068 void render_gui(void *data);
00069
00070 void deinterlace_avg_top(VFrame *input, VFrame *output, int dominance);
00071 void deinterlace_top(VFrame *input, VFrame *output, int dominance);
00072 void deinterlace_avg(VFrame *input, VFrame *output);
00073 void deinterlace_swap(VFrame *input, VFrame *output, int dominance);
00074 void deinterlace_temporalswap(VFrame *input, VFrame *prevframe, VFrame *output, int dominance);
00075 void deinterlace_bobweave(VFrame *input, VFrame *prevframe, VFrame *output, int dominance);
00076
00077 int changed_rows;
00078 VFrame *temp;
00079 VFrame *temp_prevframe;
00080 };
00081
00082
00083 #endif