diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-05-21 13:32:43 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-06-03 14:51:29 +0000 |
commit | 4c5469b192665c94118a8a558787cb9cec2d0765 (patch) | |
tree | 168aa969de8243bdbb1f25247dd9f54d037ae32c /arm_compute/core/PixelValue.h | |
parent | 43a129e94df41f9ac8bc78b702da5a387ada0494 (diff) | |
download | ComputeLibrary-4c5469b192665c94118a8a558787cb9cec2d0765.tar.gz |
COMPMID-2225: Add interface support for new quantized data types.
Add support for:
-QSYMM8, 8-bit quantized symmetric
-QSYMM8_PER_CHANNEL, 8-bit quantized symmetric with per channel quantization
Change-Id: I00c4ff98e44af37419470af61419ee95d0de2463
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1236
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/PixelValue.h')
-rw-r--r-- | arm_compute/core/PixelValue.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arm_compute/core/PixelValue.h b/arm_compute/core/PixelValue.h index 0ead9db7b1..4bdcad61a2 100644 --- a/arm_compute/core/PixelValue.h +++ b/arm_compute/core/PixelValue.h @@ -41,11 +41,11 @@ public: } /** Initialize the union with a pixel value of chosen datatype * - * @param[in] v int value. - * @param[in] datatype DataType that @p v have to be stored - * @param[in] quant_info QuantizationInfo to apply in case of QASYMM8 datatype to @p v + * @param[in] v int value. + * @param[in] datatype DataType that @p v have to be stored + * @param[in] qinfo (Optional) QuantizationInfo to apply in case of QASYMM8 datatype to @p v */ - PixelValue(uint64_t v, DataType datatype, QuantizationInfo quant_info = QuantizationInfo()) + PixelValue(uint64_t v, DataType datatype, QuantizationInfo qinfo = QuantizationInfo()) : PixelValue() { switch(datatype) @@ -57,7 +57,10 @@ public: value.s8 = static_cast<int8_t>(v); break; case DataType::QASYMM8: - value.u8 = sqcvt_qasymm8_f32(v, quant_info.scale, quant_info.offset); + value.u8 = quantize_qasymm8(static_cast<uint8_t>(v), qinfo); + break; + case DataType::QSYMM8: + value.s8 = quantize_qsymm8(static_cast<int8_t>(v), qinfo); break; case DataType::U16: value.u16 = static_cast<uint16_t>(v); |