FFmpeg
vf_bwdif_vulkan.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) Lynne
3  * Copyright (C) 2018 Philip Langdale <philipl@overt.org>
4  * Copyright (C) 2016 Thomas Mundt <loudmax@yahoo.de>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include "libavutil/random_seed.h"
24 #include "libavutil/opt.h"
25 #include "libavutil/vulkan_spirv.h"
26 #include "vulkan_filter.h"
27 #include "yadif.h"
28 #include "filters.h"
29 
30 typedef struct BWDIFVulkanContext {
33 
37  VkSampler sampler;
40 
41 typedef struct BWDIFParameters {
42  int parity;
43  int tff;
46 
47 extern const char *ff_source_bwdif_comp;
48 
50 {
51  int err;
52  uint8_t *spv_data;
53  size_t spv_len;
54  void *spv_opaque = NULL;
55  BWDIFVulkanContext *s = ctx->priv;
56  FFVulkanContext *vkctx = &s->vkctx;
57  const int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
58  FFVulkanShader *shd;
59  FFVkSPIRVCompiler *spv;
61 
62  spv = ff_vk_spirv_init();
63  if (!spv) {
64  av_log(ctx, AV_LOG_ERROR, "Unable to initialize SPIR-V compiler!\n");
65  return AVERROR_EXTERNAL;
66  }
67 
68  ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
69  RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
70  RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
71 
72  RET(ff_vk_shader_init(vkctx, &s->shd, "bwdif",
73  VK_SHADER_STAGE_COMPUTE_BIT,
74  NULL, 0,
75  1, 64, 1,
76  0));
77  shd = &s->shd;
78 
80  {
81  .name = "prev",
82  .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
83  .dimensions = 2,
84  .elems = planes,
85  .stages = VK_SHADER_STAGE_COMPUTE_BIT,
86  .samplers = DUP_SAMPLER(s->sampler),
87  },
88  {
89  .name = "cur",
90  .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
91  .dimensions = 2,
92  .elems = planes,
93  .stages = VK_SHADER_STAGE_COMPUTE_BIT,
94  .samplers = DUP_SAMPLER(s->sampler),
95  },
96  {
97  .name = "next",
98  .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
99  .dimensions = 2,
100  .elems = planes,
101  .stages = VK_SHADER_STAGE_COMPUTE_BIT,
102  .samplers = DUP_SAMPLER(s->sampler),
103  },
104  {
105  .name = "dst",
106  .type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
107  .mem_layout = ff_vk_shader_rep_fmt(s->vkctx.output_format, FF_VK_REP_FLOAT),
108  .mem_quali = "writeonly",
109  .dimensions = 2,
110  .elems = planes,
111  .stages = VK_SHADER_STAGE_COMPUTE_BIT,
112  },
113  };
114 
115  RET(ff_vk_shader_add_descriptor_set(vkctx, &s->shd, desc, 4, 0, 0));
116 
117  GLSLC(0, layout(push_constant, std430) uniform pushConstants { );
118  GLSLC(1, int parity; );
119  GLSLC(1, int tff; );
120  GLSLC(1, int current_field; );
121  GLSLC(0, }; );
122 
124  VK_SHADER_STAGE_COMPUTE_BIT);
125 
127  GLSLC(0, void main() );
128  GLSLC(0, { );
129  GLSLC(1, ivec2 size; );
130  GLSLC(1, const ivec2 pos = ivec2(gl_GlobalInvocationID.xy); );
131  GLSLC(1, bool filter_field = ((pos.y ^ parity) & 1) == 1; );
132  GLSLF(1, bool is_intra = filter_field && (current_field == %i); ,YADIF_FIELD_END);
133  GLSLC(1, bool field_parity = (parity ^ tff) != 0; );
134  GLSLC(0, );
135  GLSLC(1, size = imageSize(dst[0]); );
136  GLSLC(1, if (!IS_WITHIN(pos, size)) { );
137  GLSLC(2, return; );
138  GLSLC(1, } else if (is_intra) { );
139  for (int i = 0; i < planes; i++) {
140  if (i == 1) {
141  GLSLF(2, size = imageSize(dst[%i]); ,i);
142  GLSLC(2, if (!IS_WITHIN(pos, size)) );
143  GLSLC(3, return; );
144  }
145  GLSLF(2, process_plane_intra(%i, pos); ,i);
146  }
147  GLSLC(1, } else if (filter_field) { );
148  for (int i = 0; i < planes; i++) {
149  if (i == 1) {
150  GLSLF(2, size = imageSize(dst[%i]); ,i);
151  GLSLC(2, if (!IS_WITHIN(pos, size)) );
152  GLSLC(3, return; );
153  }
154  GLSLF(2, process_plane(%i, pos, filter_field, is_intra, field_parity); ,i);
155  }
156  GLSLC(1, } else { );
157  for (int i = 0; i < planes; i++) {
158  if (i == 1) {
159  GLSLF(2, size = imageSize(dst[%i]); ,i);
160  GLSLC(2, if (!IS_WITHIN(pos, size)) );
161  GLSLC(3, return; );
162  }
163  GLSLF(2, imageStore(dst[%i], pos, texture(cur[%i], pos)); ,i, i);
164  }
165  GLSLC(1, } );
166  GLSLC(0, } );
167 
168  RET(spv->compile_shader(vkctx, spv, &s->shd, &spv_data, &spv_len, "main",
169  &spv_opaque));
170  RET(ff_vk_shader_link(vkctx, &s->shd, spv_data, spv_len, "main"));
171 
172  RET(ff_vk_shader_register_exec(vkctx, &s->e, &s->shd));
173 
174  s->initialized = 1;
175 
176 fail:
177  if (spv_opaque)
178  spv->free_shader(spv, &spv_opaque);
179  if (spv)
180  spv->uninit(&spv);
181 
182  return err;
183 }
184 
186  int parity, int tff)
187 {
188  BWDIFVulkanContext *s = ctx->priv;
189  YADIFContext *y = &s->yadif;
190  BWDIFParameters params = {
191  .parity = parity,
192  .tff = tff,
193  .current_field = y->current_field,
194  };
195 
196  ff_vk_filter_process_Nin(&s->vkctx, &s->e, &s->shd, dst,
197  (AVFrame *[]){ y->prev, y->cur, y->next }, 3,
198  s->sampler, &params, sizeof(params));
199 
200  if (y->current_field == YADIF_FIELD_END)
202 }
203 
205 {
206  BWDIFVulkanContext *s = avctx->priv;
207  FFVulkanContext *vkctx = &s->vkctx;
208  FFVulkanFunctions *vk = &vkctx->vkfn;
209 
210  ff_vk_exec_pool_free(vkctx, &s->e);
211  ff_vk_shader_free(vkctx, &s->shd);
212 
213  if (s->sampler)
214  vk->DestroySampler(vkctx->hwctx->act_dev, s->sampler,
215  vkctx->hwctx->alloc);
216 
217  ff_vk_uninit(&s->vkctx);
218 
219  ff_yadif_uninit(avctx);
220 
221  s->initialized = 0;
222 }
223 
225 {
227  AVHWFramesContext *input_frames;
228  AVFilterContext *avctx = inlink->dst;
229  BWDIFVulkanContext *s = avctx->priv;
230  FFVulkanContext *vkctx = &s->vkctx;
231 
232  if (!l->hw_frames_ctx) {
233  av_log(inlink->dst, AV_LOG_ERROR, "Vulkan filtering requires a "
234  "hardware frames context on the input.\n");
235  return AVERROR(EINVAL);
236  }
237 
238  input_frames = (AVHWFramesContext *)l->hw_frames_ctx->data;
239  if (input_frames->format != AV_PIX_FMT_VULKAN)
240  return AVERROR(EINVAL);
241 
242  /* Extract the device and default output format from the first input. */
243  if (avctx->inputs[0] != inlink)
244  return 0;
245 
246  /* Save the ref, without reffing it */
247  vkctx->input_frames_ref = l->hw_frames_ctx;
248 
249  /* Defaults */
250  vkctx->output_format = input_frames->sw_format;
251  vkctx->output_width = inlink->w;
252  vkctx->output_height = inlink->h;
253 
254  return 0;
255 }
256 
258 {
259  FilterLink *l = ff_filter_link(outlink);
260  int err;
261  AVFilterContext *avctx = outlink->src;
262  BWDIFVulkanContext *s = avctx->priv;
263  YADIFContext *y = &s->yadif;
264  FFVulkanContext *vkctx = &s->vkctx;
265 
267 
268  err = ff_vk_filter_init_context(avctx, vkctx, vkctx->input_frames_ref,
269  vkctx->output_width, vkctx->output_height,
270  vkctx->output_format);
271  if (err < 0)
272  return err;
273 
274  /* For logging */
275  vkctx->class = y->class;
276 
278  if (!l->hw_frames_ctx)
279  return AVERROR(ENOMEM);
280 
281  err = ff_yadif_config_output_common(outlink);
282  if (err < 0)
283  return err;
284 
285  y->csp = av_pix_fmt_desc_get(vkctx->frames->sw_format);
287 
288  if (AV_CEIL_RSHIFT(outlink->w, y->csp->log2_chroma_w) < 4 || AV_CEIL_RSHIFT(outlink->h, y->csp->log2_chroma_h) < 4) {
289  av_log(avctx, AV_LOG_ERROR, "Video with planes less than 4 columns or lines is not supported\n");
290  return AVERROR(EINVAL);
291  }
292 
293  return init_filter(avctx);
294 }
295 
296 static const AVClass bwdif_vulkan_class = {
297  .class_name = "bwdif_vulkan",
298  .item_name = av_default_item_name,
299  .option = ff_yadif_options,
300  .version = LIBAVUTIL_VERSION_INT,
301  .category = AV_CLASS_CATEGORY_FILTER,
302 };
303 
305  {
306  .name = "default",
307  .type = AVMEDIA_TYPE_VIDEO,
308  .filter_frame = ff_yadif_filter_frame,
309  .config_props = &bwdif_vulkan_config_input,
310  },
311 };
312 
314  {
315  .name = "default",
316  .type = AVMEDIA_TYPE_VIDEO,
317  .request_frame = ff_yadif_request_frame,
318  .config_props = &bwdif_vulkan_config_output,
319  },
320 };
321 
323  .name = "bwdif_vulkan",
324  .description = NULL_IF_CONFIG_SMALL("Deinterlace Vulkan frames via bwdif"),
325  .priv_size = sizeof(BWDIFVulkanContext),
331  .priv_class = &bwdif_vulkan_class,
332  .flags = AVFILTER_FLAG_HWDEVICE |
334  .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
335 };
YADIFContext::class
const AVClass * class
Definition: yadif.h:52
FFVulkanContext::output_height
int output_height
Definition: vulkan.h:303
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
ff_vk_shader_free
void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
Free a shader.
Definition: vulkan.c:2529
ff_vk_shader_init
int ff_vk_shader_init(FFVulkanContext *s, FFVulkanShader *shd, const char *name, VkPipelineStageFlags stage, const char *extensions[], int nb_extensions, int lg_x, int lg_y, int lg_z, uint32_t required_subgroup_size)
Initialize a shader object, with a specific set of extensions, type+bind, local group size,...
Definition: vulkan.c:1680
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3170
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:90
RET
#define RET(x)
Definition: vulkan.h:67
AVHWFramesContext::format
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
Definition: hwcontext.h:197
ff_vf_bwdif_vulkan
const AVFilter ff_vf_bwdif_vulkan
Definition: vf_bwdif_vulkan.c:322
ff_vk_qf_init
int ff_vk_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, VkQueueFlagBits dev_family)
Chooses a QF and loads it into a context.
Definition: vulkan.c:228
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
YADIFContext::csp
const AVPixFmtDescriptor * csp
Definition: yadif.h:76
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
ff_vk_filter_init
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.
Definition: vulkan_filter.c:233
FFVulkanContext::class
const AVClass * class
Definition: vulkan.h:264
BWDIFParameters::current_field
int current_field
Definition: vf_bwdif_vulkan.c:44
ff_vk_uninit
void ff_vk_uninit(FFVulkanContext *s)
Frees main context.
Definition: vulkan.c:2568
FFVkSPIRVCompiler::uninit
void(* uninit)(struct FFVkSPIRVCompiler **ctx)
Definition: vulkan_spirv.h:32
av_buffer_ref
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:103
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
ff_source_bwdif_comp
const char * ff_source_bwdif_comp
BWDIFParameters::tff
int tff
Definition: vf_bwdif_vulkan.c:43
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3210
ff_yadif_config_output_common
int ff_yadif_config_output_common(AVFilterLink *outlink)
Definition: yadif_common.c:218
bwdif_vulkan_uninit
static void bwdif_vulkan_uninit(AVFilterContext *avctx)
Definition: vf_bwdif_vulkan.c:204
AVVulkanDeviceContext::alloc
const VkAllocationCallbacks * alloc
Custom memory allocator, else NULL.
Definition: hwcontext_vulkan.h:63
BWDIFVulkanContext::shd
FFVulkanShader shd
Definition: vf_bwdif_vulkan.c:38
AVFilterContext::priv
void * priv
private data for use by the filter
Definition: avfilter.h:472
fail
#define fail()
Definition: checkasm.h:188
vulkan_filter.h
ff_vk_filter_init_context
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.
Definition: vulkan_filter.c:25
ff_vk_shader_register_exec
int ff_vk_shader_register_exec(FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd)
Register a shader with an exec pool.
Definition: vulkan.c:2169
ff_vk_shader_add_descriptor_set
int ff_vk_shader_add_descriptor_set(FFVulkanContext *s, FFVulkanShader *shd, FFVulkanDescriptorSetBinding *desc, int nb, int singular, int print_to_shader_only)
Add descriptor to a shader.
Definition: vulkan.c:2044
FFVulkanContext::frames_ref
AVBufferRef * frames_ref
Definition: vulkan.h:294
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
GLSLC
#define GLSLC(N, S)
Definition: vulkan.h:44
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
av_cold
#define av_cold
Definition: attributes.h:90
main
int main
Definition: dovi_rpuenc.c:37
bwdif_vulkan_config_input
static int bwdif_vulkan_config_input(AVFilterLink *inlink)
Definition: vf_bwdif_vulkan.c:224
FFVulkanContext::output_width
int output_width
Definition: vulkan.h:302
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:60
filters.h
FF_VK_REP_FLOAT
@ FF_VK_REP_FLOAT
Definition: vulkan.h:367
ctx
AVFormatContext * ctx
Definition: movenc.c:49
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
GLSLD
#define GLSLD(D)
Definition: vulkan.h:59
ff_vk_exec_pool_free
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
Definition: vulkan.c:238
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
if
if(ret)
Definition: filter_design.txt:179
planes
static const struct @465 planes[]
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
ff_vk_shader_rep_fmt
const char * ff_vk_shader_rep_fmt(enum AVPixelFormat pix_fmt, enum FFVkShaderRepFormat rep_fmt)
Definition: vulkan.c:1291
BWDIFVulkanContext::initialized
int initialized
Definition: vf_bwdif_vulkan.c:34
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
AVHWFramesContext::sw_format
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition: hwcontext.h:210
av_buffer_unref
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition: buffer.c:139
DUP_SAMPLER
#define DUP_SAMPLER(x)
Definition: vulkan.h:73
AVFilterContext::inputs
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:465
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
ff_vk_exec_pool_init
int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *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:300
FFVulkanContext
Definition: vulkan.h:263
bwdif_vulkan_config_output
static int bwdif_vulkan_config_output(AVFilterLink *outlink)
Definition: vf_bwdif_vulkan.c:257
BWDIFParameters::parity
int parity
Definition: vf_bwdif_vulkan.c:42
ff_filter_link
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition: filters.h:197
AV_CLASS_CATEGORY_FILTER
@ AV_CLASS_CATEGORY_FILTER
Definition: log.h:36
FF_FILTER_FLAG_HWFRAME_AWARE
#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:206
ff_yadif_options
const AVOption ff_yadif_options[]
Definition: yadif_common.c:273
ff_vk_filter_process_Nin
int ff_vk_filter_process_Nin(FFVulkanContext *vkctx, FFVkExecPool *e, FFVulkanShader *shd, AVFrame *out, AVFrame *in[], int nb_in, VkSampler sampler, void *push_src, size_t push_size)
Up to 16 inputs, one output.
Definition: vulkan_filter.c:401
yadif.h
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
FFVulkanDescriptorSetBinding
Definition: vulkan.h:75
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
BWDIFVulkanContext::vkctx
FFVulkanContext vkctx
Definition: vf_bwdif_vulkan.c:32
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:173
size
int size
Definition: twinvq_data.h:10344
FFVkQueueFamilyCtx
Definition: vulkan.h:102
YADIFContext::filter
void(* filter)(AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff)
Definition: yadif.h:65
FFVulkanShader
Definition: vulkan.h:179
parity
mcdeint parity
Definition: vf_mcdeint.c:281
BWDIFVulkanContext::yadif
YADIFContext yadif
Definition: vf_bwdif_vulkan.c:31
FFVulkanContext::output_format
enum AVPixelFormat output_format
Definition: vulkan.h:304
FFVkSPIRVCompiler::compile_shader
int(* compile_shader)(FFVulkanContext *s, struct FFVkSPIRVCompiler *ctx, FFVulkanShader *shd, uint8_t **data, size_t *size, const char *entrypoint, void **opaque)
Definition: vulkan_spirv.h:28
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
FFVulkanContext::input_frames_ref
AVBufferRef * input_frames_ref
Definition: vulkan.h:293
FFVkSPIRVCompiler
Definition: vulkan_spirv.h:26
layout
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
Definition: filter_design.txt:18
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
BWDIFVulkanContext
Definition: vf_bwdif_vulkan.c:30
YADIFContext
Definition: yadif.h:51
ff_vk_shader_link
int ff_vk_shader_link(FFVulkanContext *s, FFVulkanShader *shd, uint8_t *spirv, size_t spirv_len, const char *entrypoint)
Link a shader into an executable.
Definition: vulkan.c:1969
vulkan_spirv.h
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
BWDIFVulkanContext::e
FFVkExecPool e
Definition: vf_bwdif_vulkan.c:35
FFVkSPIRVCompiler::free_shader
void(* free_shader)(struct FFVkSPIRVCompiler *ctx, void **opaque)
Definition: vulkan_spirv.h:31
AVFilter
Filter definition.
Definition: avfilter.h:201
AVHWFramesContext
This struct describes a set or pool of "hardware" frames (i.e.
Definition: hwcontext.h:115
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:80
FFVulkanContext::vkfn
FFVulkanFunctions vkfn
Definition: vulkan.h:267
FFVkExecPool
Definition: vulkan.h:241
pos
unsigned int pos
Definition: spdifenc.c:414
ff_vk_shader_add_push_const
int ff_vk_shader_add_push_const(FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage)
Add/update push constants for execution.
Definition: vulkan.c:1223
BWDIFVulkanContext::qf
FFVkQueueFamilyCtx qf
Definition: vf_bwdif_vulkan.c:36
bwdif_vulkan_class
static const AVClass bwdif_vulkan_class
Definition: vf_bwdif_vulkan.c:296
bwdif_vulkan_outputs
static const AVFilterPad bwdif_vulkan_outputs[]
Definition: vf_bwdif_vulkan.c:313
random_seed.h
YADIF_FIELD_END
@ YADIF_FIELD_END
The first or last field in a sequence.
Definition: yadif.h:47
GLSLF
#define GLSLF(N, S,...)
Definition: vulkan.h:54
ff_yadif_request_frame
int ff_yadif_request_frame(AVFilterLink *link)
Definition: yadif_common.c:184
bwdif_vulkan_inputs
static const AVFilterPad bwdif_vulkan_inputs[]
Definition: vf_bwdif_vulkan.c:304
AVFilterContext
An instance of a filter.
Definition: avfilter.h:457
YADIF_FIELD_NORMAL
@ YADIF_FIELD_NORMAL
A normal field in the middle of a sequence.
Definition: yadif.h:48
desc
const char * desc
Definition: libsvtav1.c:79
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FFVulkanContext::hwctx
AVVulkanDeviceContext * hwctx
Definition: vulkan.h:291
AVVulkanDeviceContext::act_dev
VkDevice act_dev
Active device.
Definition: hwcontext_vulkan.h:84
ff_yadif_uninit
void ff_yadif_uninit(AVFilterContext *ctx)
Definition: yadif_common.c:258
YADIFContext::current_field
int current_field
YADIFCurrentField.
Definition: yadif.h:88
ff_vk_init_sampler
int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler, int unnorm_coords, VkFilter filt)
Create a sampler.
Definition: vulkan.c:1244
bwdif_vulkan_filter_frame
static void bwdif_vulkan_filter_frame(AVFilterContext *ctx, AVFrame *dst, int parity, int tff)
Definition: vf_bwdif_vulkan.c:185
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:190
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
init_filter
static av_cold int init_filter(AVFilterContext *ctx)
Definition: vf_bwdif_vulkan.c:49
BWDIFParameters
Definition: vf_bwdif_vulkan.c:41
FFVulkanContext::frames
AVHWFramesContext * frames
Definition: vulkan.h:295
BWDIFVulkanContext::sampler
VkSampler sampler
Definition: vf_bwdif_vulkan.c:37
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:252
FFVulkanFunctions
Definition: vulkan_functions.h:263
AVPixFmtDescriptor::log2_chroma_h
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
ff_yadif_filter_frame
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: yadif_common.c:104