cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
xf_warp_transform_config.h
Go to the documentation of this file.
1 
17 
42 
54 #ifndef _XF_WARPTRANSFORM_CONFIG_H_
55 #define _XF_WARPTRANSFORM_CONFIG_H_
56 
57 #include "hls_stream.h"
58 #include "ap_int.h"
59 #include "common/xf_common.hpp"
60 #include "common/xf_utility.hpp"
61 #include "imgproc/xf_warp_transform.hpp"
62 #include "xf_config_params.h"
63 #include "warp_transform.hpp"
64 #include "../../../../../HOST/vision/warp_transform/languages/cplusplus/include/config.h"
65 
66 using hls::stream;
67 
68 // Number of rows of input image to be stored
69 #define NUM_STORE_ROWS 256
70 
71 // Number of rows of input image after which output image processing must start
72 #define START_PROC 200
73 // transform type 0-NN 1-BILINEAR
74 #define INTERPOLATION 0
75 
76 // transform type 0-AFFINE 1-PERSPECTIVE
77 #define TRANSFORM_TYPE 0
78 #define XF_USE_URAM false
79 
80 // Set the optimization type:
81 #if NO == 1
82 #define NPC1 XF_NPPC1
83 #define PTR_WIDTH 128
84 #else
85 
86 #if GRAY
87 #define NPC1 XF_NPPC8
88 #else
89 #define NPC1 XF_NPPC4
90 #endif
91 
92 #define PTR_WIDTH 128
93 #endif
94 
95 // Set the pixel depth:
96 #if GRAY
97 #define TYPE XF_8UC1
98 #else
99 #define TYPE XF_8UC3
100 #endif
101 
102 #define CH_TYPE XF_GRAY
103 #define INPUT_PTR_WIDTH 8
104 #define OUTPUT_PTR_WIDTH 64
105 /*
106  * Pack pixels in and write into streams
107  */
108 
109 #if RO
110 #define NPIX XF_NPPC8
111 #endif
112 #if NO
113 #define NPIX XF_NPPC1
114 #endif
115 
116 #define WIDTH FRAME_WIDTH
117 #define HEIGHT FRAME_HEIGHT
118 
119 #define IMGSIZE FRAME_TOTAL
120 
121 #define BITS_PER_10GBITETHRNET_AXI_PACKET 64
122 #define BYTES_PER_10GBITETHRNET_AXI_PACKET (BITS_PER_10GBITETHRNET_AXI_PACKET/8)
123 
124 #define IMG_PACKETS IMGSIZE/(BYTES_PER_10GBITETHRNET_AXI_PACKET)
125 
126 #define MIN_RX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/INPUT_PTR_WIDTH)
127 #define MIN_TX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/OUTPUT_PTR_WIDTH)
128 
129 // Compatibility for common.hpp
130 #define OUT_TYPE TYPE
131 
132 
133 // Enable it to fake the call of actual WarpTransform kernel and instead consume input data and write back
134 // the last element from the input to every output value. This option is used for debugging.
135 // #define FAKE_WarpTransform
136 
137 // Function prototypes
138 
139 /*void warp_transform_accel( xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _src,
140  xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _dst);
141 */
143  ap_uint<INPUT_PTR_WIDTH>* img_in,
144  float* transform,
145  ap_uint<OUTPUT_PTR_WIDTH>* img_out,
146  int rows, int cols);
148  hls::stream<ap_uint<INPUT_PTR_WIDTH>>& img_in_axi_stream,
149  hls::stream<ap_uint<OUTPUT_PTR_WIDTH>>& img_out_axi_stream,
150  int rows, int cols,float transform_matrix[TRANSFORM_MATRIX_DIM]);
151 
153  hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
154  hls::stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
155  unsigned int min_rx_loops,
156  unsigned int min_tx_loops,
157  float transform_matrix[TRANSFORM_MATRIX_DIM]);
158 
159 void warp_transformAccelMem( membus_t* img_inp,
160  membus_t* img_out,
161  int rows, int cols,
162  hls::stream<float>& sTxMatrix
163  // float transform_matrix[TRANSFORM_MATRIX_DIM]
164  );
165 
166 
167 #endif // end of _XF_MEDIAN_BLUR_CONFIG_H_
168 
169 
membus_512_t membus_t
Definition: memtest.hpp:92
#define TRANSFORM_MATRIX_DIM
void warp_transformAccelMem(membus_t *img_inp, membus_t *img_out, int rows, int cols, hls::stream< float > &sTxMatrix)
Top-level accelerated function of the WarpTransform Application with memory mapped interfaces.
void fakeWarpTransformAccelStream(hls::stream< ap_axiu< 8, 0, 0, 0 > > &img_in_axi_stream, hls::stream< ap_axiu< 64, 0, 0, 0 > > &img_out_axi_stream, unsigned int min_rx_loops, unsigned int min_tx_loops, float transform_matrix[9])
void warpTransformAccelStream(hls::stream< ap_uint< 8 >> &img_in_axi_stream, hls::stream< ap_uint< 64 >> &img_out_axi_stream, int rows, int cols, float transform_matrix[9])
Top-level accelerated function of the WarpTransform Application with array I/Fadd WARPTRANSFORM.
void warptTransformAccelArray(ap_uint< 8 > *img_in, float *transform, ap_uint< 64 > *img_out, int rows, int cols)
Top-level accelerated function of the WarptTransform Application with array I/F used only for simulat...
The WarpTransform IP configuration header.
The Role for a WarpTransform Example application (UDP or TCP)