From f2604cb401cb5706056026ad23ce812faa39b0f1 Mon Sep 17 00:00:00 2001 From: Aryan Salmanpour Date: Mon, 11 Aug 2025 06:48:28 -0400 Subject: [PATCH] Resolve an issue with saving the decoded output image. (#171) --- samples/rocjpeg_samples_utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/rocjpeg_samples_utils.h b/samples/rocjpeg_samples_utils.h index 86af011947..5630bb9a35 100644 --- a/samples/rocjpeg_samples_utils.h +++ b/samples/rocjpeg_samples_utils.h @@ -55,7 +55,7 @@ THE SOFTWARE. #define CHECK_HIP(call) { \ hipError_t hip_status = (call); \ if (hip_status != hipSuccess) { \ - std::cout << "rocJPEG failure: '#" << hip_status << "' at " << __FILE__ << ":" << __LINE__ << std::endl;\ + std::cout << "HIP failure: 'status: " << hipGetErrorName(hip_status) << "' at " << __FILE__ << ":" << __LINE__ << std::endl;\ exit(1); \ } \ } @@ -338,7 +338,7 @@ public: num_channels = 3; output_image.pitch[2] = output_image.pitch[1] = output_image.pitch[0] = is_roi_valid ? align(roi_width, mem_alignment) : align(widths[0], mem_alignment); channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? align(roi_height, mem_alignment) : align(heights[0], mem_alignment)); - channel_sizes[2] = channel_sizes[1] = output_image.pitch[0] * ((is_roi_valid ? align(roi_height, mem_alignment) : align(heights[0], mem_alignment)) >> 1); + channel_sizes[2] = channel_sizes[1] = output_image.pitch[0] * (is_roi_valid ? align(roi_height >> 1, mem_alignment) : align(heights[0] >> 1, mem_alignment)); break; case ROCJPEG_CSS_422: num_channels = 1; @@ -349,7 +349,7 @@ public: num_channels = 2; output_image.pitch[1] = output_image.pitch[0] = is_roi_valid ? align(roi_width, mem_alignment) : align(widths[0], mem_alignment); channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? align(roi_height, mem_alignment) : align(heights[0], mem_alignment)); - channel_sizes[1] = output_image.pitch[1] * ((is_roi_valid ? align(roi_height, mem_alignment) : align(heights[0], mem_alignment)) >> 1); + channel_sizes[1] = output_image.pitch[1] * (is_roi_valid ? align(roi_height >> 1, mem_alignment) : align(heights[0] >> 1, mem_alignment)); break; case ROCJPEG_CSS_400: num_channels = 1;