/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#ifndef MOTIONSCAN_H
class MotionScan;
#define OVERSAMPLE 4
-#define MOTION_FILE "/tmp/m"
class MotionScanPackage : public LoadPackage
{
class MotionScan : public LoadServer
{
public:
- MotionScan(int total_clients,
+ MotionScan(int total_clients,
int total_packages);
~MotionScan();
void set_test_match(int value);
// Invoke the motion engine for a search
-// Frame before motion
- void scan_frame(VFrame *previous_frame,
-// Frame after motion
- VFrame *current_frame,
- int global_range_w,
- int global_range_h,
- int global_block_w,
- int global_block_h,
- double block_x,
- double block_y,
- int frame_type,
- int tracking_type,
- int action_type,
- int horizontal_only,
- int vertical_only,
- int source_position,
- int total_steps,
- int total_dx,
- int total_dy,
- int global_origin_x,
- int global_origin_y);
+ void scan_frame(VFrame *previous_frame, // Frame before motion
+ VFrame *current_frame, // Frame after motion
+ int global_range_w, int global_range_h, int global_block_w, int global_block_h,
+ double block_x, double block_y, int frame_type, int tracking_type, int action_type,
+ int horizontal_only, int vertical_only, int source_position, int total_steps,
+ int total_dx, int total_dy, int global_origin_x, int global_origin_y,
+ int load_ok=0, int load_dx=0, int load_dy=0);
int64_t get_cache(int x, int y);
void put_cache(int x, int y, int64_t difference);
- static int64_t abs_diff(unsigned char *prev_ptr,
- unsigned char *current_ptr,
- int row_bytes,
- int w,
- int h,
- int color_model);
- static int64_t abs_diff_sub(unsigned char *prev_ptr,
- unsigned char *current_ptr,
- int row_bytes,
- int w,
- int h,
- int color_model,
- int sub_x,
- int sub_y);
-
-
- static void clamp_scan(int w,
- int h,
- int *block_x1,
- int *block_y1,
- int *block_x2,
- int *block_y2,
- int *scan_x1,
- int *scan_y1,
- int *scan_x2,
- int *scan_y2,
+ static int64_t abs_diff(unsigned char *prev_ptr, unsigned char *current_ptr,
+ int row_bytes, int w, int h, int color_model);
+ static int64_t abs_diff_sub(unsigned char *prev_ptr, unsigned char *current_ptr,
+ int row_bytes, int w, int h, int color_model, int sub_x, int sub_y);
+
+ static void clamp_scan(int w, int h,
+ int *block_x1, int *block_y1, int *block_x2, int *block_y2,
+ int *scan_x1, int *scan_y1, int *scan_x2, int *scan_y2,
int use_absolute);
-// Change between previous frame and current frame multiplied by
+// Change between previous frame and current frame multiplied by
// OVERSAMPLE
- int dx_result;
- int dy_result;
+ int dx_result, dy_result;
- enum
- {
-// action_type
+ enum { // action_type
TRACK,
STABILIZE,
TRACK_PIXEL,
STABILIZE_PIXEL,
NOTHING
};
-
- enum
- {
-// tracking_type
+
+ enum { // tracking_type
CALCULATE,
SAVE,
LOAD,
NO_CALCULATE
};
-
- enum
- {
-// frame_type
+
+ enum { // frame_type
TRACK_SINGLE,
TRACK_PREVIOUS,
PREVIOUS_SAME_BLOCK