From 91d20d95df35961d3eb5de497007d98576118d19 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: I6413a05f6870a0d04f12d7348269b15297ae8493 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114696 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/SimpleTensor.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'tests/SimpleTensor.h') diff --git a/tests/SimpleTensor.h b/tests/SimpleTensor.h index 902f5b51b5..f3155ffeab 100644 --- a/tests/SimpleTensor.h +++ b/tests/SimpleTensor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -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