diff options
author | Pablo Tello <pablo.tello@arm.com> | 2017-08-22 13:34:13 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | f5f34bb068565bf9435ba5561aae1c9280db8bbe (patch) | |
tree | 9920a815ee9653c3b97a09f90d765cb4efb7af06 /src/core/NEON/kernels/NEScaleKernel.cpp | |
parent | 43fc5cd712eed23b9cec340f526e6d5fb5050afa (diff) | |
download | ComputeLibrary-f5f34bb068565bf9435ba5561aae1c9280db8bbe.tar.gz |
COMPMID-470: Neon Deconvolution.
Implemented by up-sampling the input with zeros insertions between the input samples and convolving the Deconvolution kernels on the up-sampled result.
The upsampling is performed by the function NEDeconvolutionLayerUpsample.
Convolving is done by NEDirectConvolutionLayer.
Change-Id: I25f7ba7c6b99cd9310797972ede40aeff4a54900
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/85319
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEScaleKernel.cpp')
-rw-r--r-- | src/core/NEON/kernels/NEScaleKernel.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/NEON/kernels/NEScaleKernel.cpp b/src/core/NEON/kernels/NEScaleKernel.cpp index 6634d4b13c..b1ced7e38d 100644 --- a/src/core/NEON/kernels/NEScaleKernel.cpp +++ b/src/core/NEON/kernels/NEScaleKernel.cpp @@ -180,8 +180,10 @@ void NEScaleKernel::scale_nearest(const Window &window) const auto offsets_ptr = reinterpret_cast<const int32_t *>(offsets.ptr()); const uint8_t *const in_ptr = in.ptr(); - const int in_yi = std::floor((id.y() + 0.5f) * hr); - const int offset_row = in_yi * input_stride; + const int in_yi = std::floor((id.y() + 0.5f) * hr); + const int in_yi_clamped = std::min(static_cast<int>(_input->info()->dimension(1)), std::max(in_yi, -1)); + ARM_COMPUTE_ERROR_ON(in_yi_clamped < -1 || in_yi_clamped > static_cast<int>(_input->info()->dimension(1))); + const int offset_row = in_yi_clamped * input_stride; tmp = vsetq_lane_u8(in_ptr[offsets_ptr[0] + offset_row], tmp, 0); tmp = vsetq_lane_u8(in_ptr[offsets_ptr[1] + offset_row], tmp, 1); |