From patchwork Fri Jun 28 02:29:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 13731 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 495144469CC for ; Thu, 27 Jun 2019 17:32:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2BD3E68A937; Thu, 27 Jun 2019 17:32:05 +0300 (EEST) 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 8A322689FCE for ; Thu, 27 Jun 2019 17:31:58 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2019 07:31:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,424,1557212400"; d="scan'208";a="173150512" Received: from icl-dev.sh.intel.com ([10.239.158.32]) by orsmga002.jf.intel.com with ESMTP; 27 Jun 2019 07:31:40 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Jun 2019 22:29:43 -0400 Message-Id: <1561688983-1310-1-git-send-email-linjie.fu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH 5/5] libav/qsv: set Info.Shift according to the setting in desc 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: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Currently, Info.Shift in libmfx is set according to the depth of the pixfmt. As QSV now supports Y410 (depth > 8 but shift = 0), it doesn't work any more. Modify to set Info.Shift according to the setting in desc. Signed-off-by: Linjie Fu --- libavcodec/qsvdec.c | 2 +- libavutil/hwcontext_qsv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 7650325..0f45a34 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -208,7 +208,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth; param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; - param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; + param.mfx.FrameInfo.Shift = desc->comp[0].shift > 0; param.mfx.FrameInfo.FourCC = q->fourcc; param.mfx.FrameInfo.Width = frame_width; param.mfx.FrameInfo.Height = frame_height; diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index f0be4bb..ab484b6 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -323,7 +323,7 @@ static int qsv_init_surface(AVHWFramesContext *ctx, mfxFrameSurface1 *surf) surf->Info.BitDepthLuma = desc->comp[0].depth; surf->Info.BitDepthChroma = desc->comp[0].depth; - surf->Info.Shift = desc->comp[0].depth > 8; + surf->Info.Shift = desc->comp[0].shift > 0; if (desc->log2_chroma_w && desc->log2_chroma_h) surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;