aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/MultiImage.cpp
diff options
context:
space:
mode:
authorIoan-Cristian Szabo <ioan-cristian.szabo@arm.com>2017-10-27 17:35:40 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:47:18 +0000
commit91d20d95df35961d3eb5de497007d98576118d19 (patch)
tree13042e212d65fbf5bd7425079bb72b6bd1e2e84d /src/runtime/MultiImage.cpp
parent19835e591cb0b66a0f5000ae1505bf299e50337d (diff)
downloadComputeLibrary-91d20d95df35961d3eb5de497007d98576118d19.tar.gz
COMPMID-582: Add validation to channel_extract kernels.
Change-Id: I6413a05f6870a0d04f12d7348269b15297ae8493 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114696 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/MultiImage.cpp')
-rw-r--r--src/runtime/MultiImage.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/runtime/MultiImage.cpp b/src/runtime/MultiImage.cpp
index def1487c5e..6eba71bf1d 100644
--- a/src/runtime/MultiImage.cpp
+++ b/src/runtime/MultiImage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -25,6 +25,7 @@
#include "arm_compute/core/Error.h"
#include "arm_compute/core/TensorInfo.h"
+#include "arm_compute/core/Utils.h"
#include "arm_compute/runtime/TensorAllocator.h"
using namespace arm_compute;
@@ -51,7 +52,8 @@ void MultiImage::init_auto_padding(unsigned int width, unsigned int height, Form
void MultiImage::internal_init(unsigned int width, unsigned int height, Format format, bool auto_padding)
{
- TensorInfo info(width, height, Format::U8);
+ TensorShape shape = adjust_odd_shape(TensorShape{ width, height }, format);
+ TensorInfo info(shape, Format::U8);
if(auto_padding)
{
@@ -72,7 +74,7 @@ void MultiImage::internal_init(unsigned int width, unsigned int height, Format f
case Format::YUYV422:
case Format::UYVY422:
{
- TensorInfo info_full(width, height, format);
+ TensorInfo info_full(shape, format);
if(auto_padding)
{
@@ -85,7 +87,8 @@ void MultiImage::internal_init(unsigned int width, unsigned int height, Format f
case Format::NV12:
case Format::NV21:
{
- TensorInfo info_uv88(width / 2, height / 2, Format::UV88);
+ const TensorShape shape_uv88 = calculate_subsampled_shape(shape, Format::UV88);
+ TensorInfo info_uv88(shape_uv88, Format::UV88);
if(auto_padding)
{
@@ -98,7 +101,8 @@ void MultiImage::internal_init(unsigned int width, unsigned int height, Format f
}
case Format::IYUV:
{
- TensorInfo info_sub2(width / 2, height / 2, Format::U8);
+ const TensorShape shape_sub2 = calculate_subsampled_shape(shape, Format::IYUV);
+ TensorInfo info_sub2(shape_sub2, Format::U8);
if(auto_padding)
{
@@ -120,7 +124,7 @@ void MultiImage::internal_init(unsigned int width, unsigned int height, Format f
break;
}
- _info.init(width, height, format);
+ _info.init(shape.x(), shape.y(), format);
}
void MultiImage::allocate()