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 1B2E444C8C for ; Mon, 13 Feb 2023 08:49:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6984568BDCA; Mon, 13 Feb 2023 10:49:37 +0200 (EET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CD8BB68BDDF for ; Mon, 13 Feb 2023 10:49:29 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676278175; x=1707814175; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=xk+NDPIW9MUbusrgNVg5+ikIofRsWXS4xcb5BwxVk+A=; b=IhhhQdxUJ7QdkypsnK1dme/SrmaML3JEgumH52AGzKZYkqYfB1tFWJRT byYlRvzFxjHniryBZGuCQYx8l85PSGeQsHuwVUoUvjCDU+sVehjNpH8O9 gDXKYuxjjbgvyAYma7T3T/awi3CTyy9Y4A4K82sY8MFNA5i/CJQKVzJXy KffNATJRkzeHEAvl291xNlLE+AuFRKXEIV0bCWqf5h5jLzk6wc3QqQnAr 4TFohvvAxEnR3Uy6BFFlur1tVeXyagtXEh8BB0GvOX8HLYtyOl+oUQjTi c0XH5uLLSlcuA6rMxLjazUKiAg4lH0lGCFVdAj/XxSaL/TbSDteoVt5tj A==; X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="318868450" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="318868450" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 00:49:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="699120479" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="699120479" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.4]) by orsmga008.jf.intel.com with ESMTP; 13 Feb 2023 00:49:26 -0800 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Feb 2023 16:49:26 +0800 Message-Id: <20230213084926.543371-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] libavcodec/qsvenc: Do not pass RGB solorspace to VPL/MSDK 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 encode RGB frame, Intel driver convert RGB to YUV, so we cannot set RGB colorspace to VPL/MSDK. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 2f0e94a914..d3f7532fc0 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -1185,7 +1185,12 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) q->extvsi.ColourDescriptionPresent = 1; q->extvsi.ColourPrimaries = avctx->color_primaries; q->extvsi.TransferCharacteristics = avctx->color_trc; - q->extvsi.MatrixCoefficients = avctx->colorspace; + if (avctx->colorspace == AVCOL_SPC_RGB) + // RGB will be converted to YUV, so RGB colorspace is not supported + q->extvsi.MatrixCoefficients = AVCOL_SPC_UNSPECIFIED; + else + q->extvsi.MatrixCoefficients = avctx->colorspace; + } if ((avctx->codec_id != AV_CODEC_ID_VP9) && (q->extvsi.VideoFullRange || q->extvsi.ColourDescriptionPresent)) { -- 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".