25
27
#define CUDA_EXTRA_MEMORY 67108864 // 64MB
30
#ifdef DICT_SUPPORT_THREADS
31
# include "hw_sched.h"
32
#endif /* DICT_SUPPORT_THREADS */
28
35
struct STProcessingState {
29
36
int stored; // flag indicating if we already have coordinates in coords stored
31
38
unsigned char *banlist; // control points banned from computations for various reasons
34
float *points; // various information on control points
35
// base_x, base_y, data_x, data_y
36
// base_frac_x, base_frac_y
41
float *points; // various information on control points, reference to DICTContext
42
int points_alloc_size; // equal to ncp_alloc_size of DICTContext
40
45
float *cuda_points; // Various information on control points:
62
67
float *cuda_lsum_temp; // Temporary buffer for local sum comp, first two pre-zeroed
65
float *res_x; // External points buffer
66
float *res_y; // External points buffer
70
float *res_x; // External points buffer, reference to DICTContext
71
float *res_y; // External points buffer, reference to DICTContext
69
74
int fft_initialized; // Flag indicating if CUFFT plan is initialized
74
79
int cudpp_initialized; // Flag indicating if CUDPP plan is initialized
75
80
CUDPPHandle cudpp_plan;
77
DICTImageType image_type;
78
void *image_buf; // Temporary buffer for images (specific-format)
79
unsigned char *image; // Reduced format
80
unsigned char *base_image; // Stored base image
82
int status; // Error code, 0 if operable
82
84
int width; // Images width
83
85
int height; // Images height
114
116
int side_blocks_power; // Indicates if amount of side blocks is power of 2
115
117
int base_blocks_power; // Indicates if amount of base blocks is power of 2
121
typedef struct STProcessingState TProcessingState;
122
typedef struct STProcessingState *ProcessingState;
125
struct STDICTContext {
130
int width; // Images width
131
int height; // Images height
133
int use_threads; // Run in multithreaded mode
135
DICTImageType image_type;
136
void *image_buf; // Temporary buffer for images (specific-format)
137
unsigned char *image; // Reduced format
138
unsigned char *base_image; // Stored base image
140
float *points; // various information on control points
141
// base_x, base_y, data_x, data_y
142
// base_frac_x, base_frac_y
145
float *res_x; // External points buffer
146
float *res_y; // External points buffer
149
// Here are starting non-zeroed parameters, so the matlab_mode should be first
150
int matlab_mode; // 2D stored transposed (i.e. by columns)
152
#ifdef DICT_SUPPORT_THREADS
154
#endif /* DICT_SUPPORT_THREADS */
156
ProcessingState *pstates;
158
// Just parameters to be passed to thread functions
160
const unsigned char *param_img;
117
162
#ifdef DICT_HW_MEASURE_TIMINGS
118
163
int time[24]; // Timing counters (SHOULD BE LAST in struct!!!):
119
164
// 0- 3: hardware, init, set_base_points, set_cur_points