[FFmpeg-devel] [PATCH] swscale/input: add rgbaf16 input support

Timo Rothenpieler timo at rothenpieler.org
Tue Aug 9 01:59:11 EEST 2022


On 09.08.2022 00:37, Timo Rothenpieler wrote:
> The entire support for the format is removed from swscale in this case, 
> so the function ending up empty doesn't matter.
> 
> I'll see if it can be added to half2float, but I can't even tell if it 
> implements ieee floats, or something else.

Did a very straight forward implementation with unions:

> static uint32_t half2float(uint16_t h, const uint32_t *mantissatable, const uint32_t *exponenttable,
>                            const uint16_t *offsettable)
> {
> #if HAVE_FLOAT16
>     union {
>         uint16_t i;
>         _Float16 f;
>     } u16;
>     union {
>         uint32_t i;
>         float f;
>     } u32;
>     u16.i = h;
>     u32.f = u16.f;
>     return u32.i;
> #else
>     uint32_t f;
> 
>     f = mantissatable[offsettable[h >> 10] + (h & 0x3ff)] + exponenttable[h >> 10];
> 
>     return f;
> #endif
> }

Unfortunately, this makes all exr fate tests fail with differing output 
checksums.
At least the checksums match between f16c SIMD version and fallback sse2 
implementation.


More information about the ffmpeg-devel mailing list