cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jiajiahao069
Visitor
Visitor
573 Views
Registered: ‎10-02-2020

xf::cv::remap how to optimize the BRAM of map

Jump to solution

Hi 

I am using the xf::cv::remap lib to change the input image. I using following code to generate the map of x and y. But it needs lots of BRAM more than the device supported.

In my understanding, The x and y array should be transfer to stream if I add the "#pragma HLS STREAM variable=X dim=1" and "#pragma HLS STREAM variable=Y dim=1", But it is absolutely not. Because it still needs lots of BRAM.

Could you tell me how to optimize the x and y map? The input image interface port is stream. i want the x and y is same to the input image.

by the way, Do I need concern the synchronize of the map and image? otherwize how to solve this issue?  

 

xf::cv::Mat<XF_32FC1,HEIGHT,WIDTH,NPC> X;
xf::cv::Mat<XF_32FC1,HEIGHT,WIDTH,NPC> Y;
right_to_left1:
for (int i = 0; i < img_rows; i++)
{
right_to_left2:
for (int j = 0; j < img_cols; j++)
{
Y.write_float(i*WIDTH+j, (float)i);
X.write_float(i*WIDTH+j, (float)(img_cols - j));
}
}

jiajiahao069_0-1604998748256.png

 

0 Kudos
1 Solution

Accepted Solutions
mizan123
Contributor
Contributor
263 Views
Registered: ‎10-30-2018

Major BRAM utilization for the Remap function is used for Line Buffer (XF_REMAP_BUFSIZE) stated in config file. Make it lower count, will reduce BRAM utilization, but the line buffer needed for the remapping purpose, so if a pixel need to remmaped from the beyond buffer line, it will not work. 

View solution in original post

0 Kudos
2 Replies
wenchen
Moderator
Moderator
507 Views
Registered: ‎05-27-2018

Hi @jiajiahao069

Please use the analysis window to see what is happening on all those BRAM resources.

Could you please attach the screenshot or the project?

Wen

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.


**~ Got a minute? Answer our Vitis HLS survey here! ~**


-------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 Kudos
mizan123
Contributor
Contributor
264 Views
Registered: ‎10-30-2018

Major BRAM utilization for the Remap function is used for Line Buffer (XF_REMAP_BUFSIZE) stated in config file. Make it lower count, will reduce BRAM utilization, but the line buffer needed for the remapping purpose, so if a pixel need to remmaped from the beyond buffer line, it will not work. 

View solution in original post

0 Kudos