Skip to content

Commit

Permalink
common: utils: Respect provided stride
Browse files Browse the repository at this point in the history
When computing stride alignment, don't overwrite a provided stride
unless the stride provided is too small.
  • Loading branch information
will-v-pi committed Dec 12, 2023
1 parent 71cbcaf commit 1ffc4ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libpisp/common/pisp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ void compute_stride_align(pisp_image_format_config &config, int align)
if (PISP_IMAGE_FORMAT_compressed(config.format))
width = (width + 7) & ~7; // compression uses blocks of 8 samples

config.stride = compute_x_offset(config.format, width);
if (!config.stride)
config.stride = compute_x_offset(config.format, width);
config.stride2 = 0;

if (!PISP_IMAGE_FORMAT_HOG(config.format))
Expand Down

0 comments on commit 1ffc4ac

Please sign in to comment.