Skip to content

Fixing Y12i stream output in MIPI with CUDA case - #13084

Merged
remibettan merged 2 commits into
realsenseai:developmentfrom
Arun-Prasad-V:y12i_mipi_cuda
Jun 27, 2024
Merged

remibettan merged 2 commits into
realsenseai:developmentfrom
Arun-Prasad-V:y12i_mipi_cuda

Conversation

@Arun-Prasad-V

Copy link
Copy Markdown
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 dmipx and remibettan and removed request for Nir-Az June 25, 2024 09:15

@remibettan remibettan left a comment •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
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));

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
Copy Markdown
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));

@remibettan remibettan left a comment

Copy link
Copy Markdown
Contributor

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

@remibettan remibettan left a comment

Copy link
Copy Markdown
Contributor

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 realsenseai:development Jun 27, 2024
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