From 583137cc60580023abfd9d05abf933e7e117e29f Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 31 Aug 2017 18:12:42 +0100 Subject: COMPMID-417: Add support for floats in scale. Change-Id: I7d714ba13861509080a89817f54e9d32da83e970 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/86026 Reviewed-by: Pablo Tello Tested-by: Kaizen --- arm_compute/core/Helpers.inl | 49 -------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'arm_compute/core/Helpers.inl') diff --git a/arm_compute/core/Helpers.inl b/arm_compute/core/Helpers.inl index c2ca3b44b3..de6c85ec76 100644 --- a/arm_compute/core/Helpers.inl +++ b/arm_compute/core/Helpers.inl @@ -29,55 +29,6 @@ namespace arm_compute { -inline uint8_t delta_bilinear_c1u8(const uint8_t *pixel_ptr, size_t stride, float dx, float dy) -{ - ARM_COMPUTE_ERROR_ON(pixel_ptr == nullptr); - - const float dx1 = 1.0f - dx; - const float dy1 = 1.0f - dy; - - const float a00 = *pixel_ptr; - const float a01 = *(pixel_ptr + 1); - const float a10 = *(pixel_ptr + stride); - const float a11 = *(pixel_ptr + stride + 1); - - const float w1 = dx1 * dy1; - const float w2 = dx * dy1; - const float w3 = dx1 * dy; - const float w4 = dx * dy; - - return a00 * w1 + a01 * w2 + a10 * w3 + a11 * w4; -} - -inline uint8_t pixel_bilinear_c1u8(const uint8_t *first_pixel_ptr, size_t stride, float x, float y) -{ - ARM_COMPUTE_ERROR_ON(first_pixel_ptr == nullptr); - - const int32_t xi = std::floor(x); - const int32_t yi = std::floor(y); - - const float dx = x - xi; - const float dy = y - yi; - - return delta_bilinear_c1u8(first_pixel_ptr + xi + yi * stride, stride, dx, dy); -} - -inline uint8_t pixel_bilinear_c1u8_clamp(const uint8_t *first_pixel_ptr, size_t stride, size_t width, size_t height, float x, float y) -{ - ARM_COMPUTE_ERROR_ON(first_pixel_ptr == nullptr); - - x = std::max(-1.f, std::min(x, static_cast(width))); - y = std::max(-1.f, std::min(y, static_cast(height))); - - const float xi = std::floor(x); - const float yi = std::floor(y); - - const float dx = x - xi; - const float dy = y - yi; - - return delta_bilinear_c1u8(first_pixel_ptr + static_cast(xi) + static_cast(yi) * stride, stride, dx, dy); -} - inline uint8_t pixel_area_c1u8_clamp(const uint8_t *first_pixel_ptr, size_t stride, size_t width, size_t height, float wr, float hr, int x, int y) { ARM_COMPUTE_ERROR_ON(first_pixel_ptr == nullptr); -- cgit v1.2.1