4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "loadbalance.h"
31 #include "pluginvclient.h"
32 #include "ivtcwindow.h"
33 #include <sys/types.h>
55 class IVTCMain : public PluginVClient
58 IVTCMain(PluginServer *server);
61 // required for all realtime plugins
62 int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
64 void save_data(KeyFrame *keyframe);
65 void read_data(KeyFrame *keyframe);
66 PLUGIN_CLASS_MEMBERS(IVTCConfig)
70 void compare_fields(VFrame *frame1,
74 int64_t compare(VFrame *current_avg,
79 void deinterlace_avg(VFrame *output, VFrame *input, int dominance);
82 VFrame *temp_frame[2];
83 VFrame *input, *output;
85 // Automatic IVTC variables
86 // Difference between averaged current even lines and original even lines
87 int64_t even_vs_current;
88 // Difference between averaged current even lines and previous even lines
90 // Difference between averaged current odd lines and original odd lines
91 int64_t odd_vs_current;
92 // Difference between averaged current odd lines and previous odd lines
95 // Closest combination of fields in previous calculation.
96 // If the lowest current combination is too big and the previous strategy
97 // was direct copy, copy the previous frame.
99 int previous_strategy;
104 class IVTCPackage : public LoadPackage
111 class IVTCUnit : public LoadClient
114 IVTCUnit(IVTCEngine *server, IVTCMain *plugin);
115 void process_package(LoadPackage *package);
119 int64_t even_vs_current;
120 int64_t even_vs_prev;
121 int64_t odd_vs_current;
126 class IVTCEngine : public LoadServer
129 IVTCEngine(IVTCMain *plugin, int cpus);
131 void init_packages();
132 LoadClient* new_client();
133 LoadPackage* new_package();