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/Helpers.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/Helpers.h')
-rw-r--r-- | arm_compute/core/Helpers.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arm_compute/core/Helpers.h b/arm_compute/core/Helpers.h index 235657a38a..87b1fdf64c 100644 --- a/arm_compute/core/Helpers.h +++ b/arm_compute/core/Helpers.h @@ -158,24 +158,24 @@ inline T delta_bilinear_c1(const T *pixel_ptr, size_t stride, float dx, float dy * * @return The bilinear interpolated pixel value */ -inline uint8_t delta_bilinear_c1_quantized(const uint8_t *pixel_ptr, size_t stride, float dx, float dy, QuantizationInfo iq_info, QuantizationInfo oq_info) +inline uint8_t delta_bilinear_c1_quantized(const uint8_t *pixel_ptr, size_t stride, float dx, float dy, UniformQuantizationInfo iq_info, UniformQuantizationInfo oq_info) { ARM_COMPUTE_ERROR_ON(pixel_ptr == nullptr); const float dx1 = 1.0f - dx; const float dy1 = 1.0f - dy; - const float a00 = iq_info.dequantize(*pixel_ptr); - const float a01 = iq_info.dequantize(*(pixel_ptr + 1)); - const float a10 = iq_info.dequantize(*(pixel_ptr + stride)); - const float a11 = iq_info.dequantize(*(pixel_ptr + stride + 1)); + const float a00 = dequantize_qasymm8(*pixel_ptr, iq_info); + const float a01 = dequantize_qasymm8(*(pixel_ptr + 1), iq_info); + const float a10 = dequantize_qasymm8(*(pixel_ptr + stride), iq_info); + const float a11 = dequantize_qasymm8(*(pixel_ptr + stride + 1), iq_info); const float w1 = dx1 * dy1; const float w2 = dx * dy1; const float w3 = dx1 * dy; const float w4 = dx * dy; float res = a00 * w1 + a01 * w2 + a10 * w3 + a11 * w4; - return static_cast<uint8_t>(oq_info.quantize(res, RoundingPolicy::TO_NEAREST_UP)); + return static_cast<uint8_t>(quantize_qasymm8(res, oq_info)); } /** Computes linear interpolation using the pointer to the top pixel and the pixel's distance between |