diff options
author | Mark Reid <mindmark@gmail.com> | 2020-05-03 16:10:04 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-05 20:06:58 +0200 |
commit | b4967fc71c63eae8cd96f9c46cd3e1fbd705bbf9 (patch) | |
tree | 3596a2ed253605b9f3f29a7b66dcc755a0c7b482 /libswscale/slice.c | |
parent | ba5d0515a6dc0e34d578e5ef94b6ca5f17fc979d (diff) | |
download | ffmpeg-b4967fc71c63eae8cd96f9c46cd3e1fbd705bbf9.tar.gz |
libswscale: add output support for AV_PIX_FMT_GBRAPF32
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswscale/slice.c')
-rw-r--r-- | libswscale/slice.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/libswscale/slice.c b/libswscale/slice.c index db4fa874ff..7849b70f4d 100644 --- a/libswscale/slice.c +++ b/libswscale/slice.c @@ -189,23 +189,26 @@ int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int src return 0; } -static void fill_ones(SwsSlice *s, int n, int is16bit) +static void fill_ones(SwsSlice *s, int n, int bpc) { - int i; + int i, j, k, size, end; + for (i = 0; i < 4; ++i) { - int j; - int size = s->plane[i].available_lines; + size = s->plane[i].available_lines; for (j = 0; j < size; ++j) { - int k; - int end = is16bit ? n>>1: n; - // fill also one extra element - end += 1; - if (is16bit) + if (bpc == 16) { + end = (n>>1) + 1; for (k = 0; k < end; ++k) ((int32_t*)(s->plane[i].line[j]))[k] = 1<<18; - else + } else if (bpc == 32) { + end = (n>>2) + 1; + for (k = 0; k < end; ++k) + ((int64_t*)(s->plane[i].line[j]))[k] = 1LL<<34; + } else { + end = n + 1; for (k = 0; k < end; ++k) ((int16_t*)(s->plane[i].line[j]))[k] = 1<<14; + } } } } @@ -272,6 +275,9 @@ int ff_init_filters(SwsContext * c) if (c->dstBpc == 16) dst_stride <<= 1; + if (c->dstBpc == 32) + dst_stride <<= 2; + num_ydesc = need_lum_conv ? 2 : 1; num_cdesc = need_chr_conv ? 2 : 1; @@ -302,7 +308,7 @@ int ff_init_filters(SwsContext * c) res = alloc_lines(&c->slice[i], dst_stride, c->dstW); if (res < 0) goto cleanup; - fill_ones(&c->slice[i], dst_stride>>1, c->dstBpc == 16); + fill_ones(&c->slice[i], dst_stride>>1, c->dstBpc); // vertical scaler output ++i; |