aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/PixelValue.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-08-31 18:12:42 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit583137cc60580023abfd9d05abf933e7e117e29f (patch)
treeb29ec55c11b65e2882e60c0cf8b592bf25e78b1b /arm_compute/core/PixelValue.h
parent3021edfb5e72ef4cd91dbc754ce6ac55388ebc4e (diff)
downloadComputeLibrary-583137cc60580023abfd9d05abf933e7e117e29f.tar.gz
COMPMID-417: Add support for floats in scale.
Change-Id: I7d714ba13861509080a89817f54e9d32da83e970 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/86026 Reviewed-by: Pablo Tello <pablo.tello@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'arm_compute/core/PixelValue.h')
-rw-r--r--arm_compute/core/PixelValue.h38
1 files changed, 15 insertions, 23 deletions
diff --git a/arm_compute/core/PixelValue.h b/arm_compute/core/PixelValue.h
index 1b1a5a3845..63405560ea 100644
--- a/arm_compute/core/PixelValue.h
+++ b/arm_compute/core/PixelValue.h
@@ -24,11 +24,9 @@
#ifndef __ARM_COMPUTE_PIXELVALUE_H__
#define __ARM_COMPUTE_PIXELVALUE_H__
-#include <cstdint>
+#include "arm_compute/core/Types.h"
-#if ARM_COMPUTE_ENABLE_FP16
-#include <arm_fp16.h> // needed for float16_t
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
+#include <cstdint>
namespace arm_compute
{
@@ -86,17 +84,15 @@ public:
{
value.s32 = v;
}
-#if ARM_COMPUTE_ENABLE_FP16
/** Initialize the union with a F16 pixel value
*
* @param[in] v F16 value.
*/
- PixelValue(float16_t v)
+ PixelValue(half v)
: PixelValue()
{
value.f16 = v;
}
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
/** Initialize the union with a F32 pixel value
*
* @param[in] v F32 value.
@@ -111,19 +107,17 @@ public:
*/
union
{
- uint8_t rgb[3]; /**< 3 channels: RGB888 */
- uint8_t yuv[3]; /**< 3 channels: Any YUV format */
- uint8_t rgbx[4]; /**< 4 channels: RGBX8888 */
- float f32; /**< Single channel float 32 */
-#if ARM_COMPUTE_ENABLE_FP16
- float16_t f16; /**< Single channel F16 */
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- uint8_t u8; /**< Single channel U8 */
- int8_t s8; /**< Single channel S8 */
- uint16_t u16; /**< Single channel U16 */
- int16_t s16; /**< Single channel S16 */
- uint32_t u32; /**< Single channel U32 */
- int32_t s32; /**< Single channel S32 */
+ uint8_t rgb[3]; /**< 3 channels: RGB888 */
+ uint8_t yuv[3]; /**< 3 channels: Any YUV format */
+ uint8_t rgbx[4]; /**< 4 channels: RGBX8888 */
+ float f32; /**< Single channel float 32 */
+ half f16; /**< Single channel F16 */
+ uint8_t u8; /**< Single channel U8 */
+ int8_t s8; /**< Single channel S8 */
+ uint16_t u16; /**< Single channel U16 */
+ int16_t s16; /**< Single channel S16 */
+ uint32_t u32; /**< Single channel U32 */
+ int32_t s32; /**< Single channel S32 */
} value;
/** Interpret the pixel value as a U8
*
@@ -173,16 +167,14 @@ public:
{
v = value.s32;
}
-#if ARM_COMPUTE_ENABLE_FP16
/** Interpret the pixel value as a F16
*
* @param[out] v Returned value
*/
- void get(float16_t &v) const
+ void get(half &v) const
{
v = value.f16;
}
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
/** Interpret the pixel value as a F32
*
* @param[out] v Returned value