diff mbox series

[FFmpeg-devel,2/4] avfilter/vf_transpose_vulkan: add clock_flip option

Message ID 20211210190503.4015128-2-jianhua.wu@intel.com
State New
Headers show
Series [FFmpeg-devel,1/4] avfilter/vf_transpose_vulkan: add cclock option | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/configureppc warning Failed to apply patch

Commit Message

Wu Jianhua Dec. 10, 2021, 7:05 p.m. UTC
The following command is on how to apply clock_flip option:

ffmpeg -init_hw_device vulkan -i input.264 -vf \
hwupload=extra_hw_frames=16,transpose_vulkan=dir=clock_flip,hwdownload,format=yuv420p \
output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
---
 libavfilter/vf_transpose_vulkan.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/vf_transpose_vulkan.c b/libavfilter/vf_transpose_vulkan.c
index 59a548a12f..4c20becb5c 100644
--- a/libavfilter/vf_transpose_vulkan.c
+++ b/libavfilter/vf_transpose_vulkan.c
@@ -95,6 +95,8 @@  static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
             GLSLC(1, if (IS_WITHIN(pos, size)) {                           );
             if (s->dir == TRANSPOSE_CCLOCK)
                 GLSLF(2, vec4 res = texture(input_images[%i], ivec2(size.y - pos.y, pos.x)); ,i);
+            else if (s->dir == TRANSPOSE_CLOCK_FLIP)
+                GLSLF(2, vec4 res = texture(input_images[%i], ivec2(size.yx - pos.yx));      ,i);
             else
                 GLSLF(2, vec4 res = texture(input_images[%i], pos.yx);   ,i);
             GLSLF(2,     imageStore(output_images[%i], pos, res);        ,i);
@@ -291,6 +293,7 @@  static const AVOption transpose_vulkan_options[] = {
     { "dir", "set transpose direction", OFFSET(dir), AV_OPT_TYPE_INT, { .i64 = TRANSPOSE_CCLOCK_FLIP }, 0, 7, FLAGS, "dir" },
         { "cclock_flip", "rotate counter-clockwise with vertical flip", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK_FLIP }, .flags=FLAGS, .unit = "dir" },
         { "cclock",      "rotate counter-clockwise",                    0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK      }, .flags=FLAGS, .unit = "dir" },
+        { "clock_flip",  "rotate clockwise with vertical flip",         0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK_FLIP  }, .flags=FLAGS, .unit = "dir" },
     { NULL }
 };