summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenbin Chen <wenbin.chen@intel.com>2023-02-13 16:49:26 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2023-02-16 11:15:50 +0800
commite530d38bbf5f58e3e22f87dff635a50e267abb77 (patch)
tree3d51cf9b9959b8f1125e738a80e0310673f23ce7
parentb7a335c5e9d2cd47dc8adeca2edc6714fa2d2996 (diff)
downloadffmpeg-e530d38bbf5f58e3e22f87dff635a50e267abb77.tar.gz
libavcodec/qsvenc: Do not pass RGB solorspace to VPL/MSDK
When encode RGB frame, Intel driver convert RGB to YUV, so we cannot set RGB colorspace to VPL/MSDK. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
-rw-r--r--libavcodec/qsvenc.c7
1 files changed, 6 insertions, 1 deletions
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)) {