You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					38 lines
				
				829 B
			
		
		
			
		
	
	
					38 lines
				
				829 B
			| 
								 
											5 years ago
										 
									 | 
							
								#pragma once
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								#include <cstddef>
							 | 
						||
| 
								 | 
							
								#include <cstdint>
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								#include <vector>
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								#include "common/clutil.h"
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								#define NUM_SEGMENTS_X 8
							 | 
						||
| 
								 | 
							
								#define NUM_SEGMENTS_Y 6
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define ROI_X_MIN 1
							 | 
						||
| 
								 | 
							
								#define ROI_X_MAX 6
							 | 
						||
| 
								 | 
							
								#define ROI_Y_MIN 2
							 | 
						||
| 
								 | 
							
								#define ROI_Y_MAX 3
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								#define LM_THRESH 120
							 | 
						||
| 
								 | 
							
								#define LM_PREC_THRESH 0.9 // 90 perc is blur
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								#define CONV_LOCAL_WORKSIZE 16
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								class LapConv {
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								  LapConv(cl_device_id device_id, cl_context ctx, int rgb_width, int rgb_height, int rgb_stride, int filter_size);
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  ~LapConv();
							 | 
						||
| 
								 | 
							
								  uint16_t Update(cl_command_queue q, const uint8_t *rgb_buf, const int roi_id);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								private:
							 | 
						||
| 
								 | 
							
								  cl_mem roi_cl, result_cl, filter_cl;
							 | 
						||
| 
								 | 
							
								  cl_program prg;
							 | 
						||
| 
								 | 
							
								  cl_kernel krnl;
							 | 
						||
| 
								 | 
							
								  const int width, height;
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								  const int rgb_stride;
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								  std::vector<uint8_t> roi_buf;
							 | 
						||
| 
								 | 
							
								  std::vector<int16_t> result_buf;
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											5 years ago
										 
									 | 
							
								bool is_blur(const uint16_t *lapmap, const size_t size);
							 |