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/slice.c | |
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/slice.c')
-rw-r--r-- | libswscale/slice.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libswscale/slice.c b/libswscale/slice.c index b3ee06d632..db1c696727 100644 --- a/libswscale/slice.c +++ b/libswscale/slice.c @@ -282,7 +282,13 @@ int ff_init_filters(SwsContext * c) c->descIndex[0] = num_ydesc + (need_gamma ? 1 : 0); c->descIndex[1] = num_ydesc + num_cdesc + (need_gamma ? 1 : 0); - + if (isFloat16(c->srcFormat)) { + c->h2f_tables = av_malloc(sizeof(*c->h2f_tables)); + if (!c->h2f_tables) + return AVERROR(ENOMEM); + ff_init_half2float_tables(c->h2f_tables); + c->input_opaque = c->h2f_tables; + } c->desc = av_calloc(c->numDesc, sizeof(*c->desc)); if (!c->desc) @@ -393,5 +399,6 @@ int ff_free_filters(SwsContext *c) free_slice(&c->slice[i]); av_freep(&c->slice); } + av_freep(&c->h2f_tables); return 0; } |