From 9414f64c231a013664102e2c284b10266c6b4d4e Mon Sep 17 00:00:00 2001 From: Ioan-Cristian Szabo Date: Fri, 27 Oct 2017 17:35:40 +0100 Subject: COMPMID-582: Add validation to channel_extract kernels. Change-Id: I5022d02f06f9d849dad76e3d9b8e48632c236429 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121191 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- tests/SimpleTensor.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'tests/SimpleTensor.h') diff --git a/tests/SimpleTensor.h b/tests/SimpleTensor.h index 3dbb4862f8..f3155ffeab 100644 --- a/tests/SimpleTensor.h +++ b/tests/SimpleTensor.h @@ -297,18 +297,33 @@ int SimpleTensor::num_channels() const switch(_format) { case Format::U8: - case Format::S16: case Format::U16: - case Format::S32: + case Format::S16: case Format::U32: + case Format::S32: + case Format::F16: case Format::F32: return 1; + // Because the U and V channels are subsampled + // these formats appear like having only 2 channels: + case Format::YUYV422: + case Format::UYVY422: + return 2; + case Format::UV88: + return 2; case Format::RGB888: return 3; + case Format::RGBA8888: + return 4; case Format::UNKNOWN: return _num_channels; + //Doesn't make sense for planar formats: + case Format::NV12: + case Format::NV21: + case Format::IYUV: + case Format::YUV444: default: - ARM_COMPUTE_ERROR("NOT SUPPORTED!"); + return 0; } } -- cgit v1.2.1