FFmpeg
Loading...
Searching...
No Matches
vsrc_testsrc_vulkan.c
Go to the documentation of this file.
1/*
2 * Copyright (c) Lynne
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "libavutil/csp.h"
22#include "libavutil/opt.h"
23#include "vulkan_filter.h"
24#include "filters.h"
25#include "colorspace.h"
26#include "video.h"
27
31
32extern const unsigned char ff_color_comp_spv_data[];
33extern const unsigned int ff_color_comp_spv_len;
34
38
39typedef struct TestSrcVulkanContext {
41
46
47 /* Only used by color_vulkan */
48 uint8_t color_rgba[4];
49
51
52 int w, h;
53 int pw, ph;
55 /* enum AVColorRange */
57 unsigned int nb_frame;
60 int64_t duration; ///< duration expressed in microseconds
61 AVRational sar; ///< sample aspect ratio
62 int draw_once; ///< draw only the first frame, always put out the same picture
63 int draw_once_reset; ///< draw only the first frame or in case of reset
64 AVFrame *picref; ///< cached reference containing the painted picture
66
68{
69 int err;
70 TestSrcVulkanContext *s = ctx->priv;
71 FFVulkanContext *vkctx = &s->vkctx;
72 const int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
73 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->vkctx.output_format);
74
75 s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
76 if (!s->qf) {
77 av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
78 err = AVERROR(ENOTSUP);
79 goto fail;
80 }
81
82 RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, FF_VK_DEFAULT_EXEC_CONTEXTS, 0, 0, 0, NULL));
83
84 ff_vk_shader_load(&s->shd, VK_SHADER_STAGE_COMPUTE_BIT, NULL,
85 (uint32_t []) { 32, 32, 1 }, 0);
86
87 ff_vk_shader_add_push_const(&s->shd, 0, sizeof(s->opts),
88 VK_SHADER_STAGE_COMPUTE_BIT);
89
90 const FFVulkanDescriptorSetBinding desc_set[] = {
91 { /* output_img */
92 .type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
93 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
94 .elems = planes,
95 },
96 };
97 ff_vk_shader_add_descriptor_set(vkctx, &s->shd, desc_set, 1, 0);
98
99 if (mode == TESTSRC_COLOR) {
100 double rgb2yuv[3][3];
101 double rgbad[4];
102 double yuvad[4];
103
104 enum AVColorSpace csp;
105 const AVLumaCoefficients *luma = NULL;
106
107 s->draw_once = 1;
108
109 if (desc->flags & AV_PIX_FMT_FLAG_RGB)
110 csp = AVCOL_SPC_RGB;
111 else
113
114 if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp)))
115 return AVERROR(EINVAL);
116 else if (!(desc->flags & AV_PIX_FMT_FLAG_RGB))
118
119 for (int i = 0; i < 4; i++)
120 rgbad[i] = s->color_rgba[i] / 255.0;
121
122 if (!(desc->flags & AV_PIX_FMT_FLAG_RGB))
123 ff_matrix_mul_3x3_vec(yuvad, rgbad, rgb2yuv);
124 else
125 memcpy(yuvad, rgbad, sizeof(rgbad));
126
127 yuvad[3] = rgbad[3];
128
129 if (!(desc->flags & AV_PIX_FMT_FLAG_RGB)) {
130 for (int i = 0; i < 3; i++) {
131 int chroma = (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && i > 0);
132 if (s->out_range == AVCOL_RANGE_MPEG) {
133 yuvad[i] *= (chroma ? 224.0 : 219.0) / 255.0;
134 yuvad[i] += (chroma ? 128.0 : 16.0) / 255.0;
135 } else if (chroma) {
136 yuvad[i] += 0.5;
137 }
138 }
139 }
140
141 /* Ensure we place the alpha appropriately for gray formats */
142 if (desc->nb_components <= 2)
143 yuvad[1] = yuvad[3];
144
145 float color_comp[4];
146 for (int i = 0; i < 4; i++)
147 color_comp[i] = yuvad[i];
148
149 int fmt_lut[4];
150 ff_vk_set_perm(s->vkctx.output_format, fmt_lut, 0);
151 for (int i = 0, c_off = 0; i < planes; i++) {
152 for (int c = 0; c < desc->nb_components; c++) {
153 if (desc->comp[c].plane == i) {
154 int off = desc->comp[c].offset / (FFALIGN(desc->comp[c].depth, 8)/8);
155 s->opts.color_data[i][off] = color_comp[fmt_lut[c_off++]];
156 }
157 }
158 }
159
161 ff_color_comp_spv_len, "main"));
162 }
163
164 RET(ff_vk_shader_register_exec(vkctx, &s->e, &s->shd));
165
166 s->initialized = 1;
167
168fail:
169 return err;
170}
171
173{
174 int err;
175 AVFilterLink *outlink = ctx->outputs[0];
176 TestSrcVulkanContext *s = ctx->priv;
177 const int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
178 AVFrame *frame;
179
180 if (!s->initialized) {
182 err = init_filter(ctx, mode);
183 if (err < 0)
184 return err;
185 }
186
187 if (!ff_outlink_frame_wanted(outlink))
188 return FFERROR_NOT_READY;
189 if (s->duration >= 0 &&
190 av_rescale_q(s->pts, s->time_base, AV_TIME_BASE_Q) >= s->duration) {
191 ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
192 return 0;
193 }
194
195 if (s->draw_once) {
196 if (s->draw_once_reset) {
197 av_frame_free(&s->picref);
198 s->draw_once_reset = 0;
199 }
200 if (!s->picref) {
201 s->picref = ff_get_video_buffer(outlink, s->w, s->h);
202 if (!s->picref)
203 return AVERROR(ENOMEM);
204
205 err = ff_vk_filter_process_simple(&s->vkctx, &s->e, &s->shd, s->picref, NULL,
206 VK_NULL_HANDLE, planes,
207 &s->opts, sizeof(s->opts));
208 if (err < 0)
209 return err;
210 }
211 frame = av_frame_clone(s->picref);
212 } else {
213 frame = ff_get_video_buffer(outlink, s->w, s->h);
214 }
215
216 if (!frame)
217 return AVERROR(ENOMEM);
218
219 frame->pts = s->pts;
220 frame->duration = 1;
221 frame->flags = AV_FRAME_FLAG_KEY;
222 frame->pict_type = AV_PICTURE_TYPE_I;
223 frame->sample_aspect_ratio = s->sar;
224 if (!s->draw_once) {
225 err = ff_vk_filter_process_simple(&s->vkctx, &s->e, &s->shd, frame, NULL,
226 VK_NULL_HANDLE, planes,
227 &s->opts, sizeof(s->opts));
228 if (err < 0) {
230 return err;
231 }
232 }
233
234 s->pts++;
235 s->nb_frame++;
236
237 return ff_filter_frame(outlink, frame);
238}
239
241{
242 int err;
243 FilterLink *l = ff_filter_link(outlink);
244 TestSrcVulkanContext *s = outlink->src->priv;
245 FFVulkanContext *vkctx = &s->vkctx;
246
247 if (!s->out_format_string) {
249 } else {
250 vkctx->output_format = av_get_pix_fmt(s->out_format_string);
251 if (vkctx->output_format == AV_PIX_FMT_NONE) {
252 av_log(vkctx, AV_LOG_ERROR, "Invalid output format.\n");
253 return AVERROR(EINVAL);
254 }
255 }
256
257 err = ff_vk_filter_init_context(outlink->src, vkctx, NULL,
258 s->w, s->h, vkctx->output_format);
259 if (err < 0)
260 return err;
261
263 if (!l->hw_frames_ctx)
264 return AVERROR(ENOMEM);
265
266 s->time_base = av_inv_q(s->frame_rate);
267 s->nb_frame = 0;
268 s->pts = 0;
269
270 s->vkctx.output_width = s->w;
271 s->vkctx.output_height = s->h;
272 outlink->w = s->w;
273 outlink->h = s->h;
274 outlink->sample_aspect_ratio = s->sar;
275 l->frame_rate = s->frame_rate;
276 outlink->time_base = s->time_base;
277
278 return 0;
279}
280
282{
283 TestSrcVulkanContext *s = avctx->priv;
284 FFVulkanContext *vkctx = &s->vkctx;
285
286 av_frame_free(&s->picref);
287
288 ff_vk_exec_pool_free(vkctx, &s->e);
289 ff_vk_shader_free(vkctx, &s->shd);
290
291 ff_vk_uninit(&s->vkctx);
292
293 s->initialized = 0;
294}
295
296#define OFFSET(x) offsetof(TestSrcVulkanContext, x)
297#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
298
299#define COMMON_OPTS \
300 { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str = "1920x1080" }, 0, 0, FLAGS }, \
301 { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str = "1920x1080" }, 0, 0, FLAGS }, \
302 \
303 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, { .str = "60" }, 0, INT_MAX, FLAGS }, \
304 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, { .str = "60" }, 0, INT_MAX, FLAGS }, \
305 \
306 { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, FLAGS }, \
307 { "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, FLAGS }, \
308 \
309 { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, { .dbl = 1 }, 0, INT_MAX, FLAGS }, \
310 \
311 { "format", "Output video format (software format of hardware frames)", OFFSET(out_format_string), AV_OPT_TYPE_STRING, .flags = FLAGS },
312
314 { "color", "set color", OFFSET(color_rgba), AV_OPT_TYPE_COLOR, {.str = "black"}, 0, 0, FLAGS },
315 { "c", "set color", OFFSET(color_rgba), AV_OPT_TYPE_COLOR, {.str = "black"}, 0, 0, FLAGS },
317 { "out_range", "Output colour range (from 0 to 2) (default 0)", OFFSET(out_range), AV_OPT_TYPE_INT, {.i64 = AVCOL_RANGE_UNSPECIFIED}, AVCOL_RANGE_UNSPECIFIED, AVCOL_RANGE_JPEG, .flags = FLAGS, .unit = "range" },
318 { "full", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, .unit = "range" },
319 { "limited", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, .unit = "range" },
320 { "jpeg", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, .unit = "range" },
321 { "mpeg", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, .unit = "range" },
322 { "tv", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, .unit = "range" },
323 { "pc", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, .unit = "range" },
324 { NULL },
325};
326
328
330 {
331 .name = "default",
332 .type = AVMEDIA_TYPE_VIDEO,
333 .config_props = testsrc_vulkan_config_props,
334 },
335};
336
338 .p.name = "color_vulkan",
339 .p.description = NULL_IF_CONFIG_SMALL("Generate a constant color (Vulkan)"),
340 .p.inputs = NULL,
341 .p.flags = AVFILTER_FLAG_HWDEVICE,
342 .p.priv_class = &color_vulkan_class,
343 .priv_size = sizeof(TestSrcVulkanContext),
349 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
350};
const FFFilter ff_vsrc_color_vulkan
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
Definition avfilter.c:1690
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
static void fn rgb2yuv(uint8_t *_yuv[3], const ptrdiff_t yuv_stride[3], int16_t *rgb[3], ptrdiff_t s, int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], const int16_t yuv_offset[8])
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
Colorspace value utility functions for libavutil.
static AVFrame * frame
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define COMMON_OPTS
Definition f_segment.c:264
#define fail
Definition test.h:479
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition buffer.c:103
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition frame.h:687
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition frame.c:483
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
const struct AVLumaCoefficients * av_csp_luma_coeffs_from_avcsp(enum AVColorSpace csp)
Retrieves the Luma coefficients necessary to construct a conversion matrix from an enum constant desc...
Definition csp.c:58
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition rational.h:159
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
@ AV_PICTURE_TYPE_I
Intra.
Definition avutil.h:278
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
Definition avutil.h:263
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
void ff_matrix_mul_3x3_vec(double dst[3], const double vec[3], const double mat[3][3])
Definition colorspace.c:66
void ff_fill_rgb2yuv_table(const AVLumaCoefficients *coeffs, double rgb2yuv[3][3])
Definition colorspace.c:125
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition filters.h:208
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition filters.h:629
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
Definition filters.h:34
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
void ff_vk_set_perm(enum AVPixelFormat pix_fmt, int lut[4], int inv)
Since storage images may not be swizzled, we have to do this in the shader itself.
Definition vulkan.c:1696
int ff_vk_shader_load(FFVulkanShader *shd, VkPipelineStageFlags stage, VkSpecializationInfo *spec, uint32_t wg_size[3], uint32_t required_subgroup_size)
Initialize a shader object.
Definition vulkan.c:2240
void ff_vk_shader_add_descriptor_set(FFVulkanContext *s, FFVulkanShader *shd, const FFVulkanDescriptorSetBinding *desc, int nb, int singular)
Add descriptor to a shader.
Definition vulkan.c:2550
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
Definition vulkan.c:331
int ff_vk_exec_pool_init(FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf, FFVkExecPool *pool, int nb_contexts, int nb_queries, VkQueryType query_type, int query_64bit, const void *query_create_pnext)
Allocates/frees an execution pool.
Definition vulkan.c:395
int ff_vk_shader_add_push_const(FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage)
Add/update push constants for execution.
Definition vulkan.c:1613
void ff_vk_uninit(FFVulkanContext *s)
Frees main context.
Definition vulkan.c:2815
void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
Free a shader.
Definition vulkan.c:2791
int ff_vk_shader_register_exec(FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd)
Register a shader with an exec pool.
Definition vulkan.c:2584
AVVulkanDeviceQueueFamily * ff_vk_qf_find(FFVulkanContext *s, VkQueueFlagBits dev_family, VkVideoCodecOperationFlagBitsKHR vid_ops)
Chooses an appropriate QF.
Definition vulkan.c:316
int ff_vk_shader_link(FFVulkanContext *s, FFVulkanShader *shd, const char *spirv, size_t spirv_len, const char *entrypoint)
Link a shader into an executable.
Definition vulkan.c:2444
const char * desc
Definition libsvtav1.c:83
static const struct @257111027162314367033347246032313251342043035002 planes[]
#define FFALIGN(x, a)
Definition macros.h:78
AVOptions.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3500
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition pixdesc.c:3392
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition pixdesc.h:136
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition pixfmt.h:766
@ AVCOL_RANGE_UNSPECIFIED
Definition pixfmt.h:749
@ AVCOL_RANGE_JPEG
Full range content.
Definition pixfmt.h:783
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition pixfmt.h:379
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
AVColorSpace
YUV colorspace type.
Definition pixfmt.h:706
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
Definition pixfmt.h:707
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
Definition pixfmt.h:713
An instance of a filter.
Definition avfilter.h:273
void * priv
private data for use by the filter
Definition avfilter.h:288
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
Struct containing luma coefficients to be used for RGB to YUV/YCoCg, or similar calculations.
Definition csp.h:48
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
Rational number (pair of numerator and denominator).
Definition rational.h:58
AVBufferRef * frames_ref
Definition vulkan.h:342
enum AVPixelFormat output_format
Definition vulkan.h:352
AVVulkanDeviceQueueFamily * qf
int draw_once
draw only the first frame, always put out the same picture
AVRational sar
sample aspect ratio
int draw_once_reset
draw only the first frame or in case of reset
int64_t duration
duration expressed in microseconds
TestSrcVulkanPushData opts
AVFrame * picref
cached reference containing the painted picture
Definition swscale.c:71
#define av_log(a,...)
static av_always_inline void chroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset_y, int offset_x, int column, int mirror, int jobnr, int nb_jobs)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89
static double c[64]
const unsigned char ff_color_comp_spv_data[]
const unsigned int ff_color_comp_spv_len
TestSrcVulkanMode
@ TESTSRC_COLOR
static const AVFilterPad testsrc_vulkan_outputs[]
static int testsrc_vulkan_config_props(AVFilterLink *outlink)
static av_cold int init_filter(AVFilterContext *ctx, enum TestSrcVulkanMode mode)
static void testsrc_vulkan_uninit(AVFilterContext *avctx)
#define OFFSET(x)
static int testsrc_vulkan_activate(AVFilterContext *ctx)
static const AVOption color_vulkan_options[]
#define FF_VK_DEFAULT_EXEC_CONTEXTS
Definition vulkan.h:121
#define RET(x)
Definition vulkan.h:37
int ff_vk_filter_process_simple(FFVulkanContext *vkctx, FFVkExecPool *e, FFVulkanShader *shd, AVFrame *out_f, AVFrame *in_f, VkSampler sampler, uint32_t wgc_z, void *push_src, size_t push_size)
Submit a compute shader with a zero/one input and single out for execution.
int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s, AVBufferRef *frames_ref, int width, int height, enum AVPixelFormat sw_format)
Can be called manually, if not using ff_vk_filter_config_output.
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.