FFmpeg
Loading...
Searching...
No Matches
vf_xfade_vulkan.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "libavutil/avassert.h"
20#include "libavutil/opt.h"
21
22#include "vulkan_filter.h"
23#include "filters.h"
24#include "video.h"
25
26#define IN_A 0
27#define IN_B 1
28#define IN_NB 2
29
30extern const unsigned char ff_xfade_comp_spv_data[];
31extern const unsigned int ff_xfade_comp_spv_len;
32
33typedef struct XFadeParameters {
34 float progress;
36
37typedef struct XFadeVulkanContext {
39
43
48 VkSampler sampler;
49
50 // PTS when the fade should start (in IN_A timebase)
52
53 // PTS offset between IN_A and IN_B
55
56 // Duration of the transition
58
59 // Current PTS of the first input (IN_A)
61
62 // If frames are currently just passed through
63 // unmodified, like before and after the actual
64 // transition.
66
69
90
92{
93 int err = 0;
94 XFadeVulkanContext *s = avctx->priv;
95 FFVulkanContext *vkctx = &s->vkctx;
96 const int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
97
98 s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
99 if (!s->qf) {
100 av_log(avctx, AV_LOG_ERROR, "Device has no compute queues\n");
101 err = AVERROR(ENOTSUP);
102 goto fail;
103 }
104
105 RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, FF_VK_DEFAULT_EXEC_CONTEXTS, 0, 0, 0, NULL));
106 RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
107
108 SPEC_LIST_CREATE(sl, 2, 2*sizeof(int))
109 SPEC_LIST_ADD(sl, 0, 32, s->transition);
110 SPEC_LIST_ADD(sl, 1, 32, planes);
111
112 ff_vk_shader_load(&s->shd, VK_SHADER_STAGE_COMPUTE_BIT,
113 NULL, (int []) { 32, 32, 1 }, 0);
114
116 { /* a_images */
117 .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
118 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
119 .samplers = DUP_SAMPLER(s->sampler),
120 },
121 { /* b_images */
122 .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
123 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
124 .samplers = DUP_SAMPLER(s->sampler),
125 },
126 { /* output_images */
127 .type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
128 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
129 },
130 };
131 ff_vk_shader_add_descriptor_set(vkctx, &s->shd, desc, 3, 0);
132
134 VK_SHADER_STAGE_COMPUTE_BIT);
135
136 RET(ff_vk_shader_link(vkctx, &s->shd,
138 ff_xfade_comp_spv_len, "main"));
139
140 RET(ff_vk_shader_register_exec(vkctx, &s->e, &s->shd));
141
142 s->initialized = 1;
143
144fail:
145 return err;
146}
147
148static int xfade_frame(AVFilterContext *avctx, AVFrame *frame_a, AVFrame *frame_b)
149{
150 int err;
151 AVFilterLink *outlink = avctx->outputs[0];
152 XFadeVulkanContext *s = avctx->priv;
153 float progress;
154
155 AVFrame *output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
156 if (!output) {
157 err = AVERROR(ENOMEM);
158 goto fail;
159 }
160
161 if (!s->initialized) {
164 if (a_fc->sw_format != b_fc->sw_format) {
165 av_log(avctx, AV_LOG_ERROR,
166 "Currently the sw format of the first input needs to match the second!\n");
167 return AVERROR(EINVAL);
168 }
169 RET(init_vulkan(avctx));
170 }
171
172 RET(av_frame_copy_props(output, frame_a));
173 output->pts = s->pts;
174
175 progress = av_clipf((float)(s->pts - s->start_pts) / s->duration_pts,
176 0.f, 1.f);
177
178 RET(ff_vk_filter_process_Nin(&s->vkctx, &s->e, &s->shd, output,
179 (AVFrame *[]){ frame_a, frame_b }, 2, s->sampler, 1,
180 &(XFadeParameters){ progress }, sizeof(XFadeParameters)));
181
182 return ff_filter_frame(outlink, output);
183
184fail:
185 av_frame_free(&output);
186 return err;
187}
188
190{
191 int err;
192 AVFilterContext *avctx = outlink->src;
193 XFadeVulkanContext *s = avctx->priv;
194 AVFilterLink *inlink_a = avctx->inputs[IN_A];
195 AVFilterLink *inlink_b = avctx->inputs[IN_B];
196 FilterLink *il = ff_filter_link(inlink_a);
197 FilterLink *ol = ff_filter_link(outlink);
198
199 if (inlink_a->w != inlink_b->w || inlink_a->h != inlink_b->h) {
200 av_log(avctx, AV_LOG_ERROR, "First input link %s parameters "
201 "(size %dx%d) do not match the corresponding "
202 "second input link %s parameters (size %dx%d)\n",
203 avctx->input_pads[IN_A].name, inlink_a->w, inlink_a->h,
204 avctx->input_pads[IN_B].name, inlink_b->w, inlink_b->h);
205 return AVERROR(EINVAL);
206 }
207
208 if (inlink_a->time_base.num != inlink_b->time_base.num ||
209 inlink_a->time_base.den != inlink_b->time_base.den) {
210 av_log(avctx, AV_LOG_ERROR, "First input link %s timebase "
211 "(%d/%d) does not match the corresponding "
212 "second input link %s timebase (%d/%d)\n",
213 avctx->input_pads[IN_A].name, inlink_a->time_base.num, inlink_a->time_base.den,
214 avctx->input_pads[IN_B].name, inlink_b->time_base.num, inlink_b->time_base.den);
215 return AVERROR(EINVAL);
216 }
217
218 s->start_pts = s->inputs_offset_pts = AV_NOPTS_VALUE;
219
220 outlink->time_base = inlink_a->time_base;
221 ol->frame_rate = il->frame_rate;
222 outlink->sample_aspect_ratio = inlink_a->sample_aspect_ratio;
223
224 if (s->duration)
225 s->duration_pts = av_rescale_q(s->duration, AV_TIME_BASE_Q, inlink_a->time_base);
227
228fail:
229 return err;
230}
231
233 AVFilterLink *inlink, AVFilterLink *outlink)
234{
235 int64_t status_pts;
236 int ret = 0, status;
237 AVFrame *frame = NULL;
238
239 ret = ff_inlink_consume_frame(inlink, &frame);
240 if (ret < 0)
241 return ret;
242
243 if (ret > 0) {
244 // If we do not have an offset yet, it's because we
245 // never got a first input. Just offset to 0
246 if (s->inputs_offset_pts == AV_NOPTS_VALUE)
247 s->inputs_offset_pts = -frame->pts;
248
249 // We got a frame, nothing to do other than adjusting the timestamp
250 frame->pts += s->inputs_offset_pts;
251 return ff_filter_frame(outlink, frame);
252 }
253
254 // Forward status with our timestamp
255 if (ff_inlink_acknowledge_status(inlink, &status, &status_pts)) {
256 if (s->inputs_offset_pts == AV_NOPTS_VALUE)
257 s->inputs_offset_pts = -status_pts;
258
259 ff_outlink_set_status(outlink, status, status_pts + s->inputs_offset_pts);
260 return 0;
261 }
262
263 // No frame available, request one if needed
264 if (ff_outlink_frame_wanted(outlink))
266
267 return 0;
268}
269
270static int activate(AVFilterContext *avctx)
271{
272 XFadeVulkanContext *s = avctx->priv;
273 AVFilterLink *in_a = avctx->inputs[IN_A];
274 AVFilterLink *in_b = avctx->inputs[IN_B];
275 AVFilterLink *outlink = avctx->outputs[0];
276 int64_t status_pts;
277
278 FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, avctx);
279
280 // Check if we already transitioned or IN_A ended prematurely,
281 // in which case just forward the frames from IN_B with adjusted
282 // timestamps until EOF.
283 if (s->status[IN_A] && !s->status[IN_B])
284 return forward_frame(s, in_b, outlink);
285
286 // We did not finish transitioning yet and the first stream
287 // did not end either, so check if there are more frames to consume.
289 AVFrame *peeked_frame = ff_inlink_peek_frame(in_a, 0);
290 s->pts = peeked_frame->pts;
291
292 if (s->start_pts == AV_NOPTS_VALUE)
293 s->start_pts =
294 s->pts + av_rescale_q(s->offset, AV_TIME_BASE_Q, in_a->time_base);
295
296 // Check if we are not yet transitioning, in which case
297 // just request and forward the input frame.
298 if (s->start_pts > s->pts) {
299 AVFrame *frame_a = NULL;
300 s->passthrough = 1;
301 ff_inlink_consume_frame(in_a, &frame_a);
302 return ff_filter_frame(outlink, frame_a);
303 }
304 s->passthrough = 0;
305
306 // We are transitioning, so we need a frame from IN_B
308 int ret;
309 AVFrame *frame_a = NULL, *frame_b = NULL;
310 ff_inlink_consume_frame(avctx->inputs[IN_A], &frame_a);
311 ff_inlink_consume_frame(avctx->inputs[IN_B], &frame_b);
312
313 // Calculate PTS offset to first input
314 if (s->inputs_offset_pts == AV_NOPTS_VALUE)
315 s->inputs_offset_pts = s->pts - frame_b->pts;
316
317 // Check if we finished transitioning, in which case we
318 // report back EOF to IN_A as it is no longer needed.
319 if (s->pts - s->start_pts > s->duration_pts) {
320 s->status[IN_A] = AVERROR_EOF;
322 s->passthrough = 1;
323 }
324 ret = xfade_frame(avctx, frame_a, frame_b);
325 av_frame_free(&frame_a);
326 av_frame_free(&frame_b);
327 return ret;
328 }
329
330 // We did not get a frame from IN_B, check its status.
331 if (ff_inlink_acknowledge_status(in_b, &s->status[IN_B], &status_pts)) {
332 // We should transition, but IN_B is EOF so just report EOF output now.
333 ff_outlink_set_status(outlink, s->status[IN_B], s->pts);
334 return 0;
335 }
336
337 // We did not get a frame for IN_B but no EOF either, so just request more.
338 if (ff_outlink_frame_wanted(outlink)) {
340 return 0;
341 }
342 }
343
344 // We did not get a frame from IN_A, check its status.
345 if (ff_inlink_acknowledge_status(in_a, &s->status[IN_A], &status_pts)) {
346 // No more frames from IN_A, do not report EOF though, we will just
347 // forward the IN_B frames in the next activate calls.
348 s->passthrough = 1;
349 ff_filter_set_ready(avctx, 100);
350 return 0;
351 }
352
353 // We have no frames yet from IN_A and no EOF, so request some.
354 if (ff_outlink_frame_wanted(outlink)) {
356 return 0;
357 }
358
359 return FFERROR_NOT_READY;
360}
361
362static av_cold void uninit(AVFilterContext *avctx)
363{
364 XFadeVulkanContext *s = avctx->priv;
365 FFVulkanContext *vkctx = &s->vkctx;
366 FFVulkanFunctions *vk = &vkctx->vkfn;
367
368 ff_vk_exec_pool_free(vkctx, &s->e);
369 ff_vk_shader_free(vkctx, &s->shd);
370
371 if (s->sampler)
372 vk->DestroySampler(vkctx->hwctx->act_dev, s->sampler,
373 vkctx->hwctx->alloc);
374
375 ff_vk_uninit(&s->vkctx);
376
377 s->initialized = 0;
378}
379
380static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
381{
382 XFadeVulkanContext *s = inlink->dst->priv;
383
384 return s->passthrough ?
385 ff_null_get_video_buffer (inlink, w, h) :
387}
388
389#define OFFSET(x) offsetof(XFadeVulkanContext, x)
390#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
391
393 { "transition", "set cross fade transition", OFFSET(transition), AV_OPT_TYPE_INT, {.i64=FADE}, 0, NB_TRANSITIONS-1, FLAGS, .unit = "transition" },
394 { "fade", "fade transition", 0, AV_OPT_TYPE_CONST, {.i64=FADE}, 0, 0, FLAGS, .unit = "transition" },
395 { "wipeleft", "wipe left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPELEFT}, 0, 0, FLAGS, .unit = "transition" },
396 { "wiperight", "wipe right transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPERIGHT}, 0, 0, FLAGS, .unit = "transition" },
397 { "wipeup", "wipe up transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEUP}, 0, 0, FLAGS, .unit = "transition" },
398 { "wipedown", "wipe down transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEDOWN}, 0, 0, FLAGS, .unit = "transition" },
399 { "slidedown", "slide down transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDEDOWN}, 0, 0, FLAGS, .unit = "transition" },
400 { "slideup", "slide up transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDEUP}, 0, 0, FLAGS, .unit = "transition" },
401 { "slideleft", "slide left transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDELEFT}, 0, 0, FLAGS, .unit = "transition" },
402 { "slideright", "slide right transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDERIGHT}, 0, 0, FLAGS, .unit = "transition" },
403 { "circleopen", "circleopen transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLEOPEN}, 0, 0, FLAGS, .unit = "transition" },
404 { "circleclose", "circleclose transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLECLOSE}, 0, 0, FLAGS, .unit = "transition" },
405 { "dissolve", "dissolve transition", 0, AV_OPT_TYPE_CONST, {.i64=DISSOLVE}, 0, 0, FLAGS, .unit = "transition" },
406 { "pixelize", "pixelize transition", 0, AV_OPT_TYPE_CONST, {.i64=PIXELIZE}, 0, 0, FLAGS, .unit = "transition" },
407 { "wipetl", "wipe top left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPETL}, 0, 0, FLAGS, .unit = "transition" },
408 { "wipetr", "wipe top right transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPETR}, 0, 0, FLAGS, .unit = "transition" },
409 { "wipebl", "wipe bottom left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEBL}, 0, 0, FLAGS, .unit = "transition" },
410 { "wipebr", "wipe bottom right transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEBR}, 0, 0, FLAGS, .unit = "transition" },
411 { "duration", "set cross fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=1000000}, 0, 60000000, FLAGS },
412 { "offset", "set cross fade start relative to first input stream", OFFSET(offset), AV_OPT_TYPE_DURATION, {.i64=0}, INT64_MIN, INT64_MAX, FLAGS },
413 { NULL }
414};
415
417
419 {
420 .name = "main",
421 .type = AVMEDIA_TYPE_VIDEO,
422 .get_buffer.video = &get_video_buffer,
423 .config_props = &ff_vk_filter_config_input,
424 },
425 {
426 .name = "xfade",
427 .type = AVMEDIA_TYPE_VIDEO,
428 .get_buffer.video = &get_video_buffer,
429 .config_props = &ff_vk_filter_config_input,
430 },
431};
432
434 {
435 .name = "default",
436 .type = AVMEDIA_TYPE_VIDEO,
437 .config_props = &config_props_output,
438 },
439};
440
442 .p.name = "xfade_vulkan",
443 .p.description = NULL_IF_CONFIG_SMALL("Cross fade one video with another video."),
444 .p.priv_class = &xfade_vulkan_class,
445 .p.flags = AVFILTER_FLAG_HWDEVICE,
446 .priv_size = sizeof(XFadeVulkanContext),
448 .uninit = &uninit,
449 .activate = &activate,
453 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
454};
#define FADE(name, type)
Definition af_afade.c:185
const FFFilter ff_vf_xfade_vulkan
simple assert() macros that are a bit more flexible than ISO C assert().
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
Definition avf_concat.c:205
void ff_inlink_set_status(AVFilterLink *link, int status)
Set the status on an input link.
Definition avfilter.c:1632
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
Definition avfilter.c:1467
int ff_inlink_check_available_frame(AVFilterLink *link)
Test if a frame is available on the link.
Definition avfilter.c:1489
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
AVFrame * ff_inlink_peek_frame(AVFilterLink *link, size_t idx)
Access a frame in the link fifo without consuming it.
Definition avfilter.c:1561
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
Definition avfilter.c:229
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Definition avfilter.c:1520
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition avfilter.c:1623
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
#define av_clipf
Definition common.h:145
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static AVFrame * frame
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static int64_t duration
Definition ffplay.c:330
#define fail
Definition test.h:479
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition opt.h:318
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
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
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition avutil.h:247
#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)
unsigned offset
Definition libaomenc.c:763
#define FILTER_INPUTS(array)
Definition filters.h:264
#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
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
Definition filters.h:652
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
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:2070
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:2373
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
Definition vulkan.c:310
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:357
int ff_vk_shader_add_push_const(FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage)
Add/update push constants for execution.
Definition vulkan.c:1443
void ff_vk_uninit(FFVulkanContext *s)
Frees main context.
Definition vulkan.c:2638
void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
Free a shader.
Definition vulkan.c:2614
int ff_vk_shader_register_exec(FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd)
Register a shader with an exec pool.
Definition vulkan.c:2407
int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler, int unnorm_coords, VkFilter filt)
Create a sampler.
Definition vulkan.c:1454
AVVulkanDeviceQueueFamily * ff_vk_qf_find(FFVulkanContext *s, VkQueueFlagBits dev_family, VkVideoCodecOperationFlagBitsKHR vid_ops)
Chooses an appropriate QF.
Definition vulkan.c:297
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:2267
const char * desc
Definition libsvtav1.c:83
static const struct @257111027162314367033347246032313251342043035002 planes[]
uint8_t w
Definition llvidencdsp.c:39
AVOptions.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3500
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition pixfmt.h:379
uint8_t * data
The data buffer.
Definition buffer.h:90
An instance of a filter.
Definition avfilter.h:273
AVFilterLink ** inputs
array of pointers to input links
Definition avfilter.h:281
AVFilterPad * input_pads
array of input pads
Definition avfilter.h:280
void * priv
private data for use by the filter
Definition avfilter.h:288
AVFilterLink ** outputs
array of pointers to output links
Definition avfilter.h:285
A filter pad used for either input or output.
Definition filters.h:40
const char * name
Pad name.
Definition filters.h:46
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition frame.h:574
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
Definition frame.h:769
This struct describes a set or pool of "hardware" frames (i.e.
Definition hwcontext.h:118
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition hwcontext.h:213
AVOption.
Definition opt.h:428
int num
Numerator.
Definition rational.h:59
int den
Denominator.
Definition rational.h:60
const VkAllocationCallbacks * alloc
Custom memory allocator, else NULL.
VkDevice act_dev
Active device.
AVVulkanDeviceContext * hwctx
Definition vulkan.h:329
FFVulkanFunctions vkfn
Definition vulkan.h:294
FFVulkanContext vkctx
FFVulkanShader shd
AVVulkanDeviceQueueFamily * qf
#define av_log(a,...)
static int config_props_output(AVFilterLink *outlink)
XFadeTransitions
Definition vf_xfade.c:29
@ WIPELEFT
Definition vf_xfade.c:32
@ DISSOLVE
Definition vf_xfade.c:56
@ WIPETR
Definition vf_xfade.c:69
@ SLIDEUP
Definition vf_xfade.c:38
@ SLIDEDOWN
Definition vf_xfade.c:39
@ PIXELIZE
Definition vf_xfade.c:57
@ WIPEDOWN
Definition vf_xfade.c:35
@ WIPEBR
Definition vf_xfade.c:71
@ NB_TRANSITIONS
Definition vf_xfade.c:89
@ CIRCLECLOSE
Definition vf_xfade.c:51
@ WIPERIGHT
Definition vf_xfade.c:33
@ WIPEBL
Definition vf_xfade.c:70
@ SLIDELEFT
Definition vf_xfade.c:36
@ WIPETL
Definition vf_xfade.c:68
@ SLIDERIGHT
Definition vf_xfade.c:37
@ WIPEUP
Definition vf_xfade.c:34
@ CIRCLEOPEN
Definition vf_xfade.c:50
#define IN_NB
const unsigned int ff_xfade_comp_spv_len
static int activate(AVFilterContext *avctx)
static int xfade_frame(AVFilterContext *avctx, AVFrame *frame_a, AVFrame *frame_b)
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
#define IN_A
static int forward_frame(XFadeVulkanContext *s, AVFilterLink *inlink, AVFilterLink *outlink)
const unsigned char ff_xfade_comp_spv_data[]
#define IN_B
static const AVOption xfade_vulkan_options[]
static const AVFilterPad xfade_vulkan_outputs[]
static const AVFilterPad xfade_vulkan_inputs[]
static av_cold int init_vulkan(AVFilterContext *avctx)
static av_cold void uninit(AVFilterContext *avctx)
static int config_props_output(AVFilterLink *outlink)
#define OFFSET(x)
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
Definition video.c:44
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
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
Definition video.c:84
#define FF_VK_DEFAULT_EXEC_CONTEXTS
Definition vulkan.h:121
#define RET(x)
Definition vulkan.h:37
#define SPEC_LIST_ADD(name, idx, val_bits, val)
Definition vulkan.h:55
#define SPEC_LIST_CREATE(name, max_length, max_size)
Definition vulkan.h:45
#define DUP_SAMPLER(x)
Definition vulkan.h:73
int ff_vk_filter_config_input(AVFilterLink *inlink)
int ff_vk_filter_config_output(AVFilterLink *outlink)
int ff_vk_filter_process_Nin(FFVulkanContext *vkctx, FFVkExecPool *e, FFVulkanShader *shd, AVFrame *out, AVFrame *in[], int nb_in, VkSampler sampler, uint32_t wgc_z, void *push_src, size_t push_size)
Up to 16 inputs, one output.
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.