diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-06-11 20:05:18 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:52:54 +0000 |
commit | e8c18d48f47e309f5a5b1d983614530dc17b28be (patch) | |
tree | 35e3a4cacabc9e5d4832008a994e920bca99de69 | |
parent | 7698a31525c6952179ec8a8acbd823d0003f432d (diff) | |
download | ComputeLibrary-e8c18d48f47e309f5a5b1d983614530dc17b28be.tar.gz |
COMPMID-1274: (Nightly) CLColorConvert Segfaults
Change-Id: I10ceaf32e5c704148403972802ee769852694d53
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/135065
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
-rw-r--r-- | tests/validation/reference/ColorConvert.cpp | 4 | ||||
-rw-r--r-- | tests/validation/reference/ColorConvertHelper.h | 17 |
2 files changed, 8 insertions, 13 deletions
diff --git a/tests/validation/reference/ColorConvert.cpp b/tests/validation/reference/ColorConvert.cpp index bd93eb6a61..a8a530498e 100644 --- a/tests/validation/reference/ColorConvert.cpp +++ b/tests/validation/reference/ColorConvert.cpp @@ -36,10 +36,6 @@ namespace validation { namespace reference { -namespace -{ -} // namespace - template <typename T> SimpleTensor<uint8_t> color_convert(const TensorShape &shape, const std::vector<SimpleTensor<T>> &tensor_planes, Format src_format, Format dst_format) { 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<T> 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<T *>(dst(dst_coord)); @@ -192,18 +192,17 @@ inline void colorconvert_rgbx_to_rgb(const SimpleTensor<T> src, SimpleTensor<T> template <typename T> inline void colorconvert_yuyv_to_rgb(const SimpleTensor<T> src, const Format format, SimpleTensor<T> &dst) { - SimpleTensor<T> yvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); - SimpleTensor<T> uvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); - SimpleTensor<T> yyvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); - SimpleTensor<T> vvec(TensorShape{ src.shape().x(), src.shape().y() }, Format::U8); + SimpleTensor<T> yvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); + SimpleTensor<T> uvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); + SimpleTensor<T> yyvec(TensorShape{ src.shape().x() / 2, src.shape().y() }, Format::U8); + SimpleTensor<T> 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) { |