Go to the source code of this file.
|
enum | XFadeTransitions {
CUSTOM = -1,
FADE,
WIPELEFT,
WIPERIGHT,
WIPEUP,
WIPEDOWN,
SLIDELEFT,
SLIDERIGHT,
SLIDEUP,
SLIDEDOWN,
CIRCLECROP,
RECTCROP,
DISTANCE,
FADEBLACK,
FADEWHITE,
RADIAL,
SMOOTHLEFT,
SMOOTHRIGHT,
SMOOTHUP,
SMOOTHDOWN,
CIRCLEOPEN,
CIRCLECLOSE,
VERTOPEN,
VERTCLOSE,
HORZOPEN,
HORZCLOSE,
DISSOLVE,
PIXELIZE,
DIAGTL,
DIAGTR,
DIAGBL,
DIAGBR,
HLSLICE,
HRSLICE,
VUSLICE,
VDSLICE,
HBLUR,
FADEGRAYS,
WIPETL,
WIPETR,
WIPEBL,
WIPEBR,
SQUEEZEH,
SQUEEZEV,
ZOOMIN,
FADEFAST,
FADESLOW,
HLWIND,
HRWIND,
VUWIND,
VDWIND,
COVERLEFT,
COVERRIGHT,
COVERUP,
COVERDOWN,
REVEALLEFT,
REVEALRIGHT,
REVEALUP,
REVEALDOWN,
NB_TRANSITIONS,
CUSTOM,
FADE,
WIPELEFT,
WIPERIGHT,
WIPEUP,
WIPEDOWN,
SLIDELEFT,
SLIDERIGHT,
SLIDEUP,
SLIDEDOWN,
NB_TRANSITIONS,
FADE,
WIPELEFT,
WIPERIGHT,
WIPEUP,
WIPEDOWN,
SLIDEDOWN,
SLIDEUP,
SLIDELEFT,
SLIDERIGHT,
CIRCLEOPEN,
CIRCLECLOSE,
DISSOLVE,
PIXELIZE,
WIPETL,
WIPETR,
WIPEBL,
WIPEBR,
NB_TRANSITIONS
} |
|
◆ IN_A
◆ IN_B
◆ IN_NB
◆ SHADER_SLIDE_COMMON
#define SHADER_SLIDE_COMMON |
Value: C(0,
void slide(
int idx, ivec2
pos,
float progress, ivec2 direction) ) \
C(0, { ) \
C(1, ivec2
size = imageSize(output_images[idx]); ) \
C(1, ivec2 pi = ivec2(progress *
size); ) \
C(1, ivec2 p =
pos + pi * direction; ) \
C(1,
f =
f +
size * ivec2(
f.x < 0,
f.y < 0); ) \
C(1, vec4
a = texture(a_images[idx],
f); ) \
C(1, vec4
b = texture(b_images[idx],
f); ) \
C(1, vec4
r = (p.y >= 0 && p.x >= 0 &&
size.y > p.y &&
size.x > p.x) ?
a :
b; ) \
C(1, imageStore(output_images[idx],
pos,
r); ) \
Definition at line 144 of file vf_xfade_vulkan.c.
◆ SHADER_CIRCLE_COMMON
#define SHADER_CIRCLE_COMMON |
Value: C(0,
void circle(
int idx, ivec2
pos,
float progress,
bool open) ) \
C(0, { ) \
C(1,
const ivec2 half_size = imageSize(output_images[idx]) / 2; ) \
C(1,
const float z = dot(half_size, half_size); ) \
C(1,
float p = ((open ? (1.0 - progress) : progress) - 0.5) * 3.0; ) \
C(1, ivec2 dsize =
pos - half_size; ) \
C(1,
float sm = dot(dsize, dsize) / z + p; ) \
C(1, vec4
a = texture(a_images[idx],
pos); ) \
C(1, vec4
b = texture(b_images[idx],
pos); ) \
C(1, imageStore(output_images[idx],
pos, \
Definition at line 190 of file vf_xfade_vulkan.c.
◆ SHADER_FRAND_FUNC
#define SHADER_FRAND_FUNC |
Value:
C(0, { ) \
C(1,
return fract(sin(dot(v, vec2(12.9898, 78.233))) * 43758.545); ) \
Definition at line 221 of file vf_xfade_vulkan.c.
◆ OFFSET
◆ FLAGS
◆ XFadeTransitions
Enumerator |
---|
CUSTOM | |
FADE | |
WIPELEFT | |
WIPERIGHT | |
WIPEUP | |
WIPEDOWN | |
SLIDELEFT | |
SLIDERIGHT | |
SLIDEUP | |
SLIDEDOWN | |
CIRCLECROP | |
RECTCROP | |
DISTANCE | |
FADEBLACK | |
FADEWHITE | |
RADIAL | |
SMOOTHLEFT | |
SMOOTHRIGHT | |
SMOOTHUP | |
SMOOTHDOWN | |
CIRCLEOPEN | |
CIRCLECLOSE | |
VERTOPEN | |
VERTCLOSE | |
HORZOPEN | |
HORZCLOSE | |
DISSOLVE | |
PIXELIZE | |
DIAGTL | |
DIAGTR | |
DIAGBL | |
DIAGBR | |
HLSLICE | |
HRSLICE | |
VUSLICE | |
VDSLICE | |
HBLUR | |
FADEGRAYS | |
WIPETL | |
WIPETR | |
WIPEBL | |
WIPEBR | |
SQUEEZEH | |
SQUEEZEV | |
ZOOMIN | |
FADEFAST | |
FADESLOW | |
HLWIND | |
HRWIND | |
VUWIND | |
VDWIND | |
COVERLEFT | |
COVERRIGHT | |
COVERUP | |
COVERDOWN | |
REVEALLEFT | |
REVEALRIGHT | |
REVEALUP | |
REVEALDOWN | |
NB_TRANSITIONS | |
CUSTOM | |
FADE | |
WIPELEFT | |
WIPERIGHT | |
WIPEUP | |
WIPEDOWN | |
SLIDELEFT | |
SLIDERIGHT | |
SLIDEUP | |
SLIDEDOWN | |
NB_TRANSITIONS | |
FADE | |
WIPELEFT | |
WIPERIGHT | |
WIPEUP | |
WIPEDOWN | |
SLIDEDOWN | |
SLIDEUP | |
SLIDELEFT | |
SLIDERIGHT | |
CIRCLEOPEN | |
CIRCLECLOSE | |
DISSOLVE | |
PIXELIZE | |
WIPETL | |
WIPETR | |
WIPEBL | |
WIPEBR | |
NB_TRANSITIONS | |
Definition at line 70 of file vf_xfade_vulkan.c.
◆ init_vulkan()
◆ xfade_frame()
◆ config_props_output()
◆ forward_frame()
◆ activate()
◆ uninit()
◆ get_video_buffer()
◆ AVFILTER_DEFINE_CLASS()
AVFILTER_DEFINE_CLASS |
( |
xfade_vulkan |
| ) |
|
◆ transition_fade
const char transition_fade[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos,
mix(
a,
b, progress)); )
}
Definition at line 91 of file vf_xfade_vulkan.c.
◆ transition_wipeleft
const char transition_wipeleft[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
int s =
int(
size.x * (1.0 - progress)); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos,
pos.x >
s ?
b :
a); )
}
Definition at line 100 of file vf_xfade_vulkan.c.
◆ transition_wiperight
const char transition_wiperight[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
int s =
int(
size.x * progress); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos,
pos.x >
s ?
a :
b); )
}
Definition at line 111 of file vf_xfade_vulkan.c.
◆ transition_wipeup
const char transition_wipeup[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
int s =
int(
size.y * (1.0 - progress)); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos,
pos.y >
s ?
b :
a); )
}
Definition at line 122 of file vf_xfade_vulkan.c.
◆ transition_wipedown
const char transition_wipedown[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
int s =
int(
size.y * progress); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos,
pos.y >
s ?
a :
b); )
}
Definition at line 133 of file vf_xfade_vulkan.c.
◆ transition_slidedown
const char transition_slidedown[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, slide(idx,
pos, progress, ivec2(0, -1)); )
}
Definition at line 158 of file vf_xfade_vulkan.c.
◆ transition_slideup
const char transition_slideup[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, slide(idx,
pos, progress, ivec2(0, +1)); )
}
Definition at line 166 of file vf_xfade_vulkan.c.
◆ transition_slideleft
const char transition_slideleft[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, slide(idx,
pos, progress, ivec2(+1, 0)); )
}
Definition at line 174 of file vf_xfade_vulkan.c.
◆ transition_slideright
const char transition_slideright[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, slide(idx,
pos, progress, ivec2(-1, 0)); )
}
Definition at line 182 of file vf_xfade_vulkan.c.
◆ transition_circleopen
const char transition_circleopen[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, circle(idx,
pos, progress,
true); )
}
Definition at line 205 of file vf_xfade_vulkan.c.
◆ transition_circleclose
const char transition_circleclose[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, circle(idx,
pos, progress,
false); )
}
Definition at line 213 of file vf_xfade_vulkan.c.
◆ transition_dissolve
const char transition_dissolve[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1,
float sm =
frand(
pos) * 2.0 + (1.0 - progress) * 2.0 - 1.5; )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos, sm >= 0.5 ?
a :
b); )
}
Definition at line 227 of file vf_xfade_vulkan.c.
◆ transition_pixelize
const char transition_pixelize[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
float d =
min(progress, 1.0 - progress); )
C(1,
float dist =
ceil(
d * 50.0) / 50.0; )
C(1, vec4
a = texture(a_images[idx], vec2(sx, sy)); )
C(1, vec4
b = texture(b_images[idx], vec2(sx, sy)); )
C(1, imageStore(output_images[idx],
pos,
mix(
a,
b, progress)); )
}
Definition at line 238 of file vf_xfade_vulkan.c.
◆ transition_wipetl
const char transition_wipetl[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
float zw =
size.x * (1.0 - progress); )
C(1,
float zh =
size.y * (1.0 - progress); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos, (
pos.y <= zh &&
pos.x <= zw) ?
a :
b); )
}
Definition at line 253 of file vf_xfade_vulkan.c.
◆ transition_wipetr
const char transition_wipetr[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
float zw =
size.x * (progress); )
C(1,
float zh =
size.y * (1.0 - progress); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos, (
pos.y <= zh &&
pos.x > zw) ?
a :
b); )
}
Definition at line 265 of file vf_xfade_vulkan.c.
◆ transition_wipebl
const char transition_wipebl[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
float zw =
size.x * (1.0 - progress); )
C(1,
float zh =
size.y * (progress); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos, (
pos.y > zh &&
pos.x <= zw) ?
a :
b); )
}
Definition at line 277 of file vf_xfade_vulkan.c.
◆ transition_wipebr
const char transition_wipebr[] |
|
static |
Initial value:= {
C(0,
void transition(
int idx, ivec2
pos,
float progress) )
C(1, ivec2
size = imageSize(output_images[idx]); )
C(1,
float zw =
size.x * (progress); )
C(1,
float zh =
size.y * (progress); )
C(1, vec4
a = texture(a_images[idx],
pos); )
C(1, vec4
b = texture(b_images[idx],
pos); )
C(1, imageStore(output_images[idx],
pos, (
pos.y > zh &&
pos.x > zw) ?
a :
b); )
}
Definition at line 289 of file vf_xfade_vulkan.c.
◆ transitions_map
◆ xfade_vulkan_options
◆ xfade_vulkan_inputs
Initial value:= {
{
.name = "main",
},
{
.name = "xfade",
},
}
Definition at line 684 of file vf_xfade_vulkan.c.
◆ xfade_vulkan_outputs
◆ ff_vf_xfade_vulkan
Initial value:= {
.name = "xfade_vulkan",
.priv_class = &xfade_vulkan_class,
}
Definition at line 707 of file vf_xfade_vulkan.c.
static int mix(int c0, int c1)
static const char transition_dissolve[]
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
static const char transition_wipeup[]
static const char transition_slideup[]
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.
static float frand(int x, int y)
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
static const char transition_wiperight[]
static const char transition_wipebl[]
static const char transition_wipebr[]
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
static const char transition_slideleft[]
#define SHADER_FRAND_FUNC
static const char transition_circleclose[]
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
static __device__ float ceil(float a)
static __device__ float floor(float a)
static float smoothstep(float edge0, float edge1, float x)
static const char transition_wipedown[]
#define FILTER_INPUTS(array)
static const char transition_pixelize[]
static int activate(AVFilterContext *avctx)
static const char transition_circleopen[]
static const char transition_wipetl[]
static const char transition_fade[]
static const AVFilterPad xfade_vulkan_outputs[]
int(* init)(AVBSFContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
#define SHADER_CIRCLE_COMMON
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
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
static const AVFilterPad xfade_vulkan_inputs[]
static float fract(float a)
#define SHADER_SLIDE_COMMON
static const char transition_slideright[]
static int config_props_output(AVFilterLink *outlink)
static const char transition_wipetr[]
int ff_vk_filter_config_input(AVFilterLink *inlink)
#define FILTER_OUTPUTS(array)
static const char transition_wipeleft[]
static const char transition_slidedown[]
static av_cold void uninit(AVFilterContext *avctx)