* [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit
2023-07-24 21:11 [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz
@ 2023-07-24 21:11 ` Marvin Scholz
2023-07-24 21:50 ` [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz
1 sibling, 0 replies; 4+ messages in thread
From: Marvin Scholz @ 2023-07-24 21:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marvin Scholz
---
libavfilter/vf_xfade_vulkan.c | 38 +++++++++++++++++------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c
index d044714199..4f26398410 100644
--- a/libavfilter/vf_xfade_vulkan.c
+++ b/libavfilter/vf_xfade_vulkan.c
@@ -218,17 +218,17 @@ static const char transition_circleclose[] = {
};
static const char* transitions_map[NB_TRANSITIONS] = {
- [FADE] = transition_fade,
- [WIPELEFT] = transition_wipeleft,
- [WIPERIGHT] = transition_wiperight,
- [WIPEUP] = transition_wipeup,
- [WIPEDOWN] = transition_wipedown,
- [SLIDEDOWN] = transition_slidedown,
- [SLIDEUP] = transition_slideup,
- [SLIDELEFT] = transition_slideleft,
- [SLIDERIGHT]= transition_slideright,
- [CIRCLEOPEN]= transition_circleopen,
- [CIRCLECLOSE]=transition_circleclose,
+ [FADE] = transition_fade,
+ [WIPELEFT] = transition_wipeleft,
+ [WIPERIGHT] = transition_wiperight,
+ [WIPEUP] = transition_wipeup,
+ [WIPEDOWN] = transition_wipedown,
+ [SLIDEDOWN] = transition_slidedown,
+ [SLIDEUP] = transition_slideup,
+ [SLIDELEFT] = transition_slideleft,
+ [SLIDERIGHT] = transition_slideright,
+ [CIRCLEOPEN] = transition_circleopen,
+ [CIRCLECLOSE] = transition_circleclose,
};
static av_cold int init_vulkan(AVFilterContext *avctx)
@@ -570,17 +570,17 @@ static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
static const AVOption xfade_vulkan_options[] = {
{ "transition", "set cross fade transition", OFFSET(transition), AV_OPT_TYPE_INT, {.i64=FADE}, 0, NB_TRANSITIONS-1, FLAGS, "transition" },
- { "fade", "fade transition", 0, AV_OPT_TYPE_CONST, {.i64=FADE}, 0, 0, FLAGS, "transition" },
- { "wipeleft", "wipe left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPELEFT}, 0, 0, FLAGS, "transition" },
+ { "fade", "fade transition", 0, AV_OPT_TYPE_CONST, {.i64=FADE}, 0, 0, FLAGS, "transition" },
+ { "wipeleft", "wipe left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPELEFT}, 0, 0, FLAGS, "transition" },
{ "wiperight", "wipe right transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPERIGHT}, 0, 0, FLAGS, "transition" },
- { "wipeup", "wipe up transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEUP}, 0, 0, FLAGS, "transition" },
- { "wipedown", "wipe down transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEDOWN}, 0, 0, FLAGS, "transition" },
+ { "wipeup", "wipe up transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEUP}, 0, 0, FLAGS, "transition" },
+ { "wipedown", "wipe down transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEDOWN}, 0, 0, FLAGS, "transition" },
{ "slidedown", "slide down transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDEDOWN}, 0, 0, FLAGS, "transition" },
- { "slideup", "slide up transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDEUP}, 0, 0, FLAGS, "transition" },
+ { "slideup", "slide up transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDEUP}, 0, 0, FLAGS, "transition" },
{ "slideleft", "slide left transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDELEFT}, 0, 0, FLAGS, "transition" },
- { "slideright","slide right transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDERIGHT}, 0, 0, FLAGS, "transition" },
- { "circleopen","circleopen transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLEOPEN}, 0, 0, FLAGS, "transition" },
- { "circleclose","circleclose transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLECLOSE}, 0, 0, FLAGS, "transition" },
+ { "slideright", "slide right transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDERIGHT}, 0, 0, FLAGS, "transition" },
+ { "circleopen", "circleopen transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLEOPEN}, 0, 0, FLAGS, "transition" },
+ { "circleclose", "circleclose transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLECLOSE}, 0, 0, FLAGS, "transition" },
{ "duration", "set cross fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=1000000}, 0, 60000000, FLAGS },
{ "offset", "set cross fade start relative to first input stream", OFFSET(offset), AV_OPT_TYPE_DURATION, {.i64=0}, INT64_MIN, INT64_MAX, FLAGS },
{ NULL }
--
2.39.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose
2023-07-24 21:11 [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz
2023-07-24 21:11 ` [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz
@ 2023-07-24 21:50 ` Marvin Scholz
1 sibling, 0 replies; 4+ messages in thread
From: Marvin Scholz @ 2023-07-24 21:50 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marvin Scholz
On 24 Jul 2023, at 23:11, Marvin Scholz wrote:
> ---
> libavfilter/vf_xfade_vulkan.c | 43 +++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c
> index 8825717890..d044714199 100644
> --- a/libavfilter/vf_xfade_vulkan.c
> +++ b/libavfilter/vf_xfade_vulkan.c
> @@ -76,6 +76,8 @@ enum XFadeTransitions {
> SLIDEUP,
> SLIDELEFT,
> SLIDERIGHT,
> + CIRCLEOPEN,
> + CIRCLECLOSE,
> NB_TRANSITIONS,
> };
>
> @@ -178,6 +180,43 @@ static const char transition_slideright[] = {
> C(0, } )
> };
>
> +#define SHADER_HYPOT_FUNC \
> + C(0, float hypot(ivec2 v) { ) \
> + C(1, ivec2 sqr = v * v; ) \
> + C(1, return sqrt(sqr.x + sqr.y); ) \
> + C(0, } )
> +
> +#define SHADER_CIRCLE_COMMON \
> + SHADER_HYPOT_FUNC \
> + 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 = hypot(half_size); ) \
> + C(1, float p = ((open ? (1.0 - progress) : progress) - 0.5) * 3.0; ) \
> + C(1, float sm = hypot(pos - half_size) / 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, \
> + mix(open ? b : a, open ? a : b, \
> + smoothstep(0.f, 1.f, sm))); ) \
> + C(0, } )
> +
> +static const char transition_circleopen[] = {
> + SHADER_CIRCLE_COMMON
> + C(0, void transition(int idx, ivec2 pos, float progress) )
> + C(0, { )
> + C(1, circle(idx, pos, progress, true); )
> + C(0, } )
> +};
> +
> +static const char transition_circleclose[] = {
> + SHADER_CIRCLE_COMMON
> + C(0, void transition(int idx, ivec2 pos, float progress) )
> + C(0, { )
> + C(1, circle(idx, pos, progress, false); )
> + C(0, } )
> +};
> +
> static const char* transitions_map[NB_TRANSITIONS] = {
> [FADE] = transition_fade,
> [WIPELEFT] = transition_wipeleft,
> @@ -188,6 +227,8 @@ static const char* transitions_map[NB_TRANSITIONS] = {
> [SLIDEUP] = transition_slideup,
> [SLIDELEFT] = transition_slideleft,
> [SLIDERIGHT]= transition_slideright,
> + [CIRCLEOPEN]= transition_circleopen,
> + [CIRCLECLOSE]=transition_circleclose,
> };
>
> static av_cold int init_vulkan(AVFilterContext *avctx)
> @@ -538,6 +579,8 @@ static const AVOption xfade_vulkan_options[] = {
> { "slideup", "slide up transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDEUP}, 0, 0, FLAGS, "transition" },
> { "slideleft", "slide left transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDELEFT}, 0, 0, FLAGS, "transition" },
> { "slideright","slide right transition", 0, AV_OPT_TYPE_CONST, {.i64=SLIDERIGHT}, 0, 0, FLAGS, "transition" },
> + { "circleopen","circleopen transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLEOPEN}, 0, 0, FLAGS, "transition" },
> + { "circleclose","circleclose transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLECLOSE}, 0, 0, FLAGS, "transition" },
> { "duration", "set cross fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=1000000}, 0, 60000000, FLAGS },
> { "offset", "set cross fade start relative to first input stream", OFFSET(offset), AV_OPT_TYPE_DURATION, {.i64=0}, INT64_MIN, INT64_MAX, FLAGS },
> { NULL }
> --
> 2.39.2
Please ignore this set, I've posted an update but messed up using git send-email
properly so it is not marked v2 and the in-reply-to header is messed up, hence
not being threaded properly here…
Sorry for the noise.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread