From patchwork Mon Apr 11 21:21:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 35264 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:671c:b0:7c:62c8:b2d1 with SMTP id q28csp1255645pzh; Mon, 11 Apr 2022 14:22:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE/6EM3ZAyuoOyogU8J9ZdoE52lQIw2TxMATOChWE0GM9nmA+baQjgs75i1i0hyZWE0M+D X-Received: by 2002:a17:906:6990:b0:6e8:7765:a709 with SMTP id i16-20020a170906699000b006e87765a709mr10165312ejr.72.1649712167284; Mon, 11 Apr 2022 14:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649712167; cv=none; d=google.com; s=arc-20160816; b=AHAFERE+X5Z1N0gn0SEY/qx30BWzRZHo72/ZSU7uZQ2otv6pG74FEHSypkVs/T+Ksf P5+lSmmqHasu9C4iKWIKMwqQLOMxKFo+Dythd+aH8AWMwx/e1uXpq265ObEw9wYFp5GV oJvGqjA6M3BqoWnoixFZA7ywOUwZUiZplPGPmBw3IoZr05XLz92c4LxhzB8vUIArsuB2 7pgCf0NDDJCquiuuWDjscnYTdPtWdnhDrjr0f+AOPONayuxyd7J05cQ+mR9XgsiE9948 DEoy+AIXFs0qrp8ApQvCwVlSI2KcWcc7/zD4i8GHTif4p9NTcYEBBNyrAmndew2CsBFb 7ngg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=K+akmfoN6/rYQEyGxSV2z9HNEtFigENUpexWwYmCsZM=; b=fSojVRbwZem3AOf19uJQb3bJgpBrzcVH0/Yhmv7n39+hBfqKFQw5TlM4da6fmkzQza BBzuFFmpENHD5YjFhhNMTS8wMlwQyuFAumbbEh/fU+gjjyWU8cAHy81tv2Bcabj6JQ48 2qg8+GAYGpXFAAt4ZBrWn8nxOXybvdEAKwRVMRZUaBrDiEjP3mBiC0ayhwhVuelf+B4T VcOltPc8ME926iEO7WJzbuHW7MWbuG1R84JErRIW4C0FfTZmvB3duuS8ZhflfoDPdzSS kwXiHA2TAYL9zTQjAT4o81V/TK0oBl0HNoPToYRZlTO1joLs1t46SBJmXSftlXsPsVwH YvGA== ARC-Authentication-Results: i=1; mx.google.com; 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 s7-20020a1709062ec700b006e7ee5d0682si7387154eji.585.2022.04.11.14.22.47; Mon, 11 Apr 2022 14:22:47 -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; 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 2CE8B68B329; Tue, 12 Apr 2022 00:22:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at01-1.mx.upcmail.net (vie01a-dmta-at01-1.mx.upcmail.net [62.179.121.145]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0386168AC80 for ; Tue, 12 Apr 2022 00:22:39 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1ne1Ua-004yGQ-5i for ffmpeg-devel@ffmpeg.org; Mon, 11 Apr 2022 23:22:36 +0200 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id e1Sen9ya8SgGFe1Uan3ktG; Mon, 11 Apr 2022 23:22:36 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id e1TMn538COPqFe1TNnh0hh; Mon, 11 Apr 2022 23:21:21 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=62549be0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=pZ2TeP17fcRQPCxlCHUA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 11 Apr 2022 23:21:19 +0200 Message-Id: <20220411212120.15692-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220411212120.15692-1-michael@niedermayer.cc> References: <20220411212120.15692-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfMVLDb6wVviSl9VW8gE1FxaqIFUx8Hv3nRkxSST/ogmVrtdI73fqvsqnz035zchyVjMfqfGBL9d72I2KRu9xb/L8AI5ya9+NHhjvxhVI2bh9FiTL5J3J KGqzdU+xHa/8p5pExxTeAdFWhMbPtByEsc6DDOgh1adwNA6OTSL0Mu9sUEpLNsRZlATvcxpBfZiO8A== Subject: [FFmpeg-devel] [PATCH 3/4] avfilter/video: Add ff_default_get_video_buffer2() to set specific alignment 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ORtpbNWXCNOg Signed-off-by: Michael Niedermayer --- libavfilter/video.c | 8 ++++++-- libavfilter/video.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libavfilter/video.c b/libavfilter/video.c index b2f0cdf88a..e9eb110ff4 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -38,13 +38,12 @@ AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h) return ff_get_video_buffer(link->dst->outputs[0], w, h); } -AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) +AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align) { AVFrame *frame = NULL; int pool_width = 0; int pool_height = 0; int pool_align = 0; - int align = av_cpu_max_align(); enum AVPixelFormat pool_format = AV_PIX_FMT_NONE; if (link->hw_frames_ctx && @@ -94,6 +93,11 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) return frame; } +AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) +{ + return ff_default_get_video_buffer2(link, w, h, av_cpu_max_align()); +} + AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h) { AVFrame *ret = NULL; diff --git a/libavfilter/video.h b/libavfilter/video.h index f448e4ada4..f37bab9d03 100644 --- a/libavfilter/video.h +++ b/libavfilter/video.h @@ -24,6 +24,7 @@ #include "avfilter.h" AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h); +AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align); AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h); /**