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 23D0B40523 for ; Wed, 24 Aug 2022 08:46:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B7EC68BA23; Wed, 24 Aug 2022 11:44:55 +0300 (EEST) 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 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: 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); -- 2.25.1 _______________________________________________ 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".