From 129afab72bfc026b5704c41a6bfc0f4b3a2c4033 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Oct 2012 20:29:20 +0100 Subject: Round image line sizes up to 32. Seems to help with LHS image corruption with both crop and a post-processing filter. --- src/lib/image.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/image.cc') diff --git a/src/lib/image.cc b/src/lib/image.cc index ce44ec95b..c8849303c 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -260,15 +260,15 @@ SimpleImage::SimpleImage (PixelFormat p, Size s) switch (p) { case PIX_FMT_RGB24: - _line_size[0] = s.width * 3; + _line_size[0] = round_up (s.width * 3, 32); break; case PIX_FMT_RGBA: - _line_size[0] = s.width * 4; + _line_size[0] = round_up (s.width * 4, 32); break; case PIX_FMT_YUV420P: - _line_size[0] = s.width; - _line_size[1] = s.width / 2; - _line_size[2] = s.width / 2; + _line_size[0] = round_up (s.width, 32); + _line_size[1] = round_up (s.width / 2, 32); + _line_size[2] = round_up (s.width / 2, 32); break; default: assert (false); -- cgit v1.2.3