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 5A8C844EFE for ; Tue, 29 Nov 2022 12:32:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4E10B68B83A; Tue, 29 Nov 2022 14:32:08 +0200 (EET) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CC95468AAD7 for ; Tue, 29 Nov 2022 14:32:01 +0200 (EET) Received: by mail-ot1-f44.google.com with SMTP id a13-20020a9d6e8d000000b00668d65fc44fso8950173otr.9 for ; Tue, 29 Nov 2022 04:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=AG+oo6UXAr05Bbbv4ouYCfX6imWJL+Q0TNRsRKsLbTQ=; b=kFdCHG2hznC0n/YoRYFy8kAF8tBwAGAeSJNuDaCCZ74EPrOMwBO3Rbh8v3kXVouhAt Szq0au2r9XgM0plBs8TKYlt4dHNsoHAYduvJtgwlSrjxDhg4ThsM2b9vpUKA17kz2UW/ c9x6wS9uayARkYm5ZKRVaWLjRSqb/q+vZRxVgtjj50xM9TxKlbr1U7t5VRG/x28+cgo4 u7jlJfyOHjN/T9irD4+JH9mGjRHHfc/5PTZT6qrR8CTg02sjRdYPG9ffKBhYehigsYNK OWLSAO5dWuRwmjaG2MHQRb4YiHKj3mqOHlYrTUEzNMDouewVMI6LAt1rd2Nc37bbW4dd dQaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AG+oo6UXAr05Bbbv4ouYCfX6imWJL+Q0TNRsRKsLbTQ=; b=B2CG6WaoFvhLXmxgghOd/5ky70So3l6XKK6qgtswcAR1t5M1o/+Uoi4I71Qmr3KaGv SJxcXiME29Jmepa6ylh0I52lxzggkf6SDRZj0+u1Dm8M04VSdv6fLHZxErRv23kzlmAO jtLMX4sXWAB694+GCxew4AYhSFWvca0nxA+REIM27jEMqlF3B63rxxNUtVXqQq0d7GMR bxapTgFei+zgZqFsr8VvV9BAEI6zica5vFVgePU/oFUgMco/qnwVRdKkwQlGBamICAJm 7pvD0j5MgqqtP8ABx/Ni96btuvDhnmwC2AC2R03ibV++5f0LRj6ifvO67wnAE+T9dNy7 CUVQ== X-Gm-Message-State: ANoB5pmdC9COr9YrnQVFF1fw4+1O+6RfgMvgY/Or0BTHXSKYqqtfamcT VpkcZbXWMoGwXz79B7gN5nGkIRrQzHc= X-Google-Smtp-Source: AA0mqf6s/VBOR5RHhekE+PWidTyGztzUHseZJ+hApqSeNBctEVSFb88N5ZVgODz9p7ionb7OnxcX9g== X-Received: by 2002:a9d:36c:0:b0:650:aeb6:65d2 with SMTP id 99-20020a9d036c000000b00650aeb665d2mr17244048otv.334.1669725119846; Tue, 29 Nov 2022 04:31:59 -0800 (PST) Received: from [192.168.0.15] ([181.85.72.69]) by smtp.gmail.com with ESMTPSA id i130-20020aca3b88000000b0035a534b9237sm5447340oia.29.2022.11.29.04.31.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Nov 2022 04:31:59 -0800 (PST) Message-ID: <0af77427-42ff-ee34-8aef-334f8bb678bf@gmail.com> Date: Tue, 29 Nov 2022 09:31:57 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 To: ffmpeg-devel@ffmpeg.org References: <20221129080702.323228-1-wenbin.chen@intel.com> Content-Language: en-US From: James Almer In-Reply-To: <20221129080702.323228-1-wenbin.chen@intel.com> Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/qsvvpp: Use different alignment for YUV420P format 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 11/29/2022 5:07 AM, wenbin.chen-at-intel.com@ffmpeg.org wrote: > From: Wenbin Chen > > When process yuv420 frames, FFmpeg use same alignment on Y/U/V > planes. VPL and MSDK use Y plane's pitch / 2 as U/V planes's > pitch, which make U/V planes 16-bytes aligned. We need to set > a separate alignment to meet runtime's behaviour. > > Now the commandline works fine: > ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 3082x1884 \ > -i ./3082x1884.yuv -vf 'vpp_qsv=w=2466:h=1508' -f rawvideo \ > -pix_fmt yuv420p 2466_1508.yuv > > Signed-off-by: Wenbin Chen > --- > libavfilter/qsvvpp.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c > index 8428ee89ab..ad09114cb7 100644 > --- a/libavfilter/qsvvpp.c > +++ b/libavfilter/qsvvpp.c > @@ -408,9 +408,15 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p > } else { > /* make a copy if the input is not padded as libmfx requires */ > if (picref->height & 31 || picref->linesize[0] & 31) { > - qsv_frame->frame = ff_get_video_buffer(inlink, > - FFALIGN(inlink->w, 32), > - FFALIGN(inlink->h, 32)); > + /* When process YUV420 frames, FFmpeg uses same alignment on Y/U/V > + * planes. VPL and MSDK use Y plane's pitch / 2 as U/V planes's > + * pitch, which makes U/V planes 16-bytes aligned. We need to set a > + * separate alignment to meet runtime's behaviour. > + */ > + qsv_frame->frame = ff_default_get_video_buffer2(inlink, I think the proper way to do this is by setting a custom AVFilterPad get_buffer.video() callback, which will be called instead of ff_default_get_video_buffer() (Which uses an automatically chosen alignment at runtime) by ff_get_video_buffer(). See other filters like vf_pad, vf_transpose_vaapi, etc. > + FFALIGN(inlink->w, 32), > + FFALIGN(inlink->h, 32), > + 16); > if (!qsv_frame->frame) > return NULL; > _______________________________________________ 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".