Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay
@ 2022-10-10 10:54 ffmpegagent
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
                   ` (11 more replies)
  0 siblings, 12 replies; 31+ messages in thread
From: ffmpegagent @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

This patchset resolves a number of issues in the current code:

 * Bogus doubles framesync initialization
 * Executing build_parameters on each input frame
 * Segfault when there's no secondary input (yet)

and adds a number of enhancements to bring this on-par with the other
overlay filters:

 * Enable pixel alpha blending
 * Expose framesync parameters
 * Add support for expressions in overlay parameters (x, y, w, h)

softworkz (11):
  avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  avfilter/overlay_vaapi: build filter params just once
  avfilter/overlay_vaapi: remove double framesync init
  avfilter/overlay_vaapi: handle secondary null input
  avfilter/overlay_vaapi: reformat options
  avfilter/overlay_vaapi: remove redundant .get_buffer assignments
  avfilter/overlay_vaapi: add framesync options
  avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
  avfilter/overlay_vaapi: enable expressions for overlay parameters
  doc/filters.texi: remove incorrect statement
  doc/filters.texi: update overlay_vaapi documentation

 doc/filters.texi               |  50 +++--
 libavfilter/vf_overlay_vaapi.c | 328 ++++++++++++++++++++++-----------
 2 files changed, 257 insertions(+), 121 deletions(-)


base-commit: f3b5277057ad84071721f01419fe4badeceaff08
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-42%2Fsoftworkz%2Fsubmit_vaapi_overlay-v1
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-42/softworkz/submit_vaapi_overlay-v1
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/42
-- 
ffmpeg-codebot
_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
@ 2022-10-10 10:54 ` softworkz
  2022-10-31  5:55   ` Xiang, Haihao
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 02/11] avfilter/overlay_vaapi: build filter params just once softworkz
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 3e6a0de13f..218daf571f 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
     float            alpha;
 } OverlayVAAPIContext;
 
-static int overlay_vaapi_query_formats(AVFilterContext *ctx)
-{
-    int ret;
-    enum {
-        MAIN    = 0,
-        OVERLAY = 1,
-    };
-
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_VAAPI,
-        AV_PIX_FMT_NONE
-    };
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]->outcfg.formats);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[OVERLAY]->outcfg.formats);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]->incfg.formats);
-    if (ret < 0)
-        return ret;
-
-    return 0;
-}
-
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
 {
     VAAPIVPPContext *vpp_ctx   = avctx->priv;
@@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
     .activate        = &overlay_vaapi_activate,
     FILTER_INPUTS(overlay_vaapi_inputs),
     FILTER_OUTPUTS(overlay_vaapi_outputs),
-    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
+    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
 };
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 02/11] avfilter/overlay_vaapi: build filter params just once
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 03/11] avfilter/overlay_vaapi: remove double framesync init softworkz
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 218daf571f..cf17426b5d 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -181,10 +181,6 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
     VARectangle overlay_region, output_region;
     int err;
 
-    err = overlay_vaapi_build_filter_params(avctx);
-    if (err < 0)
-        return err;
-
     err = ff_framesync_get_frame(fs, 0, &input_main, 0);
     if (err < 0)
         return err;
@@ -309,6 +305,10 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     if (err < 0)
         return err;
 
+    err = overlay_vaapi_build_filter_params(avctx);
+    if (err < 0)
+        return err;
+
     err = ff_framesync_init_dualinput(&ctx->fs, avctx);
     if (err < 0)
         return err;
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 03/11] avfilter/overlay_vaapi: remove double framesync init
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 02/11] avfilter/overlay_vaapi: build filter params just once softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 04/11] avfilter/overlay_vaapi: handle secondary null input softworkz
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 31 +++++--------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index cf17426b5d..66e736cce4 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -265,28 +265,6 @@ fail:
     return err;
 }
 
-static int overlay_vaapi_init_framesync(AVFilterContext *avctx)
-{
-    OverlayVAAPIContext *ctx = avctx->priv;
-    int ret, i;
-
-    ctx->fs.on_event = overlay_vaapi_blend;
-    ctx->fs.opaque   = ctx;
-    ret = ff_framesync_init(&ctx->fs, avctx, avctx->nb_inputs);
-    if (ret < 0)
-        return ret;
-
-    for (i = 0; i < avctx->nb_inputs; i++) {
-        FFFrameSyncIn *in = &ctx->fs.in[i];
-        in->before    = EXT_STOP;
-        in->after     = EXT_INFINITY;
-        in->sync      = i ? 1 : 2;
-        in->time_base = avctx->inputs[i]->time_base;
-    }
-
-    return ff_framesync_configure(&ctx->fs);
-}
-
 static int overlay_vaapi_config_output(AVFilterLink *outlink)
 {
     AVFilterContext  *avctx  = outlink->src;
@@ -294,10 +272,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     VAAPIVPPContext *vpp_ctx = avctx->priv;
     int err;
 
-    err = overlay_vaapi_init_framesync(avctx);
-    if (err < 0)
-        return err;
-
+    outlink->time_base = avctx->inputs[0]->time_base;
     vpp_ctx->output_width  = avctx->inputs[0]->w;
     vpp_ctx->output_height = avctx->inputs[0]->h;
 
@@ -313,6 +288,10 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     if (err < 0)
         return err;
 
+    ctx->fs.on_event  = overlay_vaapi_blend;
+    ctx->fs.opaque    = ctx;
+    ctx->fs.time_base = outlink->time_base;
+
     return ff_framesync_configure(&ctx->fs);
 }
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 04/11] avfilter/overlay_vaapi: handle secondary null input
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (2 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 03/11] avfilter/overlay_vaapi: remove double framesync init softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 05/11] avfilter/overlay_vaapi: reformat options softworkz
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Currently segfaults in this case.

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 94 ++++++++++++++++++----------------
 1 file changed, 49 insertions(+), 45 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 66e736cce4..1281038c36 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -106,18 +106,6 @@ static int overlay_vaapi_render_picture(AVFilterContext *avctx,
            params_id);
 
 
-    vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
-                         VAProcPipelineParameterBufferType,
-                         sizeof(*subpic_params), 1, subpic_params, &subpic_params_id);
-    if (vas != VA_STATUS_SUCCESS) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: "
-               "%d (%s).\n", vas, vaErrorStr(vas));
-        err = AVERROR(EIO);
-        goto fail_after_begin;
-    }
-    av_log(avctx, AV_LOG_DEBUG, "Pipeline subpic parameter buffer is %#x.\n",
-           subpic_params_id);
-
     vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context,
                           &params_id, 1);
     if (vas != VA_STATUS_SUCCESS) {
@@ -127,13 +115,27 @@ static int overlay_vaapi_render_picture(AVFilterContext *avctx,
         goto fail_after_begin;
     }
 
-    vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context,
-                          &subpic_params_id, 1);
-    if (vas != VA_STATUS_SUCCESS) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to render subpic parameter buffer: "
-               "%d (%s).\n", vas, vaErrorStr(vas));
-        err = AVERROR(EIO);
-        goto fail_after_begin;
+    if (subpic_params) {
+        vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
+                             VAProcPipelineParameterBufferType,
+                             sizeof(*subpic_params), 1, subpic_params, &subpic_params_id);
+        if (vas != VA_STATUS_SUCCESS) {
+            av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: "
+                   "%d (%s).\n", vas, vaErrorStr(vas));
+            err = AVERROR(EIO);
+            goto fail_after_begin;
+        }
+        av_log(avctx, AV_LOG_DEBUG, "Pipeline subpic parameter buffer is %#x.\n",
+               subpic_params_id);
+
+        vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context,
+                              &subpic_params_id, 1);
+        if (vas != VA_STATUS_SUCCESS) {
+            av_log(avctx, AV_LOG_ERROR, "Failed to render subpic parameter buffer: "
+                   "%d (%s).\n", vas, vaErrorStr(vas));
+            err = AVERROR(EIO);
+            goto fail_after_begin;
+        }
     }
 
     vas = vaEndPicture(ctx->hwctx->display, ctx->va_context);
@@ -177,7 +179,7 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
     AVFrame *input_main, *input_overlay;
     AVFrame *output;
     VAProcPipelineParameterBuffer params, subpic_params;
-    VABlendState blend_state; /**< Blend State */
+    VABlendState blend_state = { 0 }; /**< Blend State */
     VARectangle overlay_region, output_region;
     int err;
 
@@ -192,10 +194,6 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
            av_get_pix_fmt_name(input_main->format),
            input_main->width, input_main->height, input_main->pts);
 
-    av_log(avctx, AV_LOG_DEBUG, "Filter overlay: %s, %ux%u (%"PRId64").\n",
-           av_get_pix_fmt_name(input_overlay->format),
-           input_overlay->width, input_overlay->height, input_overlay->pts);
-
     if (vpp_ctx->va_context == VA_INVALID_ID)
         return AVERROR(EINVAL);
 
@@ -214,13 +212,6 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
     if (err < 0)
         goto fail;
 
-    overlay_region = (VARectangle) {
-        .x      = ctx->overlay_ox,
-        .y      = ctx->overlay_oy,
-        .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width,
-        .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height,
-    };
-
     output_region = (VARectangle) {
         .x      = 0,
         .y      = 0,
@@ -228,29 +219,42 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
         .height = output->height,
     };
 
-    if (overlay_region.x + overlay_region.width > input_main->width ||
-        overlay_region.y + overlay_region.height > input_main->height) {
-        av_log(ctx, AV_LOG_WARNING,
-               "The overlay image exceeds the scope of the main image, "
-               "will crop the overlay image according based on the main image.\n");
-    }
-
     params.filters     = &vpp_ctx->filter_buffers[0];
     params.num_filters = vpp_ctx->nb_filter_buffers;
 
     params.output_region = &output_region;
     params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
 
-    memcpy(&subpic_params, &params, sizeof(subpic_params));
+    if (input_overlay) {
+        av_log(avctx, AV_LOG_DEBUG, "Filter overlay: %s, %ux%u (%"PRId64").\n",
+               av_get_pix_fmt_name(input_overlay->format),
+               input_overlay->width, input_overlay->height, input_overlay->pts);
+
+        overlay_region = (VARectangle) {
+            .x      = ctx->overlay_ox,
+            .y      = ctx->overlay_oy,
+            .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width,
+            .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height,
+        };
+
+        if (overlay_region.x + overlay_region.width > input_main->width ||
+            overlay_region.y + overlay_region.height > input_main->height) {
+            av_log(ctx, AV_LOG_WARNING,
+                   "The overlay image exceeds the scope of the main image, "
+                   "will crop the overlay image according based on the main image.\n");
+        }
+
+        memcpy(&subpic_params, &params, sizeof(subpic_params));
 
-    blend_state.flags = VA_BLEND_GLOBAL_ALPHA;
-    blend_state.global_alpha = ctx->alpha;
-    subpic_params.blend_state = &blend_state;
+        blend_state.flags         = VA_BLEND_GLOBAL_ALPHA;
+        blend_state.global_alpha  = ctx->alpha;
+        subpic_params.blend_state = &blend_state;
 
-    subpic_params.surface = (VASurfaceID)(uintptr_t)input_overlay->data[3];
-    subpic_params.output_region = &overlay_region;
+        subpic_params.surface       = (VASurfaceID)(uintptr_t)input_overlay->data[3];
+        subpic_params.output_region = &overlay_region;
+    }
 
-    err = overlay_vaapi_render_picture(avctx, &params, &subpic_params, output);
+    err = overlay_vaapi_render_picture(avctx, &params, input_overlay ? &subpic_params : NULL, output);
     if (err < 0)
         goto fail;
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 05/11] avfilter/overlay_vaapi: reformat options
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (3 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 04/11] avfilter/overlay_vaapi: handle secondary null input softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments softworkz
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 1281038c36..c14aacbb5d 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -326,16 +326,11 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 static const AVOption overlay_vaapi_options[] = {
-    { "x", "Overlay x position",
-      OFFSET(overlay_ox), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "y", "Overlay y position",
-      OFFSET(overlay_oy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "w", "Overlay width",
-      OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "h", "Overlay height",
-      OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "alpha", "Overlay global alpha",
-      OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 1.0}, 0.0, 1.0, .flags = FLAGS},
+    { "x", "Overlay x position",       OFFSET(overlay_ox), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "y", "Overlay y position",       OFFSET(overlay_oy), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "w", "Overlay width",            OFFSET(overlay_ow), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "h", "Overlay height",           OFFSET(overlay_oh), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
     { NULL },
 };
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (4 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 05/11] avfilter/overlay_vaapi: reformat options softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 07/11] avfilter/overlay_vaapi: add framesync options softworkz
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index c14aacbb5d..71fc90a86b 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -340,13 +340,11 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
     {
         .name             = "main",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .get_buffer.video = ff_default_get_video_buffer,
         .config_props     = &ff_vaapi_vpp_config_input,
     },
     {
         .name             = "overlay",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .get_buffer.video = ff_default_get_video_buffer,
     },
 };
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 07/11] avfilter/overlay_vaapi: add framesync options
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (5 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha softworkz
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 71fc90a86b..f4f9cc58ec 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -292,8 +292,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     if (err < 0)
         return err;
 
-    ctx->fs.on_event  = overlay_vaapi_blend;
-    ctx->fs.opaque    = ctx;
+    ctx->fs.on_event = overlay_vaapi_blend;
     ctx->fs.time_base = outlink->time_base;
 
     return ff_framesync_configure(&ctx->fs);
@@ -321,6 +320,7 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
     OverlayVAAPIContext *ctx = avctx->priv;
 
     ff_framesync_uninit(&ctx->fs);
+    ff_vaapi_vpp_ctx_uninit(avctx);
 }
 
 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
@@ -331,10 +331,18 @@ static const AVOption overlay_vaapi_options[] = {
     { "w", "Overlay width",            OFFSET(overlay_ow), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
     { "h", "Overlay height",           OFFSET(overlay_oh), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
     { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
+    { "eof_action", "Action to take when encountering EOF from secondary input ",
+        OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
+        EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
+        { "repeat", "Repeat the previous frame.",   0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
+        { "endall", "End both streams.",            0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
+        { "pass",   "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS },   .flags = FLAGS, "eof_action" },
+    { "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest),   AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
+    { "repeatlast", "repeat overlay of the last overlay frame",           OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
     { NULL },
 };
 
-AVFILTER_DEFINE_CLASS(overlay_vaapi);
+FRAMESYNC_DEFINE_CLASS(overlay_vaapi, OverlayVAAPIContext, fs);
 
 static const AVFilterPad overlay_vaapi_inputs[] = {
     {
@@ -364,6 +372,7 @@ const AVFilter ff_vf_overlay_vaapi = {
     .init            = &overlay_vaapi_init,
     .uninit          = &overlay_vaapi_uninit,
     .activate        = &overlay_vaapi_activate,
+    .preinit         = overlay_vaapi_framesync_preinit,
     FILTER_INPUTS(overlay_vaapi_inputs),
     FILTER_OUTPUTS(overlay_vaapi_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (6 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 07/11] avfilter/overlay_vaapi: add framesync options softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 44 ++++++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index f4f9cc58ec..b2c254d9dd 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -36,6 +36,8 @@ typedef struct OverlayVAAPIContext {
     int              overlay_ow;
     int              overlay_oh;
     float            alpha;
+    unsigned int     blend_flags;
+    float            blend_alpha;
 } OverlayVAAPIContext;
 
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
@@ -246,8 +248,8 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
 
         memcpy(&subpic_params, &params, sizeof(subpic_params));
 
-        blend_state.flags         = VA_BLEND_GLOBAL_ALPHA;
-        blend_state.global_alpha  = ctx->alpha;
+        blend_state.flags         = ctx->blend_flags;
+        blend_state.global_alpha  = ctx->blend_alpha;
         subpic_params.blend_state = &blend_state;
 
         subpic_params.surface       = (VASurfaceID)(uintptr_t)input_overlay->data[3];
@@ -269,6 +271,43 @@ fail:
     return err;
 }
 
+static int have_alpha_planar(AVFilterLink *link)
+{
+    enum AVPixelFormat pix_fmt = link->format;
+    const AVPixFmtDescriptor *desc;
+    AVHWFramesContext *fctx;
+
+    if (link->format == AV_PIX_FMT_VAAPI) {
+        fctx    = (AVHWFramesContext *)link->hw_frames_ctx->data;
+        pix_fmt = fctx->sw_format;
+    }
+
+    desc = av_pix_fmt_desc_get(pix_fmt);
+    if (!desc)
+        return 0;
+
+    return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
+}
+
+static int overlay_vaapi_config_input_overlay(AVFilterLink *inlink)
+{
+    AVFilterContext  *avctx  = inlink->dst;
+    OverlayVAAPIContext *ctx = avctx->priv;
+
+    ctx->blend_flags = 0;
+    ctx->blend_alpha = 1.0f;
+
+    if (ctx->alpha < 1.0f) {
+        ctx->blend_flags |= VA_BLEND_GLOBAL_ALPHA;
+        ctx->blend_alpha  = ctx->alpha;
+    }
+
+    if (have_alpha_planar(inlink))
+        ctx->blend_flags |= VA_BLEND_PREMULTIPLIED_ALPHA;
+
+    return 0;
+}
+
 static int overlay_vaapi_config_output(AVFilterLink *outlink)
 {
     AVFilterContext  *avctx  = outlink->src;
@@ -353,6 +392,7 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
     {
         .name             = "overlay",
         .type             = AVMEDIA_TYPE_VIDEO,
+        .config_props     = overlay_vaapi_config_input_overlay,
     },
 };
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (7 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-31  5:43   ` Xiang, Haihao
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 10/11] doc/filters.texi: remove incorrect statement softworkz
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 141 +++++++++++++++++++++++++++++----
 1 file changed, 127 insertions(+), 14 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index b2c254d9dd..7be7d52589 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -27,19 +27,106 @@
 #include "formats.h"
 #include "internal.h"
 #include "vaapi_vpp.h"
