From f44e57b1b7595166e269ff0a7934ca7cde9dcc0c Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Wed, 22 Jan 2020 11:07:54 +0000 Subject: COMPMID-2819: Change PixelValue constructor to use int64_t Change value data type from uint64_t to int64_t as we pass negative values resulting to side effects. Change-Id: I89383e629ec55154680c5ece4396e15841661a38 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/2617 Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins Reviewed-by: Manuel Bottini Reviewed-by: Georgios Pinitas --- arm_compute/core/PixelValue.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arm_compute/core/PixelValue.h b/arm_compute/core/PixelValue.h index 52b1f654ad..c5f6608163 100644 --- a/arm_compute/core/PixelValue.h +++ b/arm_compute/core/PixelValue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 ARM Limited. + * Copyright (c) 2016-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -36,7 +36,7 @@ class PixelValue public: /** Default constructor: value initialized to 0 */ PixelValue() - : value{ uint64_t(0) } + : value{ int64_t(0) } { } /** Initialize the union with a pixel value of chosen datatype @@ -45,7 +45,7 @@ public: * @param[in] datatype DataType that @p v have to be stored * @param[in] qinfo (Optional) QuantizationInfo to apply in case of quantized data types to @p v */ - PixelValue(uint64_t v, DataType datatype, QuantizationInfo qinfo = QuantizationInfo()) + PixelValue(int64_t v, DataType datatype, QuantizationInfo qinfo = QuantizationInfo()) : PixelValue() { switch(datatype) @@ -60,7 +60,7 @@ public: value.u8 = quantize_qasymm8(static_cast(v), qinfo); break; case DataType::QASYMM8_SIGNED: - value.u8 = quantize_qasymm8_signed(static_cast(v), qinfo); + value.s8 = quantize_qasymm8_signed(static_cast(v), qinfo); break; case DataType::QSYMM8: value.s8 = quantize_qsymm8(static_cast(v), qinfo); @@ -87,7 +87,7 @@ public: value.u64 = static_cast(v); break; case DataType::S64: - value.s16 = static_cast(v); + value.s64 = static_cast(v); break; case DataType::F16: value.f16 = static_cast(v); @@ -99,7 +99,7 @@ public: value.f64 = static_cast(v); break; default: - value.u64 = v; + value.s64 = v; break; } } -- cgit v1.2.1