01-31-2015 06:12 PM - edited 01-31-2015 06:18 PM
Hi Everyone.
I am trying to figure out the most efficient way to manipulate somewhat large array of data (up to about 120 Megabyte) that I am currently getting from a FPGA. This data represent an image and it need to be manipulated before it can be displayed to the user. The data need to be unpacked from a U64 to I16 and some of it need to be chopped (essentially chop off 10% on each side of the image so if an image is 800 x 480 it becomes 640 x 480).
I have tried several approaches and the image below show the one that is the quickest but there might be further optimization that could be done.
I am looking forward to see what other can come up with.
Note 01: I am including a link to the benchmark VI that has a quite large image in it so this VI is about 40MB.
Note 02: this is cross-posted on Lava
Thanks
01-31-2015 07:14 PM
Using Array Subset rather than Reshape Array to truncate the 1D array is faster: 151 ms compared to 175 ms.
Lynn
01-31-2015 07:56 PM
@johnsold wrote:
Using Array Subset rather than Reshape Array to truncate the 1D array is faster: 151 ms compared to 175 ms.
Lynn
Thanks Lynn, this is good to know!
Unfortunately the solution in this frame is still about 2x slower than the faster one (the "Reshape & Chop & Reshape & Unpack & Reshape").
PJM
02-01-2015 12:39 AM
02-01-2015 02:14 PM
Sorry. I did not pay enough attention. So I improved the wrong case.
I have not come up with anything better although I noticed that the code in the for loop takes about 1/2 to 1/3 the time of the split and interleave portion. The split and interleave code can be replaced with a typecast to array of I16. That is easier to read but 5-6% slower.
Lynn
02-03-2015 02:53 PM