From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 23870408F9 for ; Mon, 31 Oct 2022 06:20:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 229D768BDFA; Mon, 31 Oct 2022 08:20:27 +0200 (EET) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3271368BCDC for ; Mon, 31 Oct 2022 08:20:11 +0200 (EET) Received: by mail-pf1-f181.google.com with SMTP id d10so9842454pfh.6; Sun, 30 Oct 2022 23:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=gyZf/9SIHLK7WOD6xIB/PnKgbiy6HEbrJ33VCCHkvnE=; b=dnY8FQb60CbQgWTLMOsodi/u/wIOpMVWTck9JeisdQsr0eFC+pXkkIkBc8peihcq5/ BZbsoapBNHk/Cxr0KXuD+Uut1CfxDhM2Da53MWKUR1naoQI1lysqE1cAUn/Jfm+2Rn0N y/ui68zOSX7olUn73UvaBjqtoqPg1NZTYw5FBBvcF5/h0ghF2J+ImRKPj1mUdVZwFtNM 2yEmhaaxdHXXAjxIez/uB/hYU3MdCRJu7GUln3PJIvKNt3Q9Onl+abe6uPJfuHFFdmz2 ORmsIe28JEAUTejbpcM79DnaipJ9syESNUp2ZffneW8Bgq+D6NX+uXry1lcG8AV84LrA OCGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gyZf/9SIHLK7WOD6xIB/PnKgbiy6HEbrJ33VCCHkvnE=; b=i5rMNATPe5FKbL5z+fLlt01fLZNpd1ChRGhd0+SUykhV5XzO7R+kwgu2LTdmIUl29b EQzhdamF/fg64NtlbHkCXfjlnPhrdp3ZMYVf1aaRfd6iF6H1pBYpJwohQJOHaozaOwAD gW3OMpJB7HS5/w75cPaeJMuOsu40NILNAkQQr2kckDIcbyImqgrEZGAF7ul8pbdtt6fC CIOoxjvuds/rMDcU+w7Gk1ldirFBpIP4swgSp6JQmT2pY3iphjPY3XieXoCqVh8DU+/+ XpbUqGUPSG2IrhWujQWQMUS4ONj/uAedCGYCjWgPf+EgPVIrJQVcyjVFbmxj3iC8wMDh pzEA== X-Gm-Message-State: ACrzQf3SWaAArG++TdAlqJbMHr8pY0xKIoeclrB92O6C/44RLV/CpuhJ O0QibHj0Jz6kw46JZhX3uZXd1KbdThQ= X-Google-Smtp-Source: AMsMyM7wvRH7gnSY+qsdd9gLuqHxuhwc5Vgtbx7FyIAe7GdoX4rAcGI3Vfl8xCINMR6YE4uuStsK4w== X-Received: by 2002:a05:6a00:24c3:b0:56c:dd9c:dab4 with SMTP id d3-20020a056a0024c300b0056cdd9cdab4mr12955667pfv.36.1667197209235; Sun, 30 Oct 2022 23:20:09 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id 1-20020a17090a0f0100b00205fafa6768sm3419179pjy.6.2022.10.30.23.20.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Oct 2022 23:20:08 -0700 (PDT) Message-Id: In-Reply-To: References: From: ffmpegagent Date: Mon, 31 Oct 2022 06:19:56 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v2 00/11] Fixes and Enhancements for VAAPI Overlay X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: softworkz , "Xiang, Haihao" , Gyan Doshi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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".