MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / scale255_S32_S32

Function scale255_S32_S32

src/cpu/kernels/CpuMulKernel.cpp:159–167  ·  view source on GitHub ↗

Scales a given vector by 1/255. * * @note This does not work for all cases. e.g. for float of 0.49999999999999994 and large floats. * * @param in Input vector to scale. * @return Scaled dst rounded to nearest (round half up). */

Source from the content-addressed store, hash-verified

157 * @return Scaled dst rounded to nearest (round half up).
158 */
159inline int32x4_t scale255_S32_S32(int32x4_t in)
160{
161 // Scale
162 const float32x4_t tmp = vmulq_f32(vcvtq_f32_s32(in), scale255_constant_f32q);
163 // Round to nearest (round half up)
164 // Add +0.5 for all values
165 // Afterwards vcvt rounds toward zero
166 return vcvtq_s32_f32(vaddq_f32(tmp, positive_round_f32q));
167}
168
169inline uint16x8_t scale255_U16_U16(uint16x8_t in)
170{

Callers 2

scale255_U16_U16Function · 0.85
mul_S16_S16_S16_n_loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected