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 2DF1F44EFA for ; Tue, 29 Nov 2022 08:07:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E9CB368B7DB; Tue, 29 Nov 2022 10:07:13 +0200 (EET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9C0968A701 for ; Tue, 29 Nov 2022 10:07:06 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669709232; x=1701245232; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=5HSOKBooX/TtXa0d85J5VxN5D6sWKhRRxs/ibkLFnQo=; b=cDFDsFflhWOGgXbnDPzWV4zGXymbgA70MUOirYHYteuZT93xvHb02SRy RPff8tliDGUX2poR3U8AKYVfO2ibZIWDcXoq3uEwZKm7wPnyP1fX0hc7d RKyjEHd8CgmcdQ1e3JpN2r2b7HCpKFCFHyMchpB87x5weQC/HuwsAUZ6K JBCg2rZ+myGUo3+/5Yo59O9V8MfUSTnDVsXPsHd2pXdZBhhJlNosfKIpk wHgR4qaqkTuCtkQCSqtGbcO1A2Zg1zAZ6a/rFAWV9iRY8ZEq5o5oXIbku Gki3xWPHyehk3r45S57ubH2xSgbEOnpsE+Q/XhjJvVgClkTowPOmc7xW1 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="379315927" X-IronPort-AV: E=Sophos;i="5.96,202,1665471600"; d="scan'208";a="379315927" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2022 00:07:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="643694358" X-IronPort-AV: E=Sophos;i="5.96,202,1665471600"; d="scan'208";a="643694358" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.4]) by orsmga002.jf.intel.com with ESMTP; 29 Nov 2022 00:07:03 -0800 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Tue, 29 Nov 2022 16:07:02 +0800 Message-Id: <20221129080702.323228-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [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-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: 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, + FFALIGN(inlink->w, 32), + FFALIGN(inlink->h, 32), + 16); if (!qsv_frame->frame) return NULL; -- 2.34.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".