diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2022-08-08 14:02:31 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2022-08-19 22:09:36 +0200 |
commit | aca569aad26f33fe68eb36c5c689b2dc4de77084 (patch) | |
tree | b6cd9eb66cd151a89d028bb35efed8b58c1ab13b /libswscale/swscale_internal.h | |
parent | f2de911818fbd7e73343803626b697fd0c968121 (diff) | |
download | ffmpeg-aca569aad26f33fe68eb36c5c689b2dc4de77084.tar.gz |
swscale/input: add rgbaf16 input support
This is by no means perfect, since at least ddagrab will return scRGB
data with values outside of 0.0f to 1.0f for HDR values.
Its primary purpose is to be able to work with the format at all.
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r-- | libswscale/swscale_internal.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 9ab542933f..6c14ce8536 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -35,6 +35,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/slicethread.h" #include "libavutil/ppc/util_altivec.h" +#include "libavutil/half2float.h" #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long @@ -679,6 +680,8 @@ typedef struct SwsContext { unsigned int dst_slice_align; atomic_int stride_unaligned_warned; atomic_int data_unaligned_warned; + + Half2FloatTables *h2f_tables; } SwsContext; //FIXME check init (where 0) @@ -840,6 +843,13 @@ static av_always_inline int isFloat(enum AVPixelFormat pix_fmt) return desc->flags & AV_PIX_FMT_FLAG_FLOAT; } +static av_always_inline int isFloat16(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_FLOAT) && desc->comp[0].depth == 16; +} + static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); |