+#include "libavutil/eval.h"
+
+enum var_name {
+    VAR_MAIN_iW,     VAR_MW,
+    VAR_MAIN_iH,     VAR_MH,
+    VAR_OVERLAY_iW,
+    VAR_OVERLAY_iH,
+    VAR_OVERLAY_X,  VAR_OX,
+    VAR_OVERLAY_Y,  VAR_OY,
+    VAR_OVERLAY_W,  VAR_OW,
+    VAR_OVERLAY_H,  VAR_OH,
+    VAR_VARS_NB
+};
 
 typedef struct OverlayVAAPIContext {
     VAAPIVPPContext  vpp_ctx; /**< must be the first field */
     FFFrameSync      fs;
-    int              overlay_ox;
-    int              overlay_oy;
-    int              overlay_ow;
-    int              overlay_oh;
+
+    double           var_values[VAR_VARS_NB];
+    char             *overlay_ox;
+    char             *overlay_oy;
+    char             *overlay_ow;
+    char             *overlay_oh;
+    int              ox;
+    int              oy;
+    int              ow;
+    int              oh;
     float            alpha;
     unsigned int     blend_flags;
     float            blend_alpha;
 } OverlayVAAPIContext;
 
+static const char *const var_names[] = {
+    "main_w",     "W",   /* input width of the main layer */
+    "main_h",     "H",   /* input height of the main layer */
+    "overlay_iw",        /* input width of the overlay layer */
+    "overlay_ih",        /* input height of the overlay layer */
+    "overlay_x",  "x",   /* x position of the overlay layer inside of main */
+    "overlay_y",  "y",   /* y position of the overlay layer inside of main */
+    "overlay_w",  "w",   /* output width of overlay layer */
+    "overlay_h",  "h",   /* output height of overlay layer */
+    NULL
+};
+
+static int eval_expr(AVFilterContext *avctx)
+{
+    OverlayVAAPIContext *ctx = avctx->priv;
+    double       *var_values = ctx->var_values;
+    int                  ret = 0;
+    AVExpr *ox_expr = NULL, *oy_expr = NULL;
+    AVExpr *ow_expr = NULL, *oh_expr = NULL;
+
+#define PARSE_EXPR(e, s) {\
+    ret = av_expr_parse(&(e), s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \
+    if (ret < 0) {\
+        av_log(ctx, AV_LOG_ERROR, "Error when parsing '%s'.\n", s);\
+        goto release;\
+    }\
+}
+    PARSE_EXPR(ox_expr, ctx->overlay_ox)
+    PARSE_EXPR(oy_expr, ctx->overlay_oy)
+    PARSE_EXPR(ow_expr, ctx->overlay_ow)
+    PARSE_EXPR(oh_expr, ctx->overlay_oh)
+#undef PASS_EXPR
+
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_H] =
+    var_values[VAR_OH]        = av_expr_eval(oh_expr, var_values, NULL);
+
+    /* calc again in case ow is relative to oh */
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+
+    var_values[VAR_OVERLAY_X] =
+    var_values[VAR_OX]        = av_expr_eval(ox_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_Y] =
+    var_values[VAR_OY]        = av_expr_eval(oy_expr, var_values, NULL);
+
+    /* calc again in case ox is relative to oy */
+    var_values[VAR_OVERLAY_X] =
+    var_values[VAR_OX]        = av_expr_eval(ox_expr, var_values, NULL);
+
+    /* calc overlay_w and overlay_h again incase relative to ox,oy */
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_H] =
+    var_values[VAR_OH]        = av_expr_eval(oh_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+
+release:
+    av_expr_free(ox_expr);
+    av_expr_free(oy_expr);
+    av_expr_free(ow_expr);
+    av_expr_free(oh_expr);
+
+    return ret;
+}
+
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
 {
     VAAPIVPPContext *vpp_ctx   = avctx->priv;
@@ -233,10 +320,10 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
                input_overlay->width, input_overlay->height, input_overlay->pts);
 
         overlay_region = (VARectangle) {
-            .x      = ctx->overlay_ox,
-            .y      = ctx->overlay_oy,
-            .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width,
-            .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height,
+            .x      = ctx->ox,
+            .y      = ctx->oy,
+            .width  = ctx->ow ? ctx->ow : input_overlay->width,
+            .height = ctx->oh ? ctx->oh : input_overlay->height,
         };
 
         if (overlay_region.x + overlay_region.width > input_main->width ||
@@ -289,10 +376,36 @@ static int have_alpha_planar(AVFilterLink *link)
     return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
 }
 
