update version, update Features5 docs
[goodguy/cinelerra.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 "motioncache-hv.inc"
28 #include "motionscan-hv.inc"
29 #include "opticflow.inc"
30
31 // Need a 2nd table if a large number of packages
32 class OpticFlowMacroblock
33 {
34 public:
35         OpticFlowMacroblock();
36         void copy_from(OpticFlowMacroblock *src);
37
38         int x, y;
39         int dx, dy;
40         int is_valid;
41 // Temporaries for blending macroblocks
42         float angle1, angle2;
43         float dist;
44         int visible;
45 };
46
47 class OpticFlowPackage : public LoadPackage
48 {
49 public:
50         OpticFlowPackage();
51         int macroblock0;
52         int macroblock1;
53 };
54
55 class OpticFlowUnit : public LoadClient
56 {
57 public:
58         OpticFlowUnit(OpticFlow *server);
59         ~OpticFlowUnit();
60         void process_package(LoadPackage *package);
61         MotionHVScan *motion;
62         OpticFlow *server;
63 };
64
65
66 class OpticFlow : public LoadServer
67 {
68 public:
69         OpticFlow(InterpolateVideo *plugin,
70                 int total_clients,
71                 int total_packages);
72         ~OpticFlow();
73         void init_packages();
74         LoadClient* new_client();
75         LoadPackage* new_package();
76         InterpolateVideo *plugin;
77         MotionHVCache *downsample_cache;
78 };
79
80
81
82
83
84
85
86
87
88 class WarpPackage : public LoadPackage
89 {
90 public:
91         WarpPackage();
92         int y1, y2;
93 };
94
95 class WarpUnit : public LoadClient
96 {
97 public:
98         WarpUnit(Warp *server);
99         ~WarpUnit();
100         void process_package(LoadPackage *package);
101         Warp *server;
102 };
103
104
105 class Warp : public LoadServer
106 {
107 public:
108         Warp(InterpolateVideo *plugin,
109                 int total_clients,
110                 int total_packages);
111         ~Warp();
112         void init_packages();
113         LoadClient* new_client();
114         LoadPackage* new_package();
115         InterpolateVideo *plugin;
116 };
117
118
119
120
121
122
123 class BlendPackage : public LoadPackage
124 {
125 public:
126         BlendPackage();
127         int number0, number1;
128 };
129
130
131
132 class BlendMacroblockUnit : public LoadClient
133 {
134 public:
135         BlendMacroblockUnit(BlendMacroblock *server);
136         ~BlendMacroblockUnit();
137         void process_package(LoadPackage *package);
138         BlendMacroblock *server;
139 };
140
141
142 class BlendMacroblock : public LoadServer
143 {
144 public:
145         BlendMacroblock(InterpolateVideo *plugin,
146                 int total_clients,
147                 int total_packages);
148         ~BlendMacroblock();
149         void init_packages();
150         LoadClient* new_client();
151         LoadPackage* new_package();
152         InterpolateVideo *plugin;
153 };
154
155
156
157
158
159 #endif
160
161