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 4F60544C32 for ; Mon, 13 Feb 2023 05:55:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B693D68BA58; Mon, 13 Feb 2023 07:55:56 +0200 (EET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E2E7268ADF1 for ; Mon, 13 Feb 2023 07:55:49 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676267755; x=1707803755; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=quO+0jKdy9T0WIRfff4ra8LgfzDDAw3AEwK7e5xVEVc=; b=BOR/fEHzV5kW5QyDYkF9GnW0xSDFGMx5ub8M7GtTzfWFWFqM62EerfB2 Zit3J8V6KS2aE776q/MS45K+Do7NOefonXk5CFPEFIQpK7bt4kZPqExlA x8VROro7YzQkbkajoNVeW8G6bQlZceARxPjpXIYoMwohnVnC5wH02njrB kB2spNYMYb6d/4zRMQmCswlaIuJPpVH1n2pPQ/YTkPS4pN6I1bK0rh9B2 FA4c+cBp7SCGflJcQuSLbMiaN379Aw5o8c4S2KDxGx/7zQR4ORAv7W8o0 HMsipF2v6kbVLMhOM0RIKKY43PjCMMRmhpFvx4gIQeVGN+do4NNtd4Lps w==; X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="332954235" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="332954235" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2023 21:55:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10619"; a="732366266" X-IronPort-AV: E=Sophos;i="5.97,293,1669104000"; d="scan'208";a="732366266" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.4]) by fmsmga008.fm.intel.com with ESMTP; 12 Feb 2023 21:55:46 -0800 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Feb 2023 13:55:45 +0800 Message-Id: <20230213055545.535005-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] 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..944a76f4f1 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) + //YUV will be converted to RGB, 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".