analogdevicesinc / ToF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory Allocation Oversizing for XYZ Data

RuiHoang opened this issue · comments

I have identified a problem with malloc oversizing concerning the XYZ data in the Point Cloud. From my analysis, it appears that the Point Cloud data is using 6 bytes per pixel. However, when considering the following code sizeof(Point3I) is 6 and each element in the array is unit16 (2 bytes), the total comes to 12 bytes per pixel. This means that there is an inefficient allocation of memory, resulting in a waste of 6 bytes per pixel.
https://github.com/analogdevicesinc/ToF/blob/a224687133c6e8327347f6eb69c38e1613a02c2f/sdk/src/cameras/itof-frame/frame_impl.cpp#L228C1-L230C57
image

Thank you for pointing this out to us!

Regards,
Septimiu.