Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unpack from sr300 cuda implementation #8896

Merged

Conversation

andrusza2
Copy link
Contributor

@andrusza2 andrusza2 commented Apr 25, 2021

This PR fixes a bug with incorrect depth image on the SR300 series cameras when librealsense is built with CUDA [/issues/8897].
The functions unpack_z16_y8_from_sr300_inzi and unpack_z16_y16_from_sr300_inzi use the source data pointer (in) - the first half of the data is bit-shifted and stored in dest[1], the second half is directly copied to dest[0]. In the CPU version, the pointer is moved in a loop and after its execution it points to in + count - so the copying works as it should. In the CUDA version, the pointer is never moved, so bad data is copied to dest[0], resulting in an incorrect depth image. Simply moving the pointer to the right place fixes the problem.

Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrusza2 , thank you very much for the contribution!
This resolves the issue with incorrect distances reported with CUDA for SR300.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants