removed float2half and float_to_half

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-09-11 16:36:06 +08:00
parent 6a21b387f5
commit 41178fcb3b

View File

@ -54,16 +54,6 @@ namespace hgl
*/
void Float32toFloat16(half_float *output,const float *input,const uint count);
/**
* float32转float16处理
*/
inline const half_float float2half(const float &f)
{
const uint32 x = *((uint32 *)&f);
return ((x>>16)&0x8000)|((((x&0x7f800000)-0x38000000)>>13)&0x7c00)|((x>>13)&0x03ff);
}
inline const float half2float(const half_float &hf)
{
union
@ -87,16 +77,6 @@ namespace hgl
}
}
inline void float_to_half(half_float *target,const float *source,uint32 count)
{
while (count--)
{
*target = float2half(*source);
++target;
++source;
}
}
inline void half2u16(uint16 *output,const half_float *input,const uint count)
{
union