Data Structures | Macros | Functions | Variables
vf_avgblur_vulkan.c File Reference
#include "libavutil/random_seed.h"
#include "libavutil/opt.h"
#include "vulkan.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  AvgBlurVulkanContext


#define CGS   32
#define OFFSET(x)   offsetof(AvgBlurVulkanContext, x)


static av_cold int init_filter (AVFilterContext *ctx, AVFrame *in)
static int process_frames (AVFilterContext *avctx, AVFrame *out_f, AVFrame *tmp_f, AVFrame *in_f)
static int avgblur_vulkan_filter_frame (AVFilterLink *link, AVFrame *in)
static void avgblur_vulkan_uninit (AVFilterContext *avctx)
 AVFILTER_DEFINE_CLASS (avgblur_vulkan)


static const char blur_kernel []
static const AVOption avgblur_vulkan_options []
static const AVFilterPad avgblur_vulkan_inputs []
static const AVFilterPad avgblur_vulkan_outputs []
AVFilter ff_vf_avgblur_vulkan

Macro Definition Documentation

#define CGS   32

Definition at line 24 of file vf_avgblur_vulkan.c.

Referenced by init_filter(), and process_frames().

#define OFFSET (   x)    offsetof(AvgBlurVulkanContext, x)

Definition at line 371 of file vf_avgblur_vulkan.c.

Definition at line 372 of file vf_avgblur_vulkan.c.

Function Documentation

static av_cold int init_filter ( AVFilterContext ctx,
AVFrame in 

Definition at line 70 of file vf_avgblur_vulkan.c.

Referenced by avgblur_vulkan_filter_frame().

static int process_frames ( AVFilterContext avctx,
AVFrame out_f,
AVFrame tmp_f,
AVFrame in_f 

Definition at line 202 of file vf_avgblur_vulkan.c.

Referenced by avgblur_vulkan_filter_frame().

static int avgblur_vulkan_filter_frame ( AVFilterLink link,
AVFrame in 

Definition at line 321 of file vf_avgblur_vulkan.c.

static void avgblur_vulkan_uninit ( AVFilterContext avctx)

Definition at line 362 of file vf_avgblur_vulkan.c.

AVFILTER_DEFINE_CLASS ( avgblur_vulkan  )

Variable Documentation

const char blur_kernel[]
Initial value:
= {
C(0, shared vec4 cache[DIR(gl_WorkGroupSize) + FILTER_RADIUS*2 + 1]; )
C(0, )
C(0, void distort(const ivec2 pos, const int idx) )
C(0, { )
C(1, const uint cp = DIR(gl_LocalInvocationID) + FILTER_RADIUS; )
C(0, )
C(1, cache[cp] = texture(input_img[idx], pos); )
C(0, )
C(1, const ivec2 loc_l = pos - INC(FILTER_RADIUS); )
C(1, cache[cp - FILTER_RADIUS] = texture(input_img[idx], loc_l); )
C(0, )
C(1, const ivec2 loc_h = pos + INC(DIR(gl_WorkGroupSize)); )
C(1, cache[cp + DIR(gl_WorkGroupSize)] = texture(input_img[idx], loc_h); )
C(0, )
C(1, barrier(); )
C(0, )
C(1, vec4 sum = vec4(0); )
C(1, for (int p = -FILTER_RADIUS; p <= FILTER_RADIUS; p++) )
C(2, sum += cache[cp + p]; )
C(0, )
C(1, sum /= vec4(FILTER_RADIUS*2 + 1); )
C(1, imageStore(output_img[idx], pos, sum); )
C(0, } )
unsigned int pos
Definition: spdifenc.c:410
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
for(j=16;j >0;--j)

Definition at line 44 of file vf_avgblur_vulkan.c.

Referenced by init_filter().

const AVOption avgblur_vulkan_options[]
Initial value:
= {
{ "sizeX", "Set horizontal radius", OFFSET(size_x), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 32, .flags = FLAGS },
{ "planes", "Set planes to filter (bitmask)", OFFSET(planes), AV_OPT_TYPE_INT, {.i64 = 0xF}, 0, 0xF, .flags = FLAGS },
{ "sizeY", "Set vertical radius", OFFSET(size_y), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 32, .flags = FLAGS },
{ NULL },
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)
static const struct @315 planes[]

Definition at line 373 of file vf_avgblur_vulkan.c.

const AVFilterPad avgblur_vulkan_inputs[]
Initial value:
= {
.name = "default",
.filter_frame = &avgblur_vulkan_filter_frame,
.config_props = &ff_vk_filter_config_input,
{ NULL }
#define NULL
Definition: coverity.c:32
static int avgblur_vulkan_filter_frame(AVFilterLink *link, AVFrame *in)
int ff_vk_filter_config_input(AVFilterLink *inlink)
Definition: vulkan.c:635

Definition at line 382 of file vf_avgblur_vulkan.c.

const AVFilterPad avgblur_vulkan_outputs[]
Initial value:
= {
.name = "default",
.config_props = &ff_vk_filter_config_output,
{ NULL }
#define NULL
Definition: coverity.c:32
int ff_vk_filter_config_output(AVFilterLink *outlink)
Definition: vulkan.c:705

Definition at line 392 of file vf_avgblur_vulkan.c.

AVFilter ff_vf_avgblur_vulkan
Initial value:
= {
.name = "avgblur_vulkan",
.description = NULL_IF_CONFIG_SMALL("Apply avgblur mask to input video"),
.priv_size = sizeof(AvgBlurVulkanContext),
.priv_class = &avgblur_vulkan_class,
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:365
static const AVFilterPad avgblur_vulkan_outputs[]
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
int ff_vk_filter_init(AVFilterContext *avctx)
Definition: vulkan.c:756
int ff_vk_filter_query_formats(AVFilterContext *avctx)
General lavfi IO functions.
Definition: vulkan.c:592
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad avgblur_vulkan_inputs[]
static void avgblur_vulkan_uninit(AVFilterContext *avctx)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244

Definition at line 401 of file vf_avgblur_vulkan.c.