From patchwork Wed Aug 24 08:44:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Hack X-Patchwork-Id: 37452 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2372119pzh; Wed, 24 Aug 2022 01:46:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4rU5ikB5Q7oBVRORrpSNvAg5uekY+x8Cj1aVdt1PQ8cxM82RkUTeXPPoQ4hzr3fZRjaOsB X-Received: by 2002:aa7:dc17:0:b0:441:e5fc:7f91 with SMTP id b23-20020aa7dc17000000b00441e5fc7f91mr6727142edu.301.1661330804013; Wed, 24 Aug 2022 01:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661330804; cv=none; d=google.com; s=arc-20160816; b=H3pmaHoV82oiJssGRc7ZX+cbPu9g68IdR5Jw7Dtq0cqFENxtdkHKA9k0kJ9j1NgPSL CNuSm69dIL5SI2exlPQ4OfEb0HdvwRFczG1V7lMQKSYl16i0BoxEEEQKEHNxf6I4hwR3 oLonLMdSgjYRZEky61p3UnJIPczDeMADhpk5XkQJlsCMwzaZxUK8egdXmQ0a9rIA49gz ePIxG32PvVI+u49u4fjz6pjydvRw4rSbkPmMGj9O0yMkwPlNLjWgWtF7gf61/v+tl1sO h0c9IqBGrR+3jnRA3W4Vl9qrSNB22XwAlxug+bCeiY/jxQMZfmmc9TkhU0Kwj4EucTzs wGTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :feedback-id:dkim-signature:dkim-signature:delivered-to; bh=8YR+3hpErZKKvbD0hWlMfnQ32ORTP+WYxakN6b2BHZk=; b=JcDQRhDM8W/m58C6UGXdtG80n6bRUefrMddG9Pr5s5YFgFS3HPjfnn9Q4JhRyoqAI/ /O0krk8B7Z5Kr5/pnzGCoZ2BBKK8XybC1hlMkEYkQypaIjdwS63eQIOvBISlAcYMS5wf cNd77PG/0veEzZLNVhY+dHPMZmJmX0UvDpJlSYhuKmJ9Li9B93Juv+UmPScwFGOyiZpr Drg03zsRKSmOZ613GrUXbevoOB7ypkzA+4EkgI5iCNnn9Kxun475W5P0XumsmSTKyZa6 T6NvBNQIAKvM3c2O/if6Eb48PJ5SKLDdkTVtdnTOt5GyjMlRwauxXz5BZ2P9lw+29qpY DBbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@bendys.com header.s=fm3 header.b=FG5jnpUx; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=b0T5lxsE; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g10-20020a1709067c4a00b0072efc11c532si1220536ejp.41.2022.08.24.01.46.43; Wed, 24 Aug 2022 01:46:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@bendys.com header.s=fm3 header.b=FG5jnpUx; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=b0T5lxsE; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4CC2568BA2B; Wed, 24 Aug 2022 11:44:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6506F68B9DE for ; Wed, 24 Aug 2022 11:44:53 +0300 (EEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8E5855C00C3; Wed, 24 Aug 2022 04:44:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 24 Aug 2022 04:44:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bendys.com; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1661330691; x=1661417091; bh=irdHQkv/GdlCwep/oclqj3Blv iq6c4n+MWmOFSiV8kQ=; b=FG5jnpUxFL4SkYqR3Lrg0o/eKLKJ/ty9ajciBZuNA GTgXEsKZ+lV5IdOg5mZtLXUWV6KPIqLhA1jNz3oJdEq+rJgPgG0UeFw2Eaqk2IF+ to0MTw4JtIaFyXBslhIuDnf4v4DVLkSiBBLPggRlZVkJmCzE4wghPWbxZg+urdMH 4kjcfeHCQiFlVDp65o3IcL3Kjt4Da8oidoD/0yDvCb85miesz6hesz8Ys/XgE56B LDe//J7mdWrK0z1YMHpHVDrBmDVZsFqLYLatughA1loZvrXY7/KR2vHC6CYRMgYC MyTsNJ9tjz31xqx+NEKFyTt8NJocDYExsrcAgu/0oWqcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1661330691; x=1661417091; bh=irdHQkv/GdlCwep/oclqj3Blviq6c4n+MWm OFSiV8kQ=; b=b0T5lxsED8DztMnwM/BY0MNv+vuUuRf8VXsQSVJv3IhVVeLJaxR 7cSkgM1cGQXz/acLIItZIZCyQCQ33l5eR/WbeE8bUGOPLLYxC38tqxs57IL5X4a4 Ds6MYS78QYss/LivFnRR3QoU3i7o7tqTiDYTo6qh7FiO/ao/LlpoWuFlvBPGneyT hdOQrLRiNfdY5i8XiamCh7P7W6wy6/f6S02/iPx29JwFC/1UbS0JNoBQsnugRqnC nTVLx62Yre7zrrf9HQygI0x8sam4ccO5ei0L3esGPvXZ8Rxe7jrtMvqS7FZ1aByf dswLdx16WyMeIySKGzg9NgXr17eq/RMe+IA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejuddgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeeurhgvnhgurghnucfjrggtkhcuoehffhhmphgvghessggvnhgu hihsrdgtohhmqeenucggtffrrghtthgvrhhnpeffveefteetgfejieejheetfefgffeufe fgudeitdekkedtkedvtdegtdfhtedvheenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehffhhmphgvghessggvnhguhihsrdgtohhm X-ME-Proxy: Feedback-ID: i42d146ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Aug 2022 04:44:50 -0400 (EDT) From: Brendan Hack To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Aug 2022 18:44:39 +1000 Message-Id: <20220824084439.1581-1-ffmpeg@bendys.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_frei0r: set align to 1 for frei0r frames 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: Brendan Hack Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Hx7i0sBEcpju The frei0r API requires linesize to be width * 4. Since the align property of ff_default_get_video_buffer2 specifies line alignment, not buffer alignment, the previous value of 16 breaks this requirement for frames whose width is a multiple of 8, but not a multiple of 16 as it adds extra padding to ensure line aligment. Fix Trac ticket #9873 --- libavfilter/vf_frei0r.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index 1e01114b76..58fa2245bf 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -359,14 +359,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) { Frei0rContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; - AVFrame *out = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 16); + /* align parameter is the line alignment, not the buffer alignment. + * frei0r expects line size to be width*4 so we want an align of 1 + * to ensure lines aren't padded out. */ + AVFrame *out = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1); if (!out) goto fail; av_frame_copy_props(out, in); if (in->linesize[0] != out->linesize[0]) { - AVFrame *in2 = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 16); + AVFrame *in2 = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1); if (!in2) goto fail; av_frame_copy(in2, in); @@ -481,7 +484,7 @@ static int source_config_props(AVFilterLink *outlink) static int source_request_frame(AVFilterLink *outlink) { Frei0rContext *s = outlink->src->priv; - AVFrame *frame = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 16); + AVFrame *frame = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1); if (!frame) return AVERROR(ENOMEM);