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 6136944064 for ; Thu, 24 Nov 2022 02:47:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E2C2B68B3CD; Thu, 24 Nov 2022 04:47:48 +0200 (EET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABF8E68B125 for ; Thu, 24 Nov 2022 04:47:41 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669258066; x=1700794066; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=j6J2tnE5yTUKP+orZ8Wqj0YKm9PHV6eLDCe4D4DYF1U=; b=W1XA5qV/84yEsu8HIC73xFQANEUHK6B82boh//ZoeDsbDdFya70/bp3q fnfTPiAnwBTN4krb8Y5PvEtZjPMXtXOHXsrAPjw6ElUzwEeAIlb5JU3VZ 5KuCrByWhQ8qc6Aq7/+tTPN6oRGiYu4rn3X8GqY8Z05LaChDbLeoSo7NV oacbAZitr48e9+X4U07JxRX8oHwNb1V6P42St+itPhcBUF4ST4aUw2zAX GYx6A3BXpw8dykYCaySv5II08oJK6h5Ku/jbqAQlnRSESCa/SNZHhj7cE SM53zWC0ZNankM6s+1oVuDsqMBkN5BaE5YSENuxOCNCAOqJFZGvq9wR1T Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="314236611" X-IronPort-AV: E=Sophos;i="5.96,189,1665471600"; d="scan'208";a="314236611" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2022 18:47:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="784462454" X-IronPort-AV: E=Sophos;i="5.96,189,1665471600"; d="scan'208";a="784462454" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.4]) by fmsmga001.fm.intel.com with ESMTP; 23 Nov 2022 18:47:31 -0800 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Nov 2022 10:47:29 +0800 Message-Id: <20221124024729.881574-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] libavcodec/qsvenc.c: Enable MFX_GOP_STRICT when adpative gop is disabled 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 adaptive_i and adaptive_b cannot work with MFX_GOP_STRICT, so only enable MFX_GOP_STRICT when these features are disabled. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index d5e9f2d420..514a1e8148 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -644,6 +644,12 @@ static int check_enc_param(AVCodecContext *avctx, QSVEncContext *q) return 1; } +static int is_strict_gop(QSVEncContext *q) { + if (q->adaptive_b == 0 && q->adaptive_i == 0) + return 1; + return 0; +} + static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q) { enum AVPixelFormat sw_format = avctx->pix_fmt == AV_PIX_FMT_QSV ? @@ -755,7 +761,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) q->old_gop_size = avctx->gop_size; q->param.mfx.GopRefDist = FFMAX(-1, avctx->max_b_frames) + 1; q->param.mfx.GopOptFlag = avctx->flags & AV_CODEC_FLAG_CLOSED_GOP ? - MFX_GOP_CLOSED : MFX_GOP_STRICT; + MFX_GOP_CLOSED : is_strict_gop(q) ? + MFX_GOP_STRICT : 0; q->param.mfx.IdrInterval = q->idr_interval; q->param.mfx.NumSlice = avctx->slices; q->param.mfx.NumRefFrame = FFMAX(0, avctx->refs); -- 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".