@ -44,6 +44,7 @@
# include "precomp.hpp"
# include "precomp.hpp"
# include "opencl_kernels_core.hpp"
# include "opencl_kernels_core.hpp"
# include "opencv2/core/hal/intrin.hpp"
# ifdef __APPLE__
# ifdef __APPLE__
# undef CV_NEON
# undef CV_NEON
@ -4379,7 +4380,7 @@ struct Cvt_SIMD<float, int>
# endif
# endif
# if !( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) )
# if !( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR_ _ ) ) || ( 5 <= __GNUC__ ) ) ) )
// const numbers for floating points format
// const numbers for floating points format
const unsigned int kShiftSignificand = 13 ;
const unsigned int kShiftSignificand = 13 ;
const unsigned int kMaskFp16Significand = 0x3ff ;
const unsigned int kMaskFp16Significand = 0x3ff ;
@ -4387,7 +4388,7 @@ const unsigned int kBiasFp16Exponent = 15;
const unsigned int kBiasFp32Exponent = 127 ;
const unsigned int kBiasFp32Exponent = 127 ;
# endif
# endif
# if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
# if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR_ _ ) ) || ( 5 <= __GNUC__ ) ) )
static float convertFp16SW ( short fp16 )
static float convertFp16SW ( short fp16 )
{
{
// Fp16 -> Fp32
// Fp16 -> Fp32
@ -4449,7 +4450,7 @@ static float convertFp16SW(short fp16)
}
}
# endif
# endif
# if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
# if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC_MINOR_ _ ) ) || ( 5 <= __GNUC__ ) ) )
static short convertFp16SW ( float fp32 )
static short convertFp16SW ( float fp32 )
{
{
// Fp32 -> Fp16
// Fp32 -> Fp16
@ -4557,7 +4558,7 @@ cvtScaleHalf_<float, short>( const float* src, size_t sstep, short* dst, size_t
if ( ( ( intptr_t ) dst & 0xf ) = = 0 )
if ( ( ( intptr_t ) dst & 0xf ) = = 0 )
# endif
# endif
{
{
# if CV_FP16
# if CV_FP16 && CV_SIMD128
for ( ; x < = size . width - 4 ; x + = 4 )
for ( ; x < = size . width - 4 ; x + = 4 )
{
{
v_float32x4 v_src = v_load ( src + x ) ;
v_float32x4 v_src = v_load ( src + x ) ;
@ -4603,7 +4604,7 @@ cvtScaleHalf_<short, float>( const short* src, size_t sstep, float* dst, size_t
if ( ( ( intptr_t ) src & 0xf ) = = 0 )
if ( ( ( intptr_t ) src & 0xf ) = = 0 )
# endif
# endif
{
{
# if CV_FP16
# if CV_FP16 && CV_SIMD128
for ( ; x < = size . width - 4 ; x + = 4 )
for ( ; x < = size . width - 4 ; x + = 4 )
{
{
v_float16x4 v_src = v_load_f16 ( src + x ) ;
v_float16x4 v_src = v_load_f16 ( src + x ) ;