Skip to content

Fixing Y12i stream output in MIPI with CUDA case #13084

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

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

Arun-Prasad-V
Copy link
Contributor

Tracked by LRS-1052

@Arun-Prasad-V Arun-Prasad-V marked this pull request as ready for review June 25, 2024 09:06
@Arun-Prasad-V Arun-Prasad-V requested a review from Nir-Az June 25, 2024 09:06
@Nir-Az Nir-Az requested review from remibettan and dmipx and removed request for Nir-Az June 25, 2024 09:15
Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

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

The code for mipi and not pipi is exactly the same - the only difference is the padding of 8 bits that has been added for mipi.
Few questions:
Is the other padding used anywhere? (y16_y16_from_y12i)?
If no - please remove it, and keep only the mipi one.
If yes - since the code is exactly the same besides the type used (y12i_pixel or y12i_pixel_mipi), could you change it to a template function that would be used for both cases (once with the y12i_pixel type, and once with the y12i_pixel_mipi type)?

@Arun-Prasad-V
Copy link
Contributor Author

The code for mipi and not pipi is exactly the same - the only difference is the padding of 8 bits that has been added for mipi. Few questions: Is the other padding used anywhere? (y16_y16_from_y12i)? If no - please remove it, and keep only the mipi one. If yes - since the code is exactly the same besides the type used (y12i_pixel or y12i_pixel_mipi), could you change it to a template function that would be used for both cases (once with the y12i_pixel type, and once with the y12i_pixel_mipi type)?

@remibettan, UVC with CUDA must be using y16_y16_from_y12i. So, as you mentioned, will change them to template functions.

@Arun-Prasad-V Arun-Prasad-V requested a review from remibettan June 27, 2024 02:51

template void rscuda::y16_y16_from_y12i_10_cuda_helper<rscuda::y12i_pixel_mipi>(uint8_t* const dest[], int count, const rscuda::y12i_pixel_mipi * source);
Copy link
Contributor

Choose a reason for hiding this comment

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

As we talked, please delete this line and the above line, and see next comment

@@ -16,7 +16,7 @@ namespace librealsense
{
auto count = width * height;
#ifdef RS2_USE_CUDA
rscuda::split_frame_y16_y16_from_y12i_cuda_mipi(dest, count, reinterpret_cast<const y12i_pixel_mipi *>(source));
rscuda::split_frame_y16_y16_from_y12i_cuda(dest, count, reinterpret_cast<const rscuda::y12i_pixel_mipi *>(source));
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of :rscuda::split_frame_y16_y16_from_y12i_cuda(dest, count, reinterpret_cast<const rscuda::y12i_pixel_mipi *>(source));
Please try:
rscuda::split_frame_y16_y16_from_y12i_cuda<rscuda::y12i_pixel_mipi *>(dest, count, reinterpret_cast<const rscuda::y12i_pixel_mipi *>(source));

@@ -15,7 +15,7 @@ namespace librealsense
{
auto count = width * height;
#ifdef RS2_USE_CUDA
rscuda::split_frame_y16_y16_from_y12i_cuda(dest, count, reinterpret_cast<const y12i_pixel *>(source));
rscuda::split_frame_y16_y16_from_y12i_cuda(dest, count, reinterpret_cast<const rscuda::y12i_pixel *>(source));
Copy link
Contributor

Choose a reason for hiding this comment

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

Intead of:
rscuda::split_frame_y16_y16_from_y12i_cuda(dest, count, reinterpret_cast<const rscuda::y12i_pixel *>(source));
Please try:
rscuda::split_frame_y16_y16_from_y12i_cuda<rscuda::y12i_pixel *>(dest, count, reinterpret_cast<const rscuda::y12i_pixel *>(source));

Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

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

please see inline comments

@remibettan remibettan self-requested a review June 27, 2024 10:47
Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

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

LGTM

@remibettan remibettan merged commit df68f90 into IntelRealSense:development Jun 27, 2024
21 of 22 checks passed
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.

2 participants