00001 #ifndef IVTC_H
00002 #define IVTC_H
00003
00004 class IVTCMain;
00005 class IVTCEngine;
00006
00007 #include "bchash.h"
00008 #include "loadbalance.h"
00009 #include "mutex.h"
00010 #include "pluginvclient.h"
00011 #include "ivtcwindow.h"
00012 #include <sys/types.h>
00013
00014 class IVTCEngine;
00015
00016 class IVTCConfig
00017 {
00018 public:
00019 IVTCConfig();
00020 int frame_offset;
00021
00022 int first_field;
00023 int automatic;
00024 float auto_threshold;
00025 int pattern;
00026 enum
00027 {
00028 PULLDOWN32,
00029 SHIFTFIELD,
00030 AUTOMATIC
00031 };
00032 };
00033
00034 class IVTCMain : public PluginVClient
00035 {
00036 public:
00037 IVTCMain(PluginServer *server);
00038 ~IVTCMain();
00039
00040
00041 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
00042 int is_realtime();
00043 void save_data(KeyFrame *keyframe);
00044 void read_data(KeyFrame *keyframe);
00045 PLUGIN_CLASS_MEMBERS(IVTCConfig, IVTCThread)
00046 void update_gui();
00047 void render_stop();
00048
00049 int load_defaults();
00050 int save_defaults();
00051
00052 void compare_fields(VFrame *frame1,
00053 VFrame *frame2,
00054 int64_t &field1,
00055 int64_t &field2);
00056 int64_t compare(VFrame *current_avg,
00057 VFrame *current_orig,
00058 VFrame *previous,
00059 int field);
00060
00061 void deinterlace_avg(VFrame *output, VFrame *input, int dominance);
00062
00063
00064 VFrame *temp_frame[2];
00065 VFrame *input, *output;
00066
00067
00068
00069 int64_t even_vs_current;
00070
00071 int64_t even_vs_prev;
00072
00073 int64_t odd_vs_current;
00074
00075 int64_t odd_vs_prev;
00076
00077
00078
00079
00080 int64_t previous_min;
00081 int previous_strategy;
00082 IVTCEngine *engine;
00083 };
00084
00085
00086 class IVTCPackage : public LoadPackage
00087 {
00088 public:
00089 IVTCPackage();
00090 int y1, y2;
00091 };
00092
00093 class IVTCUnit : public LoadClient
00094 {
00095 public:
00096 IVTCUnit(IVTCEngine *server, IVTCMain *plugin);
00097 void process_package(LoadPackage *package);
00098 void clear_totals();
00099 IVTCEngine *server;
00100 IVTCMain *plugin;
00101 int64_t even_vs_current;
00102 int64_t even_vs_prev;
00103 int64_t odd_vs_current;
00104 int64_t odd_vs_prev;
00105 };
00106
00107
00108 class IVTCEngine : public LoadServer
00109 {
00110 public:
00111 IVTCEngine(IVTCMain *plugin, int cpus);
00112 ~IVTCEngine();
00113 void init_packages();
00114 LoadClient* new_client();
00115 LoadPackage* new_package();
00116 IVTCMain *plugin;
00117 };
00118
00119 #endif