cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
xf_median_blur_config.h
Go to the documentation of this file.
1 
17 
42 
54 #ifndef _XF_MEDIANBLUR_CONFIG_H_
55 #define _XF_MEDIANBLUR_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_median_blur.hpp"
62 #include "xf_config_params.h"
63 #include "median_blur.hpp"
64 #include "../../../../../HOST/vision/median_blur/languages/cplusplus/include/config.h"
65 
66 #ifdef USE_HLSLIB_STREAM
67 #include "../../../../../hlslib/include/hlslib/xilinx/Stream.h"
68 using hlslib::Stream;
69 #endif
70 using hls::stream;
71 
72 // Set the optimization type:
73 #if NO == 1
74 #define NPC1 XF_NPPC1
75 #define PTR_WIDTH 128
76 #else
77 
78 #if GRAY
79 #define NPC1 XF_NPPC8
80 #else
81 #define NPC1 XF_NPPC4
82 #endif
83 
84 #define PTR_WIDTH 128
85 #endif
86 
87 // Set the pixel depth:
88 #if GRAY
89 #define TYPE XF_8UC1
90 #else
91 #define TYPE XF_8UC3
92 #endif
93 
94 #define CH_TYPE XF_GRAY
95 #define INPUT_PTR_WIDTH 8
96 #define OUTPUT_PTR_WIDTH 64
97 /*
98  * Pack pixels in and write into streams
99  */
100 
101 #if RO
102 #define NPIX XF_NPPC8
103 #endif
104 #if NO
105 #define NPIX XF_NPPC1
106 #endif
107 
108 #define WIDTH FRAME_WIDTH
109 #define HEIGHT FRAME_HEIGHT
110 
111 #define IMGSIZE FRAME_TOTAL
112 
113 #define BITS_PER_10GBITETHRNET_AXI_PACKET 64
114 #define BYTES_PER_10GBITETHRNET_AXI_PACKET (BITS_PER_10GBITETHRNET_AXI_PACKET/8)
115 
116 #define IMG_PACKETS IMGSIZE/(BYTES_PER_10GBITETHRNET_AXI_PACKET)
117 
118 #define MIN_RX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/INPUT_PTR_WIDTH)
119 #define MIN_TX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/OUTPUT_PTR_WIDTH)
120 
121 // Compatibility for common.hpp
122 #define OUT_TYPE TYPE
123 
124 // Enable it to use the dataflow mode of hlslib
125 // #define USE_HLSLIB_DATAFLOW
126 
127 // Enable it to use the Stream class of hlslib
128 // #define USE_HLSLIB_STREAM
129 
130 // Enable it to fake the call of actual MedianBlur kernel and instead consume input data and write back
131 // the last element from the input to every output value. This option is used for debugging.
132 // #define FAKE_MedianBlur
133 
134 // Function prototypes
135 
136 void median_blur_accel( xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _src,
137  xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _dst);
138 
139 void medianBlurAccelArray( ap_uint<INPUT_PTR_WIDTH>* img_inp,
140  ap_uint<OUTPUT_PTR_WIDTH>* img_out,
141  int rows, int cols);
142 
144  hls::stream<ap_uint<INPUT_PTR_WIDTH>>& img_in_axi_stream,
145  hls::stream<ap_uint<OUTPUT_PTR_WIDTH>>& img_out_axi_stream,
146  int rows, int cols);
147 
149  #ifdef USE_HLSLIB_STREAM
150  hlslib::Stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>, MIN_RX_LOOPS> & img_in_axi_stream,
151  hlslib::Stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>, MIN_TX_LOOPS> & img_out_axi_stream,
152  #else
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  #endif
156  unsigned int min_rx_loops,
157  unsigned int min_tx_loops);
158 
159 void medianBlurAccelMem( membus_t* img_inp,
160  membus_t* img_out,
161  int rows, int cols);
162 
163 
164 #endif // end of _XF_MEDIAN_BLUR_CONFIG_H_
165 
166 
#define MIN_TX_LOOPS
void medianBlurAccelArray(ap_uint< 8 > *img_inp, ap_uint< 64 > *img_out, int rows, int cols)
Top-level accelerated function of the MedianBlur Application with array I/F.
void fakeMedianBlurAccelStream(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)
#define MIN_RX_LOOPS
void medianBlurAccelMem(membus_t *img_inp, membus_t *img_out, int rows, int cols)
Top-level accelerated function of the MedianBlur Application with array I/F.
void medianBlurAccelStream(hls::stream< ap_uint< 8 >> &img_in_axi_stream, hls::stream< ap_uint< 64 >> &img_out_axi_stream, int rows, int cols)
Top-level accelerated function of the MedianBlur Application with array I/F.
void median_blur_accel(xf::cv::Mat< XF_8UC1, 1024, 1024, XF_NPPC1 > &_src, xf::cv::Mat< XF_8UC1, 1024, 1024, XF_NPPC1 > &_dst)
Top-level accelerated function of the MedianBlur Application with xf::cv I/F.
membus_512_t membus_t
Definition: memtest.hpp:92
The Role for a MedianBlur Example application (UDP or TCP)
The WarpTransform IP configuration header.