* [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose [not found] <20230724211107.40025-2-epirat07@gmail.com%3Emessage://%3C20230724211107.40025-1-epirat07@gmail.com> @ 2023-07-24 21:47 ` Marvin Scholz 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Marvin Scholz @ 2023-07-24 21:47 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marvin Scholz --- libavfilter/vf_xfade_vulkan.c | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c index 8825717890..c3b08b52f5 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,37 @@ static const char transition_slideright[] = { C(0, } ) }; +#define SHADER_CIRCLE_COMMON \ + 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, \ + 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 +221,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 +573,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 _______________________________________________ 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz @ 2023-07-24 21:47 ` Marvin Scholz 2023-07-24 22:39 ` [FFmpeg-devel] [PATCH 3/3] lavfi/vf_xfade_vulkan: add dissolve Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2 siblings, 0 replies; 9+ messages in thread From: Marvin Scholz @ 2023-07-24 21:47 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 c3b08b52f5..faa19a0518 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -212,17 +212,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) @@ -564,17 +564,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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavfi/vf_xfade_vulkan: add dissolve 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz @ 2023-07-24 22:39 ` Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2 siblings, 0 replies; 9+ messages in thread From: Marvin Scholz @ 2023-07-24 22:39 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marvin Scholz --- libavfilter/vf_xfade_vulkan.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c index faa19a0518..0409d6bdb1 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -78,6 +78,7 @@ enum XFadeTransitions { SLIDERIGHT, CIRCLEOPEN, CIRCLECLOSE, + DISSOLVE, NB_TRANSITIONS, }; @@ -211,6 +212,23 @@ static const char transition_circleclose[] = { C(0, } ) }; +#define SHADER_FRAND_FUNC \ + C(0, float frand(vec2 v) ) \ + C(0, { ) \ + C(1, return fract(sin(dot(v, vec2(12.9898, 78.233))) * 43758.545); ) \ + C(0, } ) + +static const char transition_dissolve[] = { + SHADER_FRAND_FUNC + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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); ) + C(0, } ) +}; + static const char* transitions_map[NB_TRANSITIONS] = { [FADE] = transition_fade, [WIPELEFT] = transition_wipeleft, @@ -223,6 +241,7 @@ static const char* transitions_map[NB_TRANSITIONS] = { [SLIDERIGHT] = transition_slideright, [CIRCLEOPEN] = transition_circleopen, [CIRCLECLOSE] = transition_circleclose, + [DISSOLVE] = transition_dissolve, }; static av_cold int init_vulkan(AVFilterContext *avctx) @@ -575,6 +594,7 @@ static const AVOption xfade_vulkan_options[] = { { "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" }, + { "dissolve", "dissolve transition", 0, AV_OPT_TYPE_CONST, {.i64=DISSOLVE}, 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz 2023-07-24 22:39 ` [FFmpeg-devel] [PATCH 3/3] lavfi/vf_xfade_vulkan: add dissolve Marvin Scholz @ 2023-08-21 20:45 ` Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 2/5] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz ` (3 more replies) 2 siblings, 4 replies; 9+ messages in thread From: Marvin Scholz @ 2023-08-21 20:45 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marvin Scholz --- libavfilter/vf_xfade_vulkan.c | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c index f393dde202..23c61bdb48 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -77,6 +77,8 @@ enum XFadeTransitions { SLIDEUP, SLIDELEFT, SLIDERIGHT, + CIRCLEOPEN, + CIRCLECLOSE, NB_TRANSITIONS, }; @@ -179,6 +181,37 @@ static const char transition_slideright[] = { C(0, } ) }; +#define SHADER_CIRCLE_COMMON \ + 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, \ + 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, @@ -189,6 +222,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) @@ -539,6 +574,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.37.0 (Apple Git-136) _______________________________________________ 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH v3 2/5] lavfi/vf_xfade_vulkan: reindent after last commit 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz @ 2023-08-21 20:45 ` Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 3/5] lavfi/vf_xfade_vulkan: add dissolve Marvin Scholz ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: Marvin Scholz @ 2023-08-21 20:45 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 23c61bdb48..880b3b1afe 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -213,17 +213,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) @@ -565,17 +565,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.37.0 (Apple Git-136) _______________________________________________ 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH v3 3/5] lavfi/vf_xfade_vulkan: add dissolve 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 2/5] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz @ 2023-08-21 20:45 ` Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 4/5] lavfi/vf_xfade_vulkan: add pixelize Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 5/5] lavfi/vf_xfade_vulkan: add wipes Marvin Scholz 3 siblings, 0 replies; 9+ messages in thread From: Marvin Scholz @ 2023-08-21 20:45 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marvin Scholz --- libavfilter/vf_xfade_vulkan.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c index 880b3b1afe..61111f932d 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -79,6 +79,7 @@ enum XFadeTransitions { SLIDERIGHT, CIRCLEOPEN, CIRCLECLOSE, + DISSOLVE, NB_TRANSITIONS, }; @@ -212,6 +213,23 @@ static const char transition_circleclose[] = { C(0, } ) }; +#define SHADER_FRAND_FUNC \ + C(0, float frand(vec2 v) ) \ + C(0, { ) \ + C(1, return fract(sin(dot(v, vec2(12.9898, 78.233))) * 43758.545); ) \ + C(0, } ) + +static const char transition_dissolve[] = { + SHADER_FRAND_FUNC + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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); ) + C(0, } ) +}; + static const char* transitions_map[NB_TRANSITIONS] = { [FADE] = transition_fade, [WIPELEFT] = transition_wipeleft, @@ -224,6 +242,7 @@ static const char* transitions_map[NB_TRANSITIONS] = { [SLIDERIGHT] = transition_slideright, [CIRCLEOPEN] = transition_circleopen, [CIRCLECLOSE] = transition_circleclose, + [DISSOLVE] = transition_dissolve, }; static av_cold int init_vulkan(AVFilterContext *avctx) @@ -576,6 +595,7 @@ static const AVOption xfade_vulkan_options[] = { { "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" }, + { "dissolve", "dissolve transition", 0, AV_OPT_TYPE_CONST, {.i64=DISSOLVE}, 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.37.0 (Apple Git-136) _______________________________________________ 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH v3 4/5] lavfi/vf_xfade_vulkan: add pixelize 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 2/5] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 3/5] lavfi/vf_xfade_vulkan: add dissolve Marvin Scholz @ 2023-08-21 20:45 ` Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 5/5] lavfi/vf_xfade_vulkan: add wipes Marvin Scholz 3 siblings, 0 replies; 9+ messages in thread From: Marvin Scholz @ 2023-08-21 20:45 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marvin Scholz --- libavfilter/vf_xfade_vulkan.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c index 61111f932d..283a8e0710 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -80,6 +80,7 @@ enum XFadeTransitions { CIRCLEOPEN, CIRCLECLOSE, DISSOLVE, + PIXELIZE, NB_TRANSITIONS, }; @@ -230,6 +231,21 @@ static const char transition_dissolve[] = { C(0, } ) }; +static const char transition_pixelize[] = { + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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, float sq = 2.0 * dist * min(size.x, size.y) / 20.0; ) + C(1, float sx = dist > 0.0 ? min((floor(pos.x / sq) + 0.5) * sq, size.x - 1) : pos.x; ) + C(1, float sy = dist > 0.0 ? min((floor(pos.y / sq) + 0.5) * sq, size.y - 1) : pos.y; ) + 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)); ) + C(0, } ) +}; + static const char* transitions_map[NB_TRANSITIONS] = { [FADE] = transition_fade, [WIPELEFT] = transition_wipeleft, @@ -243,6 +259,7 @@ static const char* transitions_map[NB_TRANSITIONS] = { [CIRCLEOPEN] = transition_circleopen, [CIRCLECLOSE] = transition_circleclose, [DISSOLVE] = transition_dissolve, + [PIXELIZE] = transition_pixelize, }; static av_cold int init_vulkan(AVFilterContext *avctx) @@ -596,6 +613,7 @@ static const AVOption xfade_vulkan_options[] = { { "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" }, { "dissolve", "dissolve transition", 0, AV_OPT_TYPE_CONST, {.i64=DISSOLVE}, 0, 0, FLAGS, "transition" }, + { "pixelize", "pixelize transition", 0, AV_OPT_TYPE_CONST, {.i64=PIXELIZE}, 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.37.0 (Apple Git-136) _______________________________________________ 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH v3 5/5] lavfi/vf_xfade_vulkan: add wipes 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz ` (2 preceding siblings ...) 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 4/5] lavfi/vf_xfade_vulkan: add pixelize Marvin Scholz @ 2023-08-21 20:45 ` Marvin Scholz 2023-08-25 3:01 ` Lynne 3 siblings, 1 reply; 9+ messages in thread From: Marvin Scholz @ 2023-08-21 20:45 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marvin Scholz Add the wipetl, wipetr, wipebl, wipebr effects. --- libavfilter/vf_xfade_vulkan.c | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/libavfilter/vf_xfade_vulkan.c b/libavfilter/vf_xfade_vulkan.c index 283a8e0710..fdad8c913d 100644 --- a/libavfilter/vf_xfade_vulkan.c +++ b/libavfilter/vf_xfade_vulkan.c @@ -81,6 +81,10 @@ enum XFadeTransitions { CIRCLECLOSE, DISSOLVE, PIXELIZE, + WIPETL, + WIPETR, + WIPEBL, + WIPEBR, NB_TRANSITIONS, }; @@ -246,6 +250,54 @@ static const char transition_pixelize[] = { C(0, } ) }; +static const char transition_wipetl[] = { + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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); ) + C(0, } ) +}; + +static const char transition_wipetr[] = { + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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); ) + C(0, } ) +}; + +static const char transition_wipebl[] = { + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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); ) + C(0, } ) +}; + +static const char transition_wipebr[] = { + C(0, void transition(int idx, ivec2 pos, float progress) ) + C(0, { ) + 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); ) + C(0, } ) +}; + static const char* transitions_map[NB_TRANSITIONS] = { [FADE] = transition_fade, [WIPELEFT] = transition_wipeleft, @@ -260,6 +312,10 @@ static const char* transitions_map[NB_TRANSITIONS] = { [CIRCLECLOSE] = transition_circleclose, [DISSOLVE] = transition_dissolve, [PIXELIZE] = transition_pixelize, + [WIPETL] = transition_wipetl, + [WIPETR] = transition_wipetr, + [WIPEBL] = transition_wipebl, + [WIPEBR] = transition_wipebr, }; static av_cold int init_vulkan(AVFilterContext *avctx) @@ -614,6 +670,10 @@ static const AVOption xfade_vulkan_options[] = { { "circleclose", "circleclose transition", 0, AV_OPT_TYPE_CONST, {.i64=CIRCLECLOSE}, 0, 0, FLAGS, "transition" }, { "dissolve", "dissolve transition", 0, AV_OPT_TYPE_CONST, {.i64=DISSOLVE}, 0, 0, FLAGS, "transition" }, { "pixelize", "pixelize transition", 0, AV_OPT_TYPE_CONST, {.i64=PIXELIZE}, 0, 0, FLAGS, "transition" }, + { "wipetl", "wipe top left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPETL}, 0, 0, FLAGS, "transition" }, + { "wipetr", "wipe top right transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPETR}, 0, 0, FLAGS, "transition" }, + { "wipebl", "wipe bottom left transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEBL}, 0, 0, FLAGS, "transition" }, + { "wipebr", "wipe bottom right transition", 0, AV_OPT_TYPE_CONST, {.i64=WIPEBR}, 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.37.0 (Apple Git-136) _______________________________________________ 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] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH v3 5/5] lavfi/vf_xfade_vulkan: add wipes 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 5/5] lavfi/vf_xfade_vulkan: add wipes Marvin Scholz @ 2023-08-25 3:01 ` Lynne 0 siblings, 0 replies; 9+ messages in thread From: Lynne @ 2023-08-25 3:01 UTC (permalink / raw) To: FFmpeg development discussions and patches Aug 21, 2023, 22:46 by epirat07@gmail.com: > Add the wipetl, wipetr, wipebl, wipebr effects. > --- > libavfilter/vf_xfade_vulkan.c | 60 +++++++++++++++++++++++++++++++++++ > 1 file changed, 60 insertions(+) > Patchset pushed, Thanks _______________________________________________ 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] 9+ messages in thread
end of thread, other threads:[~2023-08-25 3:01 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20230724211107.40025-2-epirat07@gmail.com%3Emessage://%3C20230724211107.40025-1-epirat07@gmail.com> 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 1/2] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2023-07-24 21:47 ` [FFmpeg-devel] [PATCH 2/2] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz 2023-07-24 22:39 ` [FFmpeg-devel] [PATCH 3/3] lavfi/vf_xfade_vulkan: add dissolve Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 1/5] lavfi/vf_xfade_vulkan: add circleopen/circleclose Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 2/5] lavfi/vf_xfade_vulkan: reindent after last commit Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 3/5] lavfi/vf_xfade_vulkan: add dissolve Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 4/5] lavfi/vf_xfade_vulkan: add pixelize Marvin Scholz 2023-08-21 20:45 ` [FFmpeg-devel] [PATCH v3 5/5] lavfi/vf_xfade_vulkan: add wipes Marvin Scholz 2023-08-25 3:01 ` Lynne
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git