+static int overlay_vaapi_config_input_main(AVFilterLink *inlink)
+{
+    AVFilterContext  *avctx  = inlink->dst;
+    OverlayVAAPIContext *ctx = avctx->priv;
+
+    ctx->var_values[VAR_MAIN_iW] =
+    ctx->var_values[VAR_MW]      = inlink->w;
+    ctx->var_values[VAR_MAIN_iH] =
+    ctx->var_values[VAR_MH]      = inlink->h;
+
+    return ff_vaapi_vpp_config_input(inlink);
+}
+
 static int overlay_vaapi_config_input_overlay(AVFilterLink *inlink)
 {
     AVFilterContext  *avctx  = inlink->dst;
     OverlayVAAPIContext *ctx = avctx->priv;
+    int ret;
+
+    ctx->var_values[VAR_OVERLAY_iW] = inlink->w;
+    ctx->var_values[VAR_OVERLAY_iH] = inlink->h;
+
+    ret = eval_expr(avctx);
+    if (ret < 0)
+        return ret;
+
+    ctx->ox = (int)ctx->var_values[VAR_OX];
+    ctx->oy = (int)ctx->var_values[VAR_OY];
+    ctx->ow = (int)ctx->var_values[VAR_OW];
+    ctx->oh = (int)ctx->var_values[VAR_OH];
 
     ctx->blend_flags = 0;
     ctx->blend_alpha = 1.0f;
@@ -365,11 +478,11 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 static const AVOption overlay_vaapi_options[] = {
-    { "x", "Overlay x position",       OFFSET(overlay_ox), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "y", "Overlay y position",       OFFSET(overlay_oy), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "w", "Overlay width",            OFFSET(overlay_ow), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "h", "Overlay height",           OFFSET(overlay_oh), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
+    { "x", "Overlay x position", OFFSET(overlay_ox),   AV_OPT_TYPE_STRING, { .str="0"}, 0, 255,          .flags = FLAGS},
+    { "y", "Overlay y position", OFFSET(overlay_oy),   AV_OPT_TYPE_STRING, { .str="0"}, 0, 255,          .flags = FLAGS},
+    { "w", "Overlay width",      OFFSET(overlay_ow),   AV_OPT_TYPE_STRING, { .str="overlay_iw"}, 0, 255, .flags = FLAGS},
+    { "h", "Overlay height",     OFFSET(overlay_oh),   AV_OPT_TYPE_STRING, { .str="overlay_ih*w/overlay_iw"}, 0, 255, .flags = FLAGS},
+    { "alpha", "Overlay global alpha", OFFSET(alpha),  AV_OPT_TYPE_FLOAT,  { .dbl = 1.0 }, 0.0, 1.0,      .flags = FLAGS },
     { "eof_action", "Action to take when encountering EOF from secondary input ",
         OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
         EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
@@ -387,7 +500,7 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
     {
         .name             = "main",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = &ff_vaapi_vpp_config_input,
+        .config_props     = overlay_vaapi_config_input_main,
     },
     {
         .name             = "overlay",
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 10/11] doc/filters.texi: remove incorrect statement
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (8 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
  11 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 doc/filters.texi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 68205147f0..2d0b5db909 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -26267,7 +26267,6 @@ To use vaapi filters, you need to setup the vaapi device correctly. For more inf
 Overlay one video on the top of another.
 
 It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid.
-This filter requires same memory layout for all the inputs. So, format conversion may be needed.
 
 The filter accepts the following options:
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (9 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 10/11] doc/filters.texi: remove incorrect statement softworkz
@ 2022-10-10 10:54 ` softworkz
  2022-10-10 11:08   ` Gyan Doshi
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
  11 siblings, 1 reply; 31+ messages in thread
From: softworkz @ 2022-10-10 10:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 doc/filters.texi | 49 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 38 insertions(+), 11 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 2d0b5db909..5f4604a834 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -26271,30 +26271,57 @@ It takes two inputs and has one output. The first input is the "main" video on w
 The filter accepts the following options:
 
 @table @option
-
 @item x
-Set the x coordinate of the overlaid video on the main video.
-Default value is @code{0}.
-
 @item y
-Set the y coordinate of the overlaid video on the main video.
-Default value is @code{0}.
+Set expressions for the x and y coordinates of the overlaid video
+on the main video.
 
-@item w
-Set the width of the overlaid video on the main video.
-Default value is the width of input overlay video.
+Default value is "0" for both expressions.
 
+@item w
 @item h
-Set the height of the overlaid video on the main video.
-Default value is the height of input overlay video.
+Set expressions for the width and height the overlaid video
+on the main video.
+
+The expressions can contain the following parameters:
+
+@table @option
+
+@item main_w, W
+@item main_h, H
+The main input width and height.
+
+@item overlay_iw
+@item overlay_ih
+The overlay input width and height.
+
+@item overlay_w, w
+@item overlay_h, h
+The overlay output width and height.
+
+@item overlay_x, x
+@item overlay_y, y
+Position of the overlay layer inside of main
+
+@end table
 
 @item alpha
 Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
 Higher value means lower transparency.
 Default value is @code{1.0}.
 
+@item eof_action
+See @ref{framesync}.
+
+@item shortest
+See @ref{framesync}.
+
+@item repeatlast
+See @ref{framesync}.
+
 @end table
 
+This filter also supports the @ref{framesync} options.
 @subsection Examples
 
 @itemize
-- 
ffmpeg-codebot
_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz
@ 2022-10-10 11:08   ` Gyan Doshi
  2022-10-10 11:25     ` Soft Works
  0 siblings, 1 reply; 31+ messages in thread
From: Gyan Doshi @ 2022-10-10 11:08 UTC (permalink / raw)
  To: ffmpeg-devel



On 2022-10-10 04:24 pm, softworkz wrote:
> From: softworkz <softworkz@hotmail.com>
>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>   doc/filters.texi | 49 +++++++++++++++++++++++++++++++++++++-----------
>   1 file changed, 38 insertions(+), 11 deletions(-)
>
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 2d0b5db909..5f4604a834 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -26271,30 +26271,57 @@ It takes two inputs and has one output. The first input is the "main" video on w
>   The filter accepts the following options:
>   
>   @table @option
> -
>   @item x
> -Set the x coordinate of the overlaid video on the main video.
> -Default value is @code{0}.
> -
>   @item y
> -Set the y coordinate of the overlaid video on the main video.
> -Default value is @code{0}.
> +Set expressions for the x and y coordinates of the overlaid video
> +on the main video.
>   
> -@item w
> -Set the width of the overlaid video on the main video.
> -Default value is the width of input overlay video.
> +Default value is "0" for both expressions.
>   
> +@item w
>   @item h
> -Set the height of the overlaid video on the main video.
> -Default value is the height of input overlay video.
> +Set expressions for the width and height the overlaid video
> +on the main video.

The default values should be mentioned here. And also what the default 
value means, if not trivial.

Regards,
Gyan

> +The expressions can contain the following parameters:
> +
> +@table @option
> +
> +@item main_w, W
> +@item main_h, H
> +The main input width and height.
> +
> +@item overlay_iw
> +@item overlay_ih
> +The overlay input width and height.
> +
> +@item overlay_w, w
> +@item overlay_h, h
> +The overlay output width and height.
> +
> +@item overlay_x, x
> +@item overlay_y, y
> +Position of the overlay layer inside of main
> +
> +@end table
>   
>   @item alpha
>   Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
>   Higher value means lower transparency.
>   Default value is @code{1.0}.
>   
> +@item eof_action
> +See @ref{framesync}.
> +
> +@item shortest
> +See @ref{framesync}.
> +
> +@item repeatlast
> +See @ref{framesync}.
> +
>   @end table
>   
> +This filter also supports the @ref{framesync} options.
>   @subsection Examples
>   
>   @itemize

_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation
  2022-10-10 11:08   ` Gyan Doshi
@ 2022-10-10 11:25     ` Soft Works
  0 siblings, 0 replies; 31+ messages in thread
From: Soft Works @ 2022-10-10 11:25 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Gyan Doshi
> Sent: Monday, October 10, 2022 1:08 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update
> overlay_vaapi documentation
> 
> 
> 
> On 2022-10-10 04:24 pm, softworkz wrote:
> > From: softworkz <softworkz@hotmail.com>
> >
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> >   doc/filters.texi | 49 +++++++++++++++++++++++++++++++++++++------
> -----
> >   1 file changed, 38 insertions(+), 11 deletions(-)
> >
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 2d0b5db909..5f4604a834 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -26271,30 +26271,57 @@ It takes two inputs and has one output.
> The first input is the "main" video on w
> >   The filter accepts the following options:
> >
> >   @table @option
> > -
> >   @item x
> > -Set the x coordinate of the overlaid video on the main video.
> > -Default value is @code{0}.
> > -
> >   @item y
> > -Set the y coordinate of the overlaid video on the main video.
> > -Default value is @code{0}.
> > +Set expressions for the x and y coordinates of the overlaid video
> > +on the main video.
> >
> > -@item w
> > -Set the width of the overlaid video on the main video.
> > -Default value is the width of input overlay video.
> > +Default value is "0" for both expressions.
> >
> > +@item w
> >   @item h
> > -Set the height of the overlaid video on the main video.
> > -Default value is the height of input overlay video.
> > +Set expressions for the width and height the overlaid video
> > +on the main video.
> 
> The default values should be mentioned here. And also what the
> default
> value means, if not trivial.
> 
> Regards,
> Gyan

Yea, you are hitting a point that I had left out because
I wasn't sure how detailed this should be explained:

The expression handling is done analog to overlay_qsv and I've taken
the same defaults which are:

    { "w", "Overlay width",      OFFSET(overlay_ow), AV_OPT_TYPE_STRING, { .str="overlay_iw"}, 0, 255, .flags = FLAGS},
    { "h", "Overlay height",     OFFSET(overlay_oh), AV_OPT_TYPE_STRING, { .str="overlay_ih*w/overlay_iw"}, 0, 255, .flags = FLAGS},


Essentially, the values are defaulting to the frame size of the
overlay input. This is because both, w and overlay_iw are initialized
to the overlay size. The default expression allows to set the width
only and have the height be adjusted proportionally.
But it doesn't work the other way round (setting h only), so 
I'm not sure whether it's a good default at all - I just wanted 
to have it equal to overlay_qsv..

Thanks,
softworkz




_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
@ 2022-10-31  5:43   ` Xiang, Haihao
  2022-10-31  5:56     ` Soft Works
  0 siblings, 1 reply; 31+ messages in thread
From: Xiang, Haihao @ 2022-10-31  5:43 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

On Mon, 2022-10-10 at 10:54 +0000, softworkz wrote:
> From: softworkz <softworkz@hotmail.com>
> 
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>  libavfilter/vf_overlay_vaapi.c | 141 +++++++++++++++++++++++++++++----
>  1 file changed, 127 insertions(+), 14 deletions(-)
> 
> diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
> index b2c254d9dd..7be7d52589 100644
> --- a/libavfilter/vf_overlay_vaapi.c
> +++ b/libavfilter/vf_overlay_vaapi.c
> @@ -27,19 +27,106 @@
>  #include "formats.h"
>  #include "internal.h"
>  #include "vaapi_vpp.h"
> +#include "libavutil/eval.h"
> +
> +enum var_name {
> +    VAR_MAIN_iW,     VAR_MW,
> +    VAR_MAIN_iH,     VAR_MH,
> +    VAR_OVERLAY_iW,
> +    VAR_OVERLAY_iH,

It is better not to mix capital and lower-case letters here, (I have a patch to
change the var_name in qsv)

Thanks
Haihao


> +    VAR_OVERLAY_X,  VAR_OX,
> +    VAR_OVERLAY_Y,  VAR_OY,
> +    VAR_OVERLAY_W,  VAR_OW,
> +    VAR_OVERLAY_H,  VAR_OH,
> +    VAR_VARS_NB
> +};
>  
>  typedef struct OverlayVAAPIContext {
>      VAAPIVPPContext  vpp_ctx; /**< must be the first field */
>      FFFrameSync      fs;
> -    int              overlay_ox;
> -    int              overlay_oy;
> -    int              overlay_ow;
> -    int              overlay_oh;
> +
> +    double           var_values[VAR_VARS_NB];
> +    char             *overlay_ox;
> +    char             *overlay_oy;
> +    char             *overlay_ow;
> +    char             *overlay_oh;
> +    int              ox;
> +    int              oy;
> +    int              ow;
> +    int              oh;
>      float            alpha;
>      unsigned int     blend_flags;
>      float            blend_alpha;
>  } OverlayVAAPIContext;
>  
> +static const char *const var_names[] = {
> +    "main_w",     "W",   /* input width of the main layer */
> +    "main_h",     "H",   /* input height of the main layer */
> +    "overlay_iw",        /* input width of the overlay layer */
> +    "overlay_ih",        /* input height of the overlay layer */
> +    "overlay_x",  "x",   /* x position of the overlay layer inside of main */
> +    "overlay_y",  "y",   /* y position of the overlay layer inside of main */
> +    "overlay_w",  "w",   /* output width of overlay layer */
> +    "overlay_h",  "h",   /* output height of overlay layer */
> +    NULL
> +};
> +
> +static int eval_expr(AVFilterContext *avctx)
> +{
> +    OverlayVAAPIContext *ctx = avctx->priv;
> +    double       *var_values = ctx->var_values;
> +    int                  ret = 0;
> +    AVExpr *ox_expr = NULL, *oy_expr = NULL;
> +    AVExpr *ow_expr = NULL, *oh_expr = NULL;
> +
> +#define PARSE_EXPR(e, s) {\
> +    ret = av_expr_parse(&(e), s, var_names, NULL, NULL, NULL, NULL, 0, ctx);
> \
> +    if (ret < 0) {\
> +        av_log(ctx, AV_LOG_ERROR, "Error when parsing '%s'.\n", s);\
> +        goto release;\
> +    }\
> +}
> +    PARSE_EXPR(ox_expr, ctx->overlay_ox)
> +    PARSE_EXPR(oy_expr, ctx->overlay_oy)
> +    PARSE_EXPR(ow_expr, ctx->overlay_ow)
> +    PARSE_EXPR(oh_expr, ctx->overlay_oh)
> +#undef PASS_EXPR
> +
> +    var_values[VAR_OVERLAY_W] =
> +    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
> +    var_values[VAR_OVERLAY_H] =
> +    var_values[VAR_OH]        = av_expr_eval(oh_expr, var_values, NULL);
> +
> +    /* calc again in case ow is relative to oh */
> +    var_values[VAR_OVERLAY_W] =
> +    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
> +
> +    var_values[VAR_OVERLAY_X] =
> +    var_values[VAR_OX]        = av_expr_eval(ox_expr, var_values, NULL);
> +    var_values[VAR_OVERLAY_Y] =
> +    var_values[VAR_OY]        = av_expr_eval(oy_expr, var_values, NULL);
> +
> +    /* calc again in case ox is relative to oy */
> +    var_values[VAR_OVERLAY_X] =
> +    var_values[VAR_OX]        = av_expr_eval(ox_expr, var_values, NULL);
> +
> +    /* calc overlay_w and overlay_h again incase relative to ox,oy */
> +    var_values[VAR_OVERLAY_W] =
> +    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
> +    var_values[VAR_OVERLAY_H] =
> +    var_values[VAR_OH]        = av_expr_eval(oh_expr, var_values, NULL);
> +    var_values[VAR_OVERLAY_W] =
> +    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
> +
> +release:
> +    av_expr_free(ox_expr);
> +    av_expr_free(oy_expr);
> +    av_expr_free(ow_expr);
> +    av_expr_free(oh_expr);
> +
> +    return ret;
> +}
> +
>  static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
>  {
>      VAAPIVPPContext *vpp_ctx   = avctx->priv;
> @@ -233,10 +320,10 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
>                 input_overlay->width, input_overlay->height, input_overlay-
> >pts);
>  
>          overlay_region = (VARectangle) {
> -            .x      = ctx->overlay_ox,
> -            .y      = ctx->overlay_oy,
> -            .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay-
> >width,
> -            .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay-
> >height,
> +            .x      = ctx->ox,
> +            .y      = ctx->oy,
> +            .width  = ctx->ow ? ctx->ow : input_overlay->width,
> +            .height = ctx->oh ? ctx->oh : input_overlay->height,
>          };
>  
>          if (overlay_region.x + overlay_region.width > input_main->width ||
> @@ -289,10 +376,36 @@ static int have_alpha_planar(AVFilterLink *link)
>      return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
>  }
>  
> +static int overlay_vaapi_config_input_main(AVFilterLink *inlink)
> +{
> +    AVFilterContext  *avctx  = inlink->dst;
> +    OverlayVAAPIContext *ctx = avctx->priv;
> +
> +    ctx->var_values[VAR_MAIN_iW] =
> +    ctx->var_values[VAR_MW]      = inlink->w;
> +    ctx->var_values[VAR_MAIN_iH] =
> +    ctx->var_values[VAR_MH]      = inlink->h;
> +
> +    return ff_vaapi_vpp_config_input(inlink);
> +}
> +
>  static int overlay_vaapi_config_input_overlay(AVFilterLink *inlink)
>  {
>      AVFilterContext  *avctx  = inlink->dst;
>      OverlayVAAPIContext *ctx = avctx->priv;
> +    int ret;
> +
> +    ctx->var_values[VAR_OVERLAY_iW] = inlink->w;
> +    ctx->var_values[VAR_OVERLAY_iH] = inlink->h;
> +
> +    ret = eval_expr(avctx);
> +    if (ret < 0)
> +        return ret;
> +
> +    ctx->ox = (int)ctx->var_values[VAR_OX];
> +    ctx->oy = (int)ctx->var_values[VAR_OY];
> +    ctx->ow = (int)ctx->var_values[VAR_OW];
> +    ctx->oh = (int)ctx->var_values[VAR_OH];
>  
>      ctx->blend_flags = 0;
>      ctx->blend_alpha = 1.0f;
> @@ -365,11 +478,11 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext
> *avctx)
>  #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
>  #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
>  static const AVOption overlay_vaapi_options[] = {
> -    { "x", "Overlay x position",       OFFSET(overlay_ox),
> AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
> -    { "y", "Overlay y position",       OFFSET(overlay_oy),
> AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
> -    { "w", "Overlay width",            OFFSET(overlay_ow),
> AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
> -    { "h", "Overlay height",           OFFSET(overlay_oh),
> AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
> -    { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT,
> { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
> +    { "x", "Overlay x position", OFFSET(overlay_ox),   AV_OPT_TYPE_STRING, {
> .str="0"}, 0, 255,          .flags = FLAGS},
> +    { "y", "Overlay y position", OFFSET(overlay_oy),   AV_OPT_TYPE_STRING, {
> .str="0"}, 0, 255,          .flags = FLAGS},
> +    { "w", "Overlay width",      OFFSET(overlay_ow),   AV_OPT_TYPE_STRING, {
> .str="overlay_iw"}, 0, 255, .flags = FLAGS},
> +    { "h", "Overlay height",     OFFSET(overlay_oh),   AV_OPT_TYPE_STRING, {
> .str="overlay_ih*w/overlay_iw"}, 0, 255, .flags = FLAGS},
> +    { "alpha", "Overlay global alpha", OFFSET(alpha),  AV_OPT_TYPE_FLOAT,  {
> .dbl = 1.0 }, 0.0, 1.0,      .flags = FLAGS },
>      { "eof_action", "Action to take when encountering EOF from secondary
> input ",
>          OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 =
> EOF_ACTION_REPEAT },
>          EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
> @@ -387,7 +500,7 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
>      {
>          .name             = "main",
>          .type             = AVMEDIA_TYPE_VIDEO,
> -        .config_props     = &ff_vaapi_vpp_config_input,
> +        .config_props     = overlay_vaapi_config_input_main,
>      },
>      {
>          .name             = "overlay",
_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
@ 2022-10-31  5:55   ` Xiang, Haihao
  0 siblings, 0 replies; 31+ messages in thread
From: Xiang, Haihao @ 2022-10-31  5:55 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz

On Mon, 2022-10-10 at 10:54 +0000, softworkz wrote:
> From: softworkz <softworkz@hotmail.com>
> 
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>  libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
>  1 file changed, 1 insertion(+), 29 deletions(-)
> 
> diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
> index 3e6a0de13f..218daf571f 100644
> --- a/libavfilter/vf_overlay_vaapi.c
> +++ b/libavfilter/vf_overlay_vaapi.c
> @@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
>      float            alpha;
>  } OverlayVAAPIContext;
>  
> -static int overlay_vaapi_query_formats(AVFilterContext *ctx)
> -{
> -    int ret;
> -    enum {
> -        MAIN    = 0,
> -        OVERLAY = 1,
> -    };
> -
> -    static const enum AVPixelFormat pix_fmts[] = {
> -        AV_PIX_FMT_VAAPI,
> -        AV_PIX_FMT_NONE
> -    };
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]-
> >outcfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx-
> >inputs[OVERLAY]->outcfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]-
> >incfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    return 0;
> -}
> -
>  static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
>  {
>      VAAPIVPPContext *vpp_ctx   = avctx->priv;
> @@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
>      .activate        = &overlay_vaapi_activate,
>      FILTER_INPUTS(overlay_vaapi_inputs),
>      FILTER_OUTPUTS(overlay_vaapi_outputs),
> -    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
> +    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
>      .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
>  };

Patchset LGTM except a nitpicky comment about coding style in patch 09/11. 

Thanks
Haihao

_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters
  2022-10-31  5:43   ` Xiang, Haihao
@ 2022-10-31  5:56     ` Soft Works
  0 siblings, 0 replies; 31+ messages in thread
From: Soft Works @ 2022-10-31  5:56 UTC (permalink / raw)
  To: Xiang, Haihao, ffmpeg-devel



> -----Original Message-----
> From: Xiang, Haihao <haihao.xiang@intel.com>
> Sent: Monday, October 31, 2022 6:44 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: softworkz@hotmail.com
> Subject: Re: [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi:
> enable expressions for overlay parameters
> 
> On Mon, 2022-10-10 at 10:54 +0000, softworkz wrote:
> > From: softworkz <softworkz@hotmail.com>
> >
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> >  libavfilter/vf_overlay_vaapi.c | 141
> +++++++++++++++++++++++++++++----
> >  1 file changed, 127 insertions(+), 14 deletions(-)
> >
> > diff --git a/libavfilter/vf_overlay_vaapi.c
> b/libavfilter/vf_overlay_vaapi.c
> > index b2c254d9dd..7be7d52589 100644
> > --- a/libavfilter/vf_overlay_vaapi.c
> > +++ b/libavfilter/vf_overlay_vaapi.c
> > @@ -27,19 +27,106 @@
> >  #include "formats.h"
> >  #include "internal.h"
> >  #include "vaapi_vpp.h"
> > +#include "libavutil/eval.h"
> > +
> > +enum var_name {
> > +    VAR_MAIN_iW,     VAR_MW,
> > +    VAR_MAIN_iH,     VAR_MH,
> > +    VAR_OVERLAY_iW,
> > +    VAR_OVERLAY_iH,
> 
> It is better not to mix capital and lower-case letters here, (I have
> a patch to
> change the var_name in qsv)

Yea - I had done it equal to overlay_qsv.
I'll change it, no problem.

Thanks,
softworkz
_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay
  2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                   ` (10 preceding siblings ...)
  2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz
@ 2022-10-31  6:19 ` ffmpegagent
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
                     ` (10 more replies)
  11 siblings, 11 replies; 31+ messages in thread
From: ffmpegagent @ 2022-10-31  6:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

This patchset resolves a number of issues in the current code:

 * Bogus doubles framesync initialization
 * Executing build_parameters on each input frame
 * Segfault when there's no secondary input (yet)

and adds a number of enhancements to bring this on-par with the other
overlay filters:

 * Enable pixel alpha blending
 * Expose framesync parameters
 * Add support for expressions in overlay parameters (x, y, w, h)

v2 Changes:

 * Changed var names to all-caps
 * Added note about defaults for w/h to filters.texi

softworkz (11):
  avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  avfilter/overlay_vaapi: build filter params just once
  avfilter/overlay_vaapi: remove double framesync init
  avfilter/overlay_vaapi: handle secondary null input
  avfilter/overlay_vaapi: reformat options
  avfilter/overlay_vaapi: remove redundant .get_buffer assignments
  avfilter/overlay_vaapi: add framesync options
  avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
  avfilter/overlay_vaapi: enable expressions for overlay parameters
  doc/filters.texi: remove incorrect statement
  doc/filters.texi: update overlay_vaapi documentation

 doc/filters.texi               |  52 ++++--
 libavfilter/vf_overlay_vaapi.c | 328 ++++++++++++++++++++++-----------
 2 files changed, 259 insertions(+), 121 deletions(-)


base-commit: f3b5277057ad84071721f01419fe4badeceaff08
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-42%2Fsoftworkz%2Fsubmit_vaapi_overlay-v2
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-42/softworkz/submit_vaapi_overlay-v2
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/42

Range-diff vs v1:

  1:  6ec5e9960b =  1:  6ec5e9960b avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  2:  3c1629de97 =  2:  3c1629de97 avfilter/overlay_vaapi: build filter params just once
  3:  2bd535abb5 =  3:  2bd535abb5 avfilter/overlay_vaapi: remove double framesync init
  4:  fb365de036 =  4:  fb365de036 avfilter/overlay_vaapi: handle secondary null input
  5:  6624c66688 =  5:  6624c66688 avfilter/overlay_vaapi: reformat options
  6:  989f16597e =  6:  989f16597e avfilter/overlay_vaapi: remove redundant .get_buffer assignments
  7:  5ff8f82002 =  7:  5ff8f82002 avfilter/overlay_vaapi: add framesync options
  8:  4fba07d9f9 =  8:  4fba07d9f9 avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
  9:  36ed7b96eb !  9:  20b9e9c992 avfilter/overlay_vaapi: enable expressions for overlay parameters
     @@ libavfilter/vf_overlay_vaapi.c
      +#include "libavutil/eval.h"
      +
      +enum var_name {
     -+    VAR_MAIN_iW,     VAR_MW,
     -+    VAR_MAIN_iH,     VAR_MH,
     -+    VAR_OVERLAY_iW,
     -+    VAR_OVERLAY_iH,
     ++    VAR_MAIN_IW,     VAR_MW,
     ++    VAR_MAIN_IH,     VAR_MH,
     ++    VAR_OVERLAY_IW,
     ++    VAR_OVERLAY_IH,
      +    VAR_OVERLAY_X,  VAR_OX,
      +    VAR_OVERLAY_Y,  VAR_OY,
      +    VAR_OVERLAY_W,  VAR_OW,
     @@ libavfilter/vf_overlay_vaapi.c: static int have_alpha_planar(AVFilterLink *link)
      +    AVFilterContext  *avctx  = inlink->dst;
      +    OverlayVAAPIContext *ctx = avctx->priv;
      +
     -+    ctx->var_values[VAR_MAIN_iW] =
     ++    ctx->var_values[VAR_MAIN_IW] =
      +    ctx->var_values[VAR_MW]      = inlink->w;
     -+    ctx->var_values[VAR_MAIN_iH] =
     ++    ctx->var_values[VAR_MAIN_IH] =
      +    ctx->var_values[VAR_MH]      = inlink->h;
      +
      +    return ff_vaapi_vpp_config_input(inlink);
     @@ libavfilter/vf_overlay_vaapi.c: static int have_alpha_planar(AVFilterLink *link)
           OverlayVAAPIContext *ctx = avctx->priv;
      +    int ret;
      +
     -+    ctx->var_values[VAR_OVERLAY_iW] = inlink->w;
     -+    ctx->var_values[VAR_OVERLAY_iH] = inlink->h;
     ++    ctx->var_values[VAR_OVERLAY_IW] = inlink->w;
     ++    ctx->var_values[VAR_OVERLAY_IH] = inlink->h;
      +
      +    ret = eval_expr(avctx);
      +    if (ret < 0)
 10:  3618b3e941 = 10:  be57f70a9d doc/filters.texi: remove incorrect statement
 11:  675b5279c3 ! 11:  b3ea03e037 doc/filters.texi: update overlay_vaapi documentation
     @@ doc/filters.texi: It takes two inputs and has one output. The first input is the
      +Set expressions for the width and height the overlaid video
      +on the main video.
      +
     ++Default values are 'overlay_iw' for 'w' and 'overlay_ih*w/overlay_iw' for 'h'.
     ++
      +The expressions can contain the following parameters:
      +
      +@table @option

-- 
ffmpeg-codebot
_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
@ 2022-10-31  6:19   ` softworkz
  2022-11-04  2:07     ` Xiang, Haihao
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 02/11] avfilter/overlay_vaapi: build filter params just once softworkz
                     ` (9 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: softworkz @ 2022-10-31  6:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 3e6a0de13f..218daf571f 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
     float            alpha;
 } OverlayVAAPIContext;
 
-static int overlay_vaapi_query_formats(AVFilterContext *ctx)
-{
-    int ret;
-    enum {
-        MAIN    = 0,
-        OVERLAY = 1,
-    };
-
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_VAAPI,
-        AV_PIX_FMT_NONE
-    };
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]->outcfg.formats);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[OVERLAY]->outcfg.formats);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]->incfg.formats);
-    if (ret < 0)
-        return ret;
-
-    return 0;
-}
-
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
 {
     VAAPIVPPContext *vpp_ctx   = avctx->priv;
@@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
     .activate        = &overlay_vaapi_activate,
     FILTER_INPUTS(overlay_vaapi_inputs),
     FILTER_OUTPUTS(overlay_vaapi_outputs),
-    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
+    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
 };
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 02/11] avfilter/overlay_vaapi: build filter params just once
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
@ 2022-10-31  6:19   ` softworkz
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 03/11] avfilter/overlay_vaapi: remove double framesync init softworkz
                     ` (8 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 218daf571f..cf17426b5d 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -181,10 +181,6 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
     VARectangle overlay_region, output_region;
     int err;
 
-    err = overlay_vaapi_build_filter_params(avctx);
-    if (err < 0)
-        return err;
-
     err = ff_framesync_get_frame(fs, 0, &input_main, 0);
     if (err < 0)
         return err;
@@ -309,6 +305,10 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     if (err < 0)
         return err;
 
+    err = overlay_vaapi_build_filter_params(avctx);
+    if (err < 0)
+        return err;
+
     err = ff_framesync_init_dualinput(&ctx->fs, avctx);
     if (err < 0)
         return err;
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 03/11] avfilter/overlay_vaapi: remove double framesync init
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 02/11] avfilter/overlay_vaapi: build filter params just once softworkz
@ 2022-10-31  6:19   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 04/11] avfilter/overlay_vaapi: handle secondary null input softworkz
                     ` (7 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 31 +++++--------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index cf17426b5d..66e736cce4 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -265,28 +265,6 @@ fail:
     return err;
 }
 
-static int overlay_vaapi_init_framesync(AVFilterContext *avctx)
-{
-    OverlayVAAPIContext *ctx = avctx->priv;
-    int ret, i;
-
-    ctx->fs.on_event = overlay_vaapi_blend;
-    ctx->fs.opaque   = ctx;
-    ret = ff_framesync_init(&ctx->fs, avctx, avctx->nb_inputs);
-    if (ret < 0)
-        return ret;
-
-    for (i = 0; i < avctx->nb_inputs; i++) {
-        FFFrameSyncIn *in = &ctx->fs.in[i];
-        in->before    = EXT_STOP;
-        in->after     = EXT_INFINITY;
-        in->sync      = i ? 1 : 2;
-        in->time_base = avctx->inputs[i]->time_base;
-    }
-
-    return ff_framesync_configure(&ctx->fs);
-}
-
 static int overlay_vaapi_config_output(AVFilterLink *outlink)
 {
     AVFilterContext  *avctx  = outlink->src;
@@ -294,10 +272,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     VAAPIVPPContext *vpp_ctx = avctx->priv;
     int err;
 
-    err = overlay_vaapi_init_framesync(avctx);
-    if (err < 0)
-        return err;
-
+    outlink->time_base = avctx->inputs[0]->time_base;
     vpp_ctx->output_width  = avctx->inputs[0]->w;
     vpp_ctx->output_height = avctx->inputs[0]->h;
 
@@ -313,6 +288,10 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     if (err < 0)
         return err;
 
+    ctx->fs.on_event  = overlay_vaapi_blend;
+    ctx->fs.opaque    = ctx;
+    ctx->fs.time_base = outlink->time_base;
+
     return ff_framesync_configure(&ctx->fs);
 }
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 04/11] avfilter/overlay_vaapi: handle secondary null input
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (2 preceding siblings ...)
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 03/11] avfilter/overlay_vaapi: remove double framesync init softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 05/11] avfilter/overlay_vaapi: reformat options softworkz
                     ` (6 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Currently segfaults in this case.

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 94 ++++++++++++++++++----------------
 1 file changed, 49 insertions(+), 45 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 66e736cce4..1281038c36 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -106,18 +106,6 @@ static int overlay_vaapi_render_picture(AVFilterContext *avctx,
            params_id);
 
 
-    vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
-                         VAProcPipelineParameterBufferType,
-                         sizeof(*subpic_params), 1, subpic_params, &subpic_params_id);
-    if (vas != VA_STATUS_SUCCESS) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: "
-               "%d (%s).\n", vas, vaErrorStr(vas));
-        err = AVERROR(EIO);
-        goto fail_after_begin;
-    }
-    av_log(avctx, AV_LOG_DEBUG, "Pipeline subpic parameter buffer is %#x.\n",
-           subpic_params_id);
-
     vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context,
                           &params_id, 1);
     if (vas != VA_STATUS_SUCCESS) {
@@ -127,13 +115,27 @@ static int overlay_vaapi_render_picture(AVFilterContext *avctx,
         goto fail_after_begin;
     }
 
-    vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context,
-                          &subpic_params_id, 1);
-    if (vas != VA_STATUS_SUCCESS) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to render subpic parameter buffer: "
-               "%d (%s).\n", vas, vaErrorStr(vas));
-        err = AVERROR(EIO);
-        goto fail_after_begin;
+    if (subpic_params) {
+        vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
+                             VAProcPipelineParameterBufferType,
+                             sizeof(*subpic_params), 1, subpic_params, &subpic_params_id);
+        if (vas != VA_STATUS_SUCCESS) {
+            av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: "
+                   "%d (%s).\n", vas, vaErrorStr(vas));
+            err = AVERROR(EIO);
+            goto fail_after_begin;
+        }
+        av_log(avctx, AV_LOG_DEBUG, "Pipeline subpic parameter buffer is %#x.\n",
+               subpic_params_id);
+
+        vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context,
+                              &subpic_params_id, 1);
+        if (vas != VA_STATUS_SUCCESS) {
+            av_log(avctx, AV_LOG_ERROR, "Failed to render subpic parameter buffer: "
+                   "%d (%s).\n", vas, vaErrorStr(vas));
+            err = AVERROR(EIO);
+            goto fail_after_begin;
+        }
     }
 
     vas = vaEndPicture(ctx->hwctx->display, ctx->va_context);
@@ -177,7 +179,7 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
     AVFrame *input_main, *input_overlay;
     AVFrame *output;
     VAProcPipelineParameterBuffer params, subpic_params;
-    VABlendState blend_state; /**< Blend State */
+    VABlendState blend_state = { 0 }; /**< Blend State */
     VARectangle overlay_region, output_region;
     int err;
 
@@ -192,10 +194,6 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
            av_get_pix_fmt_name(input_main->format),
            input_main->width, input_main->height, input_main->pts);
 
-    av_log(avctx, AV_LOG_DEBUG, "Filter overlay: %s, %ux%u (%"PRId64").\n",
-           av_get_pix_fmt_name(input_overlay->format),
-           input_overlay->width, input_overlay->height, input_overlay->pts);
-
     if (vpp_ctx->va_context == VA_INVALID_ID)
         return AVERROR(EINVAL);
 
@@ -214,13 +212,6 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
     if (err < 0)
         goto fail;
 
-    overlay_region = (VARectangle) {
-        .x      = ctx->overlay_ox,
-        .y      = ctx->overlay_oy,
-        .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width,
-        .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height,
-    };
-
     output_region = (VARectangle) {
         .x      = 0,
         .y      = 0,
@@ -228,29 +219,42 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
         .height = output->height,
     };
 
-    if (overlay_region.x + overlay_region.width > input_main->width ||
-        overlay_region.y + overlay_region.height > input_main->height) {
-        av_log(ctx, AV_LOG_WARNING,
-               "The overlay image exceeds the scope of the main image, "
-               "will crop the overlay image according based on the main image.\n");
-    }
-
     params.filters     = &vpp_ctx->filter_buffers[0];
     params.num_filters = vpp_ctx->nb_filter_buffers;
 
     params.output_region = &output_region;
     params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
 
-    memcpy(&subpic_params, &params, sizeof(subpic_params));
+    if (input_overlay) {
+        av_log(avctx, AV_LOG_DEBUG, "Filter overlay: %s, %ux%u (%"PRId64").\n",
+               av_get_pix_fmt_name(input_overlay->format),
+               input_overlay->width, input_overlay->height, input_overlay->pts);
+
+        overlay_region = (VARectangle) {
+            .x      = ctx->overlay_ox,
+            .y      = ctx->overlay_oy,
+            .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width,
+            .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height,
+        };
+
+        if (overlay_region.x + overlay_region.width > input_main->width ||
+            overlay_region.y + overlay_region.height > input_main->height) {
+            av_log(ctx, AV_LOG_WARNING,
+                   "The overlay image exceeds the scope of the main image, "
+                   "will crop the overlay image according based on the main image.\n");
+        }
+
+        memcpy(&subpic_params, &params, sizeof(subpic_params));
 
-    blend_state.flags = VA_BLEND_GLOBAL_ALPHA;
-    blend_state.global_alpha = ctx->alpha;
-    subpic_params.blend_state = &blend_state;
+        blend_state.flags         = VA_BLEND_GLOBAL_ALPHA;
+        blend_state.global_alpha  = ctx->alpha;
+        subpic_params.blend_state = &blend_state;
 
-    subpic_params.surface = (VASurfaceID)(uintptr_t)input_overlay->data[3];
-    subpic_params.output_region = &overlay_region;
+        subpic_params.surface       = (VASurfaceID)(uintptr_t)input_overlay->data[3];
+        subpic_params.output_region = &overlay_region;
+    }
 
-    err = overlay_vaapi_render_picture(avctx, &params, &subpic_params, output);
+    err = overlay_vaapi_render_picture(avctx, &params, input_overlay ? &subpic_params : NULL, output);
     if (err < 0)
         goto fail;
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 05/11] avfilter/overlay_vaapi: reformat options
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (3 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 04/11] avfilter/overlay_vaapi: handle secondary null input softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments softworkz
                     ` (5 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 1281038c36..c14aacbb5d 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -326,16 +326,11 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 static const AVOption overlay_vaapi_options[] = {
-    { "x", "Overlay x position",
-      OFFSET(overlay_ox), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "y", "Overlay y position",
-      OFFSET(overlay_oy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "w", "Overlay width",
-      OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "h", "Overlay height",
-      OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "alpha", "Overlay global alpha",
-      OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 1.0}, 0.0, 1.0, .flags = FLAGS},
+    { "x", "Overlay x position",       OFFSET(overlay_ox), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "y", "Overlay y position",       OFFSET(overlay_oy), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "w", "Overlay width",            OFFSET(overlay_ow), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "h", "Overlay height",           OFFSET(overlay_oh), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
+    { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
     { NULL },
 };
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (4 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 05/11] avfilter/overlay_vaapi: reformat options softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 07/11] avfilter/overlay_vaapi: add framesync options softworkz
                     ` (4 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index c14aacbb5d..71fc90a86b 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -340,13 +340,11 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
     {
         .name             = "main",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .get_buffer.video = ff_default_get_video_buffer,
         .config_props     = &ff_vaapi_vpp_config_input,
     },
     {
         .name             = "overlay",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .get_buffer.video = ff_default_get_video_buffer,
     },
 };
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 07/11] avfilter/overlay_vaapi: add framesync options
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (5 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha softworkz
                     ` (3 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 71fc90a86b..f4f9cc58ec 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -292,8 +292,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
     if (err < 0)
         return err;
 
-    ctx->fs.on_event  = overlay_vaapi_blend;
-    ctx->fs.opaque    = ctx;
+    ctx->fs.on_event = overlay_vaapi_blend;
     ctx->fs.time_base = outlink->time_base;
 
     return ff_framesync_configure(&ctx->fs);
@@ -321,6 +320,7 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
     OverlayVAAPIContext *ctx = avctx->priv;
 
     ff_framesync_uninit(&ctx->fs);
+    ff_vaapi_vpp_ctx_uninit(avctx);
 }
 
 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
@@ -331,10 +331,18 @@ static const AVOption overlay_vaapi_options[] = {
     { "w", "Overlay width",            OFFSET(overlay_ow), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
     { "h", "Overlay height",           OFFSET(overlay_oh), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
     { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
+    { "eof_action", "Action to take when encountering EOF from secondary input ",
+        OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
+        EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
+        { "repeat", "Repeat the previous frame.",   0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
+        { "endall", "End both streams.",            0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
+        { "pass",   "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS },   .flags = FLAGS, "eof_action" },
+    { "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest),   AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
+    { "repeatlast", "repeat overlay of the last overlay frame",           OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
     { NULL },
 };
 
-AVFILTER_DEFINE_CLASS(overlay_vaapi);
+FRAMESYNC_DEFINE_CLASS(overlay_vaapi, OverlayVAAPIContext, fs);
 
 static const AVFilterPad overlay_vaapi_inputs[] = {
     {
@@ -364,6 +372,7 @@ const AVFilter ff_vf_overlay_vaapi = {
     .init            = &overlay_vaapi_init,
     .uninit          = &overlay_vaapi_uninit,
     .activate        = &overlay_vaapi_activate,
+    .preinit         = overlay_vaapi_framesync_preinit,
     FILTER_INPUTS(overlay_vaapi_inputs),
     FILTER_OUTPUTS(overlay_vaapi_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (6 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 07/11] avfilter/overlay_vaapi: add framesync options softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
                     ` (2 subsequent siblings)
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 44 ++++++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index f4f9cc58ec..b2c254d9dd 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -36,6 +36,8 @@ typedef struct OverlayVAAPIContext {
     int              overlay_ow;
     int              overlay_oh;
     float            alpha;
+    unsigned int     blend_flags;
+    float            blend_alpha;
 } OverlayVAAPIContext;
 
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
@@ -246,8 +248,8 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
 
         memcpy(&subpic_params, &params, sizeof(subpic_params));
 
-        blend_state.flags         = VA_BLEND_GLOBAL_ALPHA;
-        blend_state.global_alpha  = ctx->alpha;
+        blend_state.flags         = ctx->blend_flags;
+        blend_state.global_alpha  = ctx->blend_alpha;
         subpic_params.blend_state = &blend_state;
 
         subpic_params.surface       = (VASurfaceID)(uintptr_t)input_overlay->data[3];
@@ -269,6 +271,43 @@ fail:
     return err;
 }
 
+static int have_alpha_planar(AVFilterLink *link)
+{
+    enum AVPixelFormat pix_fmt = link->format;
+    const AVPixFmtDescriptor *desc;
+    AVHWFramesContext *fctx;
+
+    if (link->format == AV_PIX_FMT_VAAPI) {
+        fctx    = (AVHWFramesContext *)link->hw_frames_ctx->data;
+        pix_fmt = fctx->sw_format;
+    }
+
+    desc = av_pix_fmt_desc_get(pix_fmt);
+    if (!desc)
+        return 0;
+
+    return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
+}
+
+static int overlay_vaapi_config_input_overlay(AVFilterLink *inlink)
+{
+    AVFilterContext  *avctx  = inlink->dst;
+    OverlayVAAPIContext *ctx = avctx->priv;
+
+    ctx->blend_flags = 0;
+    ctx->blend_alpha = 1.0f;
+
+    if (ctx->alpha < 1.0f) {
+        ctx->blend_flags |= VA_BLEND_GLOBAL_ALPHA;
+        ctx->blend_alpha  = ctx->alpha;
+    }
+
+    if (have_alpha_planar(inlink))
+        ctx->blend_flags |= VA_BLEND_PREMULTIPLIED_ALPHA;
+
+    return 0;
+}
+
 static int overlay_vaapi_config_output(AVFilterLink *outlink)
 {
     AVFilterContext  *avctx  = outlink->src;
@@ -353,6 +392,7 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
     {
         .name             = "overlay",
         .type             = AVMEDIA_TYPE_VIDEO,
+        .config_props     = overlay_vaapi_config_input_overlay,
     },
 };
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (7 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 10/11] doc/filters.texi: remove incorrect statement softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 141 +++++++++++++++++++++++++++++----
 1 file changed, 127 insertions(+), 14 deletions(-)

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index b2c254d9dd..307f3cf7fc 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -27,19 +27,106 @@
 #include "formats.h"
 #include "internal.h"
 #include "vaapi_vpp.h"
+#include "libavutil/eval.h"
+
+enum var_name {
+    VAR_MAIN_IW,     VAR_MW,
+    VAR_MAIN_IH,     VAR_MH,
+    VAR_OVERLAY_IW,
+    VAR_OVERLAY_IH,
+    VAR_OVERLAY_X,  VAR_OX,
+    VAR_OVERLAY_Y,  VAR_OY,
+    VAR_OVERLAY_W,  VAR_OW,
+    VAR_OVERLAY_H,  VAR_OH,
+    VAR_VARS_NB
+};
 
 typedef struct OverlayVAAPIContext {
     VAAPIVPPContext  vpp_ctx; /**< must be the first field */
     FFFrameSync      fs;
-    int              overlay_ox;
-    int              overlay_oy;
-    int              overlay_ow;
-    int              overlay_oh;
+
+    double           var_values[VAR_VARS_NB];
+    char             *overlay_ox;
+    char             *overlay_oy;
+    char             *overlay_ow;
+    char             *overlay_oh;
+    int              ox;
+    int              oy;
+    int              ow;
+    int              oh;
     float            alpha;
     unsigned int     blend_flags;
     float            blend_alpha;
 } OverlayVAAPIContext;
 
+static const char *const var_names[] = {
+    "main_w",     "W",   /* input width of the main layer */
+    "main_h",     "H",   /* input height of the main layer */
+    "overlay_iw",        /* input width of the overlay layer */
+    "overlay_ih",        /* input height of the overlay layer */
+    "overlay_x",  "x",   /* x position of the overlay layer inside of main */
+    "overlay_y",  "y",   /* y position of the overlay layer inside of main */
+    "overlay_w",  "w",   /* output width of overlay layer */
+    "overlay_h",  "h",   /* output height of overlay layer */
+    NULL
+};
+
+static int eval_expr(AVFilterContext *avctx)
+{
+    OverlayVAAPIContext *ctx = avctx->priv;
+    double       *var_values = ctx->var_values;
+    int                  ret = 0;
+    AVExpr *ox_expr = NULL, *oy_expr = NULL;
+    AVExpr *ow_expr = NULL, *oh_expr = NULL;
+
+#define PARSE_EXPR(e, s) {\
+    ret = av_expr_parse(&(e), s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \
+    if (ret < 0) {\
+        av_log(ctx, AV_LOG_ERROR, "Error when parsing '%s'.\n", s);\
+        goto release;\
+    }\
+}
+    PARSE_EXPR(ox_expr, ctx->overlay_ox)
+    PARSE_EXPR(oy_expr, ctx->overlay_oy)
+    PARSE_EXPR(ow_expr, ctx->overlay_ow)
+    PARSE_EXPR(oh_expr, ctx->overlay_oh)
+#undef PASS_EXPR
+
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_H] =
+    var_values[VAR_OH]        = av_expr_eval(oh_expr, var_values, NULL);
+
+    /* calc again in case ow is relative to oh */
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+
+    var_values[VAR_OVERLAY_X] =
+    var_values[VAR_OX]        = av_expr_eval(ox_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_Y] =
+    var_values[VAR_OY]        = av_expr_eval(oy_expr, var_values, NULL);
+
+    /* calc again in case ox is relative to oy */
+    var_values[VAR_OVERLAY_X] =
+    var_values[VAR_OX]        = av_expr_eval(ox_expr, var_values, NULL);
+
+    /* calc overlay_w and overlay_h again incase relative to ox,oy */
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_H] =
+    var_values[VAR_OH]        = av_expr_eval(oh_expr, var_values, NULL);
+    var_values[VAR_OVERLAY_W] =
+    var_values[VAR_OW]        = av_expr_eval(ow_expr, var_values, NULL);
+
+release:
+    av_expr_free(ox_expr);
+    av_expr_free(oy_expr);
+    av_expr_free(ow_expr);
+    av_expr_free(oh_expr);
+
+    return ret;
+}
+
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
 {
     VAAPIVPPContext *vpp_ctx   = avctx->priv;
@@ -233,10 +320,10 @@ static int overlay_vaapi_blend(FFFrameSync *fs)
                input_overlay->width, input_overlay->height, input_overlay->pts);
 
         overlay_region = (VARectangle) {
-            .x      = ctx->overlay_ox,
-            .y      = ctx->overlay_oy,
-            .width  = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width,
-            .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height,
+            .x      = ctx->ox,
+            .y      = ctx->oy,
+            .width  = ctx->ow ? ctx->ow : input_overlay->width,
+            .height = ctx->oh ? ctx->oh : input_overlay->height,
         };
 
         if (overlay_region.x + overlay_region.width > input_main->width ||
@@ -289,10 +376,36 @@ static int have_alpha_planar(AVFilterLink *link)
     return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
 }
 
+static int overlay_vaapi_config_input_main(AVFilterLink *inlink)
+{
+    AVFilterContext  *avctx  = inlink->dst;
+    OverlayVAAPIContext *ctx = avctx->priv;
+
+    ctx->var_values[VAR_MAIN_IW] =
+    ctx->var_values[VAR_MW]      = inlink->w;
+    ctx->var_values[VAR_MAIN_IH] =
+    ctx->var_values[VAR_MH]      = inlink->h;
+
+    return ff_vaapi_vpp_config_input(inlink);
+}
+
 static int overlay_vaapi_config_input_overlay(AVFilterLink *inlink)
 {
     AVFilterContext  *avctx  = inlink->dst;
     OverlayVAAPIContext *ctx = avctx->priv;
+    int ret;
+
+    ctx->var_values[VAR_OVERLAY_IW] = inlink->w;
+    ctx->var_values[VAR_OVERLAY_IH] = inlink->h;
+
+    ret = eval_expr(avctx);
+    if (ret < 0)
+        return ret;
+
+    ctx->ox = (int)ctx->var_values[VAR_OX];
+    ctx->oy = (int)ctx->var_values[VAR_OY];
+    ctx->ow = (int)ctx->var_values[VAR_OW];
+    ctx->oh = (int)ctx->var_values[VAR_OH];
 
     ctx->blend_flags = 0;
     ctx->blend_alpha = 1.0f;
@@ -365,11 +478,11 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 static const AVOption overlay_vaapi_options[] = {
-    { "x", "Overlay x position",       OFFSET(overlay_ox), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "y", "Overlay y position",       OFFSET(overlay_oy), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "w", "Overlay width",            OFFSET(overlay_ow), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "h", "Overlay height",           OFFSET(overlay_oh), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX, .flags = FLAGS },
-    { "alpha", "Overlay global alpha", OFFSET(alpha),      AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0,   .flags = FLAGS },
+    { "x", "Overlay x position", OFFSET(overlay_ox),   AV_OPT_TYPE_STRING, { .str="0"}, 0, 255,          .flags = FLAGS},
+    { "y", "Overlay y position", OFFSET(overlay_oy),   AV_OPT_TYPE_STRING, { .str="0"}, 0, 255,          .flags = FLAGS},
+    { "w", "Overlay width",      OFFSET(overlay_ow),   AV_OPT_TYPE_STRING, { .str="overlay_iw"}, 0, 255, .flags = FLAGS},
+    { "h", "Overlay height",     OFFSET(overlay_oh),   AV_OPT_TYPE_STRING, { .str="overlay_ih*w/overlay_iw"}, 0, 255, .flags = FLAGS},
+    { "alpha", "Overlay global alpha", OFFSET(alpha),  AV_OPT_TYPE_FLOAT,  { .dbl = 1.0 }, 0.0, 1.0,      .flags = FLAGS },
     { "eof_action", "Action to take when encountering EOF from secondary input ",
         OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
         EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
@@ -387,7 +500,7 @@ static const AVFilterPad overlay_vaapi_inputs[] = {
     {
         .name             = "main",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = &ff_vaapi_vpp_config_input,
+        .config_props     = overlay_vaapi_config_input_main,
     },
     {
         .name             = "overlay",
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 10/11] doc/filters.texi: remove incorrect statement
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (8 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
@ 2022-10-31  6:20   ` softworkz
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 doc/filters.texi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 68205147f0..2d0b5db909 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -26267,7 +26267,6 @@ To use vaapi filters, you need to setup the vaapi device correctly. For more inf
 Overlay one video on the top of another.
 
 It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid.
-This filter requires same memory layout for all the inputs. So, format conversion may be needed.
 
 The filter accepts the following options:
 
-- 
ffmpeg-codebot

_______________________________________________
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] 31+ messages in thread

* [FFmpeg-devel] [PATCH v2 11/11] doc/filters.texi: update overlay_vaapi documentation
  2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
                     ` (9 preceding siblings ...)
  2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 10/11] doc/filters.texi: remove incorrect statement softworkz
@ 2022-10-31  6:20   ` softworkz
  10 siblings, 0 replies; 31+ messages in thread
From: softworkz @ 2022-10-31  6:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, Xiang, Haihao, Gyan Doshi

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 doc/filters.texi | 51 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 2d0b5db909..1d50db0e54 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -26271,30 +26271,59 @@ It takes two inputs and has one output. The first input is the "main" video on w
 The filter accepts the following options:
 
 @table @option
-
 @item x
-Set the x coordinate of the overlaid video on the main video.
-Default value is @code{0}.
-
 @item y
-Set the y coordinate of the overlaid video on the main video.
-Default value is @code{0}.
+Set expressions for the x and y coordinates of the overlaid video
+on the main video.
 
-@item w
-Set the width of the overlaid video on the main video.
-Default value is the width of input overlay video.
+Default value is "0" for both expressions.
 
+@item w
 @item h
-Set the height of the overlaid video on the main video.
-Default value is the height of input overlay video.
+Set expressions for the width and height the overlaid video
+on the main video.
+
+Default values are 'overlay_iw' for 'w' and 'overlay_ih*w/overlay_iw' for 'h'.
+
+The expressions can contain the following parameters:
+
+@table @option
+
+@item main_w, W
+@item main_h, H
+The main input width and height.
+
+@item overlay_iw
+@item overlay_ih
+The overlay input width and height.
+
+@item overlay_w, w
+@item overlay_h, h
+The overlay output width and height.
+
+@item overlay_x, x
+@item overlay_y, y
+Position of the overlay layer inside of main
+
+@end table
 
 @item alpha
 Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
 Higher value means lower transparency.
 Default value is @code{1.0}.
 
+@item eof_action
+See @ref{framesync}.
+
+@item shortest
+See @ref{framesync}.
+
+@item repeatlast
+See @ref{framesync}.
+
 @end table
 
+This filter also supports the @ref{framesync} options.
 @subsection Examples
 
 @itemize
-- 
ffmpeg-codebot
_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
@ 2022-11-04  2:07     ` Xiang, Haihao
  2022-11-07  3:10       ` Xiang, Haihao
  0 siblings, 1 reply; 31+ messages in thread
From: Xiang, Haihao @ 2022-11-04  2:07 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, haihao.xiang-at-intel.com, ffmpeg

On Mon, 2022-10-31 at 06:19 +0000, softworkz wrote:
> From: softworkz <softworkz@hotmail.com>
> 
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>  libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
>  1 file changed, 1 insertion(+), 29 deletions(-)
> 
> diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
> index 3e6a0de13f..218daf571f 100644
> --- a/libavfilter/vf_overlay_vaapi.c
> +++ b/libavfilter/vf_overlay_vaapi.c
> @@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
>      float            alpha;
>  } OverlayVAAPIContext;
>  
> -static int overlay_vaapi_query_formats(AVFilterContext *ctx)
> -{
> -    int ret;
> -    enum {
> -        MAIN    = 0,
> -        OVERLAY = 1,
> -    };
> -
> -    static const enum AVPixelFormat pix_fmts[] = {
> -        AV_PIX_FMT_VAAPI,
> -        AV_PIX_FMT_NONE
> -    };
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]-
> >outcfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx-
> >inputs[OVERLAY]->outcfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]-
> >incfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    return 0;
> -}
> -
>  static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
>  {
>      VAAPIVPPContext *vpp_ctx   = avctx->priv;
> @@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
>      .activate        = &overlay_vaapi_activate,
>      FILTER_INPUTS(overlay_vaapi_inputs),
>      FILTER_OUTPUTS(overlay_vaapi_outputs),
> -    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
> +    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
>      .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
>  };

Patchset LGTM, will apply

-Haihao

_______________________________________________
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] 31+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT
  2022-11-04  2:07     ` Xiang, Haihao
@ 2022-11-07  3:10       ` Xiang, Haihao
  0 siblings, 0 replies; 31+ messages in thread
From: Xiang, Haihao @ 2022-11-07  3:10 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: softworkz, haihao.xiang-at-intel.com, ffmpeg

On Fri, 2022-11-04 at 02:07 +0000, Xiang, Haihao wrote:
> On Mon, 2022-10-31 at 06:19 +0000, softworkz wrote:
> > From: softworkz <softworkz@hotmail.com>
> > 
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> >  libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
> >  1 file changed, 1 insertion(+), 29 deletions(-)
> > 
> > diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
> > index 3e6a0de13f..218daf571f 100644
> > --- a/libavfilter/vf_overlay_vaapi.c
> > +++ b/libavfilter/vf_overlay_vaapi.c
> > @@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
> >      float            alpha;
> >  } OverlayVAAPIContext;
> >  
> > -static int overlay_vaapi_query_formats(AVFilterContext *ctx)
> > -{
> > -    int ret;
> > -    enum {
> > -        MAIN    = 0,
> > -        OVERLAY = 1,
> > -    };
> > -
> > -    static const enum AVPixelFormat pix_fmts[] = {
> > -        AV_PIX_FMT_VAAPI,
> > -        AV_PIX_FMT_NONE
> > -    };
> > -
> > -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]-
> > > outcfg.formats);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx-
> > > inputs[OVERLAY]->outcfg.formats);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]-
> > > incfg.formats);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    return 0;
> > -}
> > -
> >  static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
> >  {
> >      VAAPIVPPContext *vpp_ctx   = avctx->priv;
> > @@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
> >      .activate        = &overlay_vaapi_activate,
> >      FILTER_INPUTS(overlay_vaapi_inputs),
> >      FILTER_OUTPUTS(overlay_vaapi_outputs),
> > -    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
> > +    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
> >      .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
> >  };
> 
> Patchset LGTM, will apply
> 

Pushed,

-Haihao

_______________________________________________
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] 31+ messages in thread

end of thread, other threads:[~2022-11-07  3:10 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 10:54 [FFmpeg-devel] [PATCH 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
2022-10-31  5:55   ` Xiang, Haihao
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 02/11] avfilter/overlay_vaapi: build filter params just once softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 03/11] avfilter/overlay_vaapi: remove double framesync init softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 04/11] avfilter/overlay_vaapi: handle secondary null input softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 05/11] avfilter/overlay_vaapi: reformat options softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 07/11] avfilter/overlay_vaapi: add framesync options softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
2022-10-31  5:43   ` Xiang, Haihao
2022-10-31  5:56     ` Soft Works
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 10/11] doc/filters.texi: remove incorrect statement softworkz
2022-10-10 10:54 ` [FFmpeg-devel] [PATCH 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz
2022-10-10 11:08   ` Gyan Doshi
2022-10-10 11:25     ` Soft Works
2022-10-31  6:19 ` [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay ffmpegagent
2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT softworkz
2022-11-04  2:07     ` Xiang, Haihao
2022-11-07  3:10       ` Xiang, Haihao
2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 02/11] avfilter/overlay_vaapi: build filter params just once softworkz
2022-10-31  6:19   ` [FFmpeg-devel] [PATCH v2 03/11] avfilter/overlay_vaapi: remove double framesync init softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 04/11] avfilter/overlay_vaapi: handle secondary null input softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 05/11] avfilter/overlay_vaapi: reformat options softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 06/11] avfilter/overlay_vaapi: remove redundant .get_buffer assignments softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 07/11] avfilter/overlay_vaapi: add framesync options softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 08/11] avfilter/overlay_vaapi: precalculate blend_state, enable pixel alpha softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 09/11] avfilter/overlay_vaapi: enable expressions for overlay parameters softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 10/11] doc/filters.texi: remove incorrect statement softworkz
2022-10-31  6:20   ` [FFmpeg-devel] [PATCH v2 11/11] doc/filters.texi: update overlay_vaapi documentation softworkz

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