History

avfilter/vf_extractplanes: add float formats support

Paul B Mahol committed 5 years ago

Commit 629dd8e1 parent cae57ca2 files · +18 −2Browse files

Unified · Split

2 files
  1. libavfilter/drawutils.c +4 −0
  2. libavfilter/vf_extractplanes.c +14 −2
libavfilter/drawutils.c+4−0
@@ -70,6 +70,10 @@ int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt) · 69 unmodified lines
7070 case AV_PIX_FMT_GBRAP12BE:
7171 case AV_PIX_FMT_GBRAP16LE:
7272 case AV_PIX_FMT_GBRAP16BE:
73+ case AV_PIX_FMT_GBRPF32LE:
74+ case AV_PIX_FMT_GBRPF32BE:
75+ case AV_PIX_FMT_GBRAPF32LE:
76+ case AV_PIX_FMT_GBRAPF32BE:
7377 case AV_PIX_FMT_GBRP: rgba_map[GREEN] = 0; rgba_map[BLUE ] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break;
7478 default: /* unsupported */
7579 return AVERROR(EINVAL);
libavfilter/vf_extractplanes.c+14−2
@@ -115,16 +115,22 @@ AVFILTER_DEFINE_CLASS(extractplanes); · 114 unmodified lines
115115 AV_PIX_FMT_YUV422P14##suf, \
116116 AV_PIX_FMT_YUV444P14##suf
117117
118+#define FLOAT_FORMATS(suf) \
119+ AV_PIX_FMT_GRAYF32##suf, \
120+ AV_PIX_FMT_GBRPF32##suf, AV_PIX_FMT_GBRAPF32##suf \
121+
118122 static int query_formats(AVFilterContext *ctx)
119123 {
120124 static const enum AVPixelFormat in_pixfmts_le[] = {
121125 EIGHTBIT_FORMATS,
122126 HIGHDEPTH_FORMATS(LE),
127+ FLOAT_FORMATS(LE),
123128 AV_PIX_FMT_NONE,
124129 };
125130 static const enum AVPixelFormat in_pixfmts_be[] = {
126131 EIGHTBIT_FORMATS,
127132 HIGHDEPTH_FORMATS(BE),
133+ FLOAT_FORMATS(BE),
128134 AV_PIX_FMT_NONE,
129135 };
130136 static const enum AVPixelFormat out8_pixfmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
@@ -138,6 +144,8 @@ static int query_formats(AVFilterContext *ctx) · 7 unmodified lines
138144 static const enum AVPixelFormat out14be_pixfmts[] = { AV_PIX_FMT_GRAY14BE, AV_PIX_FMT_NONE };
139145 static const enum AVPixelFormat out16le_pixfmts[] = { AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_NONE };
140146 static const enum AVPixelFormat out16be_pixfmts[] = { AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE };
147+ static const enum AVPixelFormat out32le_pixfmts[] = { AV_PIX_FMT_GRAYF32LE, AV_PIX_FMT_NONE };
148+ static const enum AVPixelFormat out32be_pixfmts[] = { AV_PIX_FMT_GRAYF32BE, AV_PIX_FMT_NONE };
141149 const enum AVPixelFormat *out_pixfmts, *in_pixfmts;
142150 const AVPixFmtDescriptor *desc;
143151 AVFilterFormats *avff;
@@ -187,10 +195,14 @@ static int query_formats(AVFilterContext *ctx) · 43 unmodified lines
187195 out_pixfmts = out14le_pixfmts;
188196 else if (be && depth == 14)
189197 out_pixfmts = out14be_pixfmts;
190− else if (be)
198+ else if (be && depth == 16)
191199 out_pixfmts = out16be_pixfmts;
192− else
200+ else if (!be && depth == 16)
193201 out_pixfmts = out16le_pixfmts;
202+ else if (be && depth == 32)
203+ out_pixfmts = out32be_pixfmts;
204+ else
205+ out_pixfmts = out32le_pixfmts;
194206
195207 for (i = 0; i < ctx->nb_outputs; i++)
196208 if ((ret = ff_formats_ref(ff_make_format_list(out_pixfmts), &ctx->outputs[i]->incfg.formats)) < 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t