From patchwork Mon Mar 22 06:43:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 26534 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 5A35C44AB07 for ; Mon, 22 Mar 2021 08:45:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2AFE768A987; Mon, 22 Mar 2021 08:45:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2DF976808CD for ; Mon, 22 Mar 2021 08:45:32 +0200 (EET) IronPort-SDR: Kkx/reV+VBo2RBF1AQG+LWCsREN+HvZ9uytEMhzmMRNKcnp6z38TaOJjyHpTPKo+EtpTdn6Uiu Fn5wSmJD5VnA== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="251566355" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="251566355" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:45:31 -0700 IronPort-SDR: yzS4f4j/rhfDsmkX+kzTARgBqIgdTHcpm0m5b6wyQYvSsMvzt6NF1N1XEQBzQ7nAV33YJ6myar JQ9ChvwFQ09g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="414359026" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.3]) by orsmga008.jf.intel.com with ESMTP; 21 Mar 2021 23:45:30 -0700 From: wenbin.chen@intel.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Mar 2021 14:43:46 +0800 Message-Id: <20210322064346.2272438-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c index f216b3f248..8658a70083 100644 --- a/libavfilter/qsvvpp.c +++ b/libavfilter/qsvvpp.c @@ -476,6 +476,9 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink) return NULL; } + out_frame->frame->width = outlink->w; + out_frame->frame->height = outlink->h; + out_frame->surface = (mfxFrameSurface1 *)out_frame->frame->data[3]; } else { /* Get a frame with aligned dimensions.