From e8c18d48f47e309f5a5b1d983614530dc17b28be Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 11 Jun 2018 20:05:18 +0100 Subject: COMPMID-1274: (Nightly) CLColorConvert Segfaults Change-Id: I10ceaf32e5c704148403972802ee769852694d53 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/135065 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/validation/reference/ColorConvertHelper.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'tests/validation/reference/ColorConvertHelper.h') diff --git a/tests/validation/reference/ColorConvertHelper.h b/tests/validation/reference/ColorConvertHelper.h index 4daa7025cb..50040d9a92 100644 --- a/tests/validation/reference/ColorConvertHelper.h +++ b/tests/validation/reference/ColorConvertHelper.h @@ -48,7 +48,7 @@ inline void yuyv_to_rgb_calculation(const SimpleTensor yvec, const SimpleTens for(int y = 0; y < dst_height; ++y) { int x_coord = 0; - for(int x = 0; x < dst_width; x += 2, x_coord++) + for(int x = 0; x < dst_width; x += 2, ++x_coord) { Coordinates dst_coord{ x, y }; auto *dst_pixel = reinterpret_cast(dst(dst_coord)); @@ -192,18 +192,17 @@ inline void colorconvert_rgbx_to_rgb(const SimpleTensor src, SimpleTensor template inline void colorconvert_yuyv_to_rgb(const SimpleTensor src, const Format format, SimpleTensor &dst) { - SimpleTensor yvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); - SimpleTensor uvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); - SimpleTensor yyvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); - SimpleTensor vvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); + SimpleTensor yvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); + SimpleTensor uvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); + SimpleTensor yyvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); + SimpleTensor vvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); const int step_x = (Format::YUYV422 == format || Format::UYVY422 == format) ? 2 : 1; + const int offset = (Format::YUYV422 == format) ? 0 : 1; - const int offset = (Format::YUYV422 == format) ? 0 : 1; Coordinates elem_coord{ 0, 0 }; - - const int width = vvec.shape().x(); - const int height = vvec.shape().y(); + const int width = yvec.shape().x(); + const int height = yvec.shape().y(); for(int y = 0; y < height; ++y) { -- cgit v1.2.1