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

Go to the source code of this file.

Data Structures

struct  ChromaticAberrationVulkanContext


#define CGROUPS   (int [3]){ 32, 32, 1 }
#define OFFSET(x)   offsetof(ChromaticAberrationVulkanContext, x)


static av_cold int init_filter (AVFilterContext *ctx, AVFrame *in)
static int process_frames (AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f)
static int chromaber_vulkan_filter_frame (AVFilterLink *link, AVFrame *in)
static void chromaber_vulkan_uninit (AVFilterContext *avctx)
 AVFILTER_DEFINE_CLASS (chromaber_vulkan)


static const char distort_chroma_kernel []
static const AVOption chromaber_vulkan_options []
static const AVFilterPad chromaber_vulkan_inputs []
static const AVFilterPad chromaber_vulkan_outputs []
AVFilter ff_vf_chromaber_vulkan

Macro Definition Documentation

#define CGROUPS   (int [3]){ 32, 32, 1 }

Definition at line 23 of file vf_chromaber_vulkan.c.

Referenced by init_filter(), and process_frames().

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

Definition at line 306 of file vf_chromaber_vulkan.c.

Definition at line 307 of file vf_chromaber_vulkan.c.

Function Documentation

static av_cold int init_filter ( AVFilterContext ctx,
AVFrame in 

Definition at line 66 of file vf_chromaber_vulkan.c.

Referenced by chromaber_vulkan_filter_frame().

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

Definition at line 171 of file vf_chromaber_vulkan.c.

Referenced by chromaber_vulkan_filter_frame().

static int chromaber_vulkan_filter_frame ( AVFilterLink link,
AVFrame in 

Definition at line 265 of file vf_chromaber_vulkan.c.

static void chromaber_vulkan_uninit ( AVFilterContext avctx)

Definition at line 297 of file vf_chromaber_vulkan.c.

AVFILTER_DEFINE_CLASS ( chromaber_vulkan  )

Variable Documentation

const char distort_chroma_kernel[]
Initial value:
= {
C(0, void distort_rgb(ivec2 size, ivec2 pos) )
C(0, { )
C(1, const vec2 p = ((vec2(pos)/vec2(size)) - 0.5f)*2.0f; )
C(1, const vec2 o = p * (dist - 1.0f); )
C(0, )
C(1, vec4 res; )
C(1, res.r = texture(input_img[0], ((p - o)/2.0f) + 0.5f).r; )
C(1, res.g = texture(input_img[0], ((p )/2.0f) + 0.5f).g; )
C(1, res.b = texture(input_img[0], ((p + o)/2.0f) + 0.5f).b; )
C(1, res.a = texture(input_img[0], ((p )/2.0f) + 0.5f).a; )
C(1, imageStore(output_img[0], pos, res); )
C(0, } )
C(0, )
C(0, void distort_chroma(int idx, ivec2 size, ivec2 pos) )
C(0, { )
C(1, vec2 p = ((vec2(pos)/vec2(size)) - 0.5f)*2.0f; )
C(1, float d = sqrt(p.x*p.x + p.y*p.y); )
C(1, p *= d / (d* dist); )
C(1, vec4 res = texture(input_img[idx], (p/2.0f) + 0.5f); )
C(1, imageStore(output_img[idx], pos, res); )
C(0, } )
const char * g
Definition: vf_curves.c:115
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:36
#define f(width, name)
Definition: cbs_vp9.c:255
ptrdiff_t size
Definition: opengl_enc.c:100
const char * r
Definition: vf_curves.c:114
unsigned int pos
Definition: spdifenc.c:410
#define b
Definition: input.c:41
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

Definition at line 42 of file vf_chromaber_vulkan.c.

Referenced by init_filter().

const AVOption chromaber_vulkan_options[]
Initial value:
= {
{ "dist_x", "Set horizontal distortion amount", OFFSET(opts.dist[0]), AV_OPT_TYPE_FLOAT, {.dbl = 0.0f}, -10.0f, 10.0f, .flags = FLAGS },
{ "dist_y", "Set vertical distortion amount", OFFSET(opts.dist[1]), AV_OPT_TYPE_FLOAT, {.dbl = 0.0f}, -10.0f, 10.0f, .flags = FLAGS },
{ NULL },
#define NULL
Definition: coverity.c:32
AVDictionary * opts
Definition: movenc.c:50
#define OFFSET(x)
#define FLAGS

Definition at line 308 of file vf_chromaber_vulkan.c.

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

Definition at line 316 of file vf_chromaber_vulkan.c.

const AVFilterPad chromaber_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 326 of file vf_chromaber_vulkan.c.

AVFilter ff_vf_chromaber_vulkan
Initial value:
= {
.name = "chromaber_vulkan",
.description = NULL_IF_CONFIG_SMALL("Offset chroma of input video (chromatic aberration)"),
.priv_size = sizeof(ChromaticAberrationVulkanContext),
.priv_class = &chromaber_vulkan_class,
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:365
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 chromaber_vulkan_outputs[]
static const AVFilterPad chromaber_vulkan_inputs[]
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static void chromaber_vulkan_uninit(AVFilterContext *avctx)

Definition at line 335 of file vf_chromaber_vulkan.c.