From patchwork Tue Mar 23 08:38:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 26556 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3331844BB7C for ; Tue, 23 Mar 2021 10:40:06 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0778868AA87; Tue, 23 Mar 2021 10:40:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BC112689E84 for ; Tue, 23 Mar 2021 10:39:59 +0200 (EET) IronPort-SDR: LFGc6RqO0B8UZ29dDZE5mxl99U+/8woV5RXgnRavjdpnTYTpcy4wsdtjXZjy2qzPSbNTu2gmgx JRsgBHTsDtsA== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="177999076" X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="177999076" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 01:39:57 -0700 IronPort-SDR: BilKseVULvUFb3cjkbXEihfWM9ePeMfykDuQYLDgQR7ptDGW0gK6aAwCGoJi0rXy6wkjo3GjNh ZD0Kd7f+Ooiw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="513662923" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.3]) by fmsmga001.fm.intel.com with ESMTP; 23 Mar 2021 01:39:56 -0700 From: wenbin.chen@intel.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Mar 2021 16:38:13 +0800 Message-Id: <20210323083813.2504358-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2] libavfilter/qsvvpp: change the output frame's width and height X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: "Chen,Wenbin" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: "Chen,Wenbin" qsvvpp align the width and height with 16, and that may lead to error. For example, when we use qsvvpp to resize frame to 1080p, qsvvpp will align frame to 1088 which is different from the height of encoder (1080) and this will be treated as resolution change. Now I assign the out_link's w/h to output frame to overwrite the w/h got from hw_frame_ctx. Signed-off-by: Wenbin Chen --- libavfilter/qsvvpp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c index f216b3f248..70d6cb49e3 100644 --- a/libavfilter/qsvvpp.c +++ b/libavfilter/qsvvpp.c @@ -486,9 +486,6 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink) if (!out_frame->frame) return NULL; - out_frame->frame->width = outlink->w; - out_frame->frame->height = outlink->h; - ret = map_frame_to_surface(out_frame->frame, &out_frame->surface_internal); if (ret < 0) @@ -497,6 +494,8 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink) out_frame->surface = &out_frame->surface_internal; } + out_frame->frame->width = outlink->w; + out_frame->frame->height = outlink->h; out_frame->surface->Info = s->vpp_param.vpp.Out; return out_frame;