bbea19dfec2a318c0ee564bbaa20236eb54536b9
[goodguy/history.git] / cinelerra-5.1 / plugins / interpolatevideo / opticflow.h
1 /*
2  * CINELERRA
3  * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21 #ifndef OPTICFLOW_H
22 #define OPTICFLOW_H
23
24
25 #include "interpolatevideo.inc"
26 #include "loadbalance.h"
27 #include "motionscan.inc"
28 #include "opticflow.inc"
29
30 // Need a 2nd table if a large number of packages
31 class OpticFlowMacroblock
32 {
33 public:
34         OpticFlowMacroblock();
35         void copy_from(OpticFlowMacroblock *src);
36
37         int x, y;
38         int dx, dy;
39         int is_valid;
40 // Temporaries for blending macroblocks
41         float angle1, angle2;
42         float dist;
43         int visible;
44 };
45
46 class OpticFlowPackage : public LoadPackage
47 {
48 public:
49         OpticFlowPackage();
50         int macroblock0;
51         int macroblock1;
52 };
53
54 class OpticFlowUnit : public LoadClient
55 {
56 public:
57         OpticFlowUnit(OpticFlow *server);
58         ~OpticFlowUnit();
59         void process_package(LoadPackage *package);
60         MotionScan *motion;
61         OpticFlow *server;
62 };
63
64
65 class OpticFlow : public LoadServer
66 {
67 public:
68         OpticFlow(InterpolateVideo *plugin,
69                 int total_clients,
70                 int total_packages);
71         ~OpticFlow();
72         void init_packages();
73         LoadClient* new_client();
74         LoadPackage* new_package();
75         InterpolateVideo *plugin;
76 };
77
78
79
80
81
82
83
84
85
86 class WarpPackage : public LoadPackage
87 {
88 public:
89         WarpPackage();
90         int y1, y2;
91 };
92
93 class WarpUnit : public LoadClient
94 {
95 public:
96         WarpUnit(Warp *server);
97         ~WarpUnit();
98         void process_package(LoadPackage *package);
99         Warp *server;
100 };
101
102
103 class Warp : public LoadServer
104 {
105 public:
106         Warp(InterpolateVideo *plugin,
107                 int total_clients,
108                 int total_packages);
109         ~Warp();
110         void init_packages();
111         LoadClient* new_client();
112         LoadPackage* new_package();
113         InterpolateVideo *plugin;
114 };
115
116
117
118
119
120
121 class BlendPackage : public LoadPackage
122 {
123 public:
124         BlendPackage();
125         int number0, number1;
126 };
127
128
129
130 class BlendMacroblockUnit : public LoadClient
131 {
132 public:
133         BlendMacroblockUnit(BlendMacroblock *server);
134         ~BlendMacroblockUnit();
135         void process_package(LoadPackage *package);
136         BlendMacroblock *server;
137 };
138
139
140 class BlendMacroblock : public LoadServer
141 {
142 public:
143         BlendMacroblock(InterpolateVideo *plugin,
144                 int total_clients,
145                 int total_packages);
146         ~BlendMacroblock();
147         void init_packages();
148         LoadClient* new_client();
149         LoadPackage* new_package();
150         InterpolateVideo *plugin;
151 };
152
153
154
155
156
157 #endif
158
159