aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/ColorConvertHelper.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-06-11 20:05:18 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:52:54 +0000
commite8c18d48f47e309f5a5b1d983614530dc17b28be (patch)
tree35e3a4cacabc9e5d4832008a994e920bca99de69 /tests/validation/reference/ColorConvertHelper.h
parent7698a31525c6952179ec8a8acbd823d0003f432d (diff)
downloadComputeLibrary-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>
Diffstat (limited to 'tests/validation/reference/ColorConvertHelper.h')
-rw-r--r--tests/validation/reference/ColorConvertHelper.h17
1 files changed, 8 insertions, 9 deletions
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)
{