Skip to content

Commit

Permalink
Increase the output image sizes (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
AryanSalmanpour authored Dec 10, 2024
1 parent d9b8926 commit 0fc0088
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions samples/rocjpeg_samples_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,29 +332,29 @@ class RocJpegUtils {
case ROCJPEG_CSS_444:
num_channels = 3;
output_image.pitch[2] = output_image.pitch[1] = output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[2] = channel_sizes[1] = channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[2] = channel_sizes[1] = channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
break;
case ROCJPEG_CSS_440:
num_channels = 3;
output_image.pitch[2] = output_image.pitch[1] = output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[2] = channel_sizes[1] = output_image.pitch[0] * ((is_roi_valid ? roi_height : heights[0]) >> 1);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
channel_sizes[2] = channel_sizes[1] = align(output_image.pitch[0] * ((is_roi_valid ? roi_height : heights[0]) >> 1), mem_alignment);
break;
case ROCJPEG_CSS_422:
num_channels = 1;
output_image.pitch[0] = (is_roi_valid ? roi_width : widths[0]) * 2;
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
break;
case ROCJPEG_CSS_420:
num_channels = 2;
output_image.pitch[1] = output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[1] = output_image.pitch[1] * ((is_roi_valid ? roi_height : heights[0]) >> 1);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
channel_sizes[1] = align(output_image.pitch[1] * ((is_roi_valid ? roi_height : heights[0]) >> 1), mem_alignment);
break;
case ROCJPEG_CSS_400:
num_channels = 1;
output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
break;
default:
std::cout << "Unknown chroma subsampling!" << std::endl;
Expand All @@ -365,21 +365,21 @@ class RocJpegUtils {
if (subsampling == ROCJPEG_CSS_400) {
num_channels = 1;
output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
} else {
num_channels = 3;
output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
output_image.pitch[1] = is_roi_valid ? roi_width : widths[1];
output_image.pitch[2] = is_roi_valid ? roi_width : widths[2];
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[1] = output_image.pitch[1] * (is_roi_valid ? roi_height : heights[1]);
channel_sizes[2] = output_image.pitch[2] * (is_roi_valid ? roi_height : heights[2]);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
channel_sizes[1] = align(output_image.pitch[1] * (is_roi_valid ? roi_height : heights[1]), mem_alignment);
channel_sizes[2] = align(output_image.pitch[2] * (is_roi_valid ? roi_height : heights[2]), mem_alignment);
}
break;
case ROCJPEG_OUTPUT_Y:
num_channels = 1;
output_image.pitch[0] = is_roi_valid ? roi_width : widths[0];
channel_sizes[0] = output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]);
channel_sizes[0] = align(output_image.pitch[0] * (is_roi_valid ? roi_height : heights[0]), mem_alignment);
break;
case ROCJPEG_OUTPUT_RGB:
num_channels = 1;
Expand Down

0 comments on commit 0fc0088

Please sign in to comment.