From patchwork Mon Feb 21 02:13:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Fei W" X-Patchwork-Id: 34422 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp2991360nkx; Sun, 20 Feb 2022 18:19:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOyDyoSrNfubl/SVxFGWxETEHL7QNv7OeRl/Q9kTAVpyUSldDdGdQGWj1v53N90qmH5Ai/ X-Received: by 2002:a17:907:788c:b0:6ce:29d5:c075 with SMTP id ku12-20020a170907788c00b006ce29d5c075mr14702010ejc.407.1645409961073; Sun, 20 Feb 2022 18:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645409961; cv=none; d=google.com; s=arc-20160816; b=kTYGiquLEJORbqMMZyDKJS0a46k0RX+4lVo4mgQKuTLavQoNS7ck4TySd+UK1CNkH6 /gvOcfbUIpS/t/cS6KeV0xPgbQfqPclTkcwkRYW8dDEImJMU7Ul1jxs1MvXvF1V5gHhs TWI5CA40ggGuwoI5+XwyRU/UKH4rN847wYZ2HH2S4v6sRRBzmeccdTan9RmNtxTBR4IM ULr+dRuM7pES9wl5f87IlB67RrBPDELIEvqGjq93zwOPG2/uviQBS0z2ErQmOsP332QK xnQ3kxWNWb2CWfrnbSryjV8V9j6K2llnSn905m/jlGlhebGj60+X+jp6Eda06rc/1aTT +Umw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=Hp7xAWEEQfszMlmQPeafb7GZPOHI8e5na0/YCq2LRKc=; b=PcgEOGRdYtUlSlyMaCmg/cnypekPdASbqtFu8757bpx7DTqihStlSLXLWSa22EXGOA E6g8F/2vbokq0fVGFB9Crp3x9qQ1aL7dCy6dGG9Cdip1yHZgpruM33+QmHapDnwEpWkM qYhbvtC742Js40ADpC8IEWa1/qxqEmf1z9YJlKBmWgsYSNxY/u9zZIwmdog5vGIDgDUY yupacDms2hwSSoOb+NjqtsvKgS7VZJrSdxX4rqRXX8Moxqv/aB05hj4oigziqG4rHf6S sg/gfE2Voet5E6jJqB7KLOxn+v3Tile0gqc6k6rHXM3cmdtHu4HJpc93PaJ2N+0SvEMR NoXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=AQMew31+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o19si5718507eju.266.2022.02.20.18.19.20; Sun, 20 Feb 2022 18:19:21 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=AQMew31+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB67168B115; Mon, 21 Feb 2022 04:19:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20D5268B0D2 for ; Mon, 21 Feb 2022 04:18:54 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645409940; x=1676945940; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yf2UOafZYgaGBlQApk7GLFnJk2zJh+xgqBSoqNkEBLY=; b=AQMew31+UVvBTJ7wJJbFslgCIlKxX6L5Ar6GzY63onybo9J3jLSl3bgu /qskgj3wwXrTgyhYxkjH3q1JuYeZ158j83VRkJzysIK0fYexAD5BTXsBX 4m+nRRNtODKjlrd3ZDjlw4mWF7761suPD2WfN+7B8fq/S06fjnI+54Feu LJHIX5+vGQpc8xdm2mcSZqw3QmzVRZn41/PXPXhJljzjZv9nDfa/lw0o3 RkpVrXlwLszsAtvZdxQaJNoRrnSCSd3bnV9adDjhDhtHeLO72atDrz9zo E6xxxQJO+2bCxjd++u5fl1Isn+9atM6S0nXohCFihs3XPggRfb/egS36u g==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="231391495" X-IronPort-AV: E=Sophos;i="5.88,384,1635231600"; d="scan'208";a="231391495" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 18:18:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,384,1635231600"; d="scan'208";a="507466664" Received: from t.sh.intel.com ([10.239.159.147]) by orsmga006.jf.intel.com with ESMTP; 20 Feb 2022 18:18:51 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Feb 2022 10:13:36 +0800 Message-Id: <20220221021337.2190359-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221021337.2190359-1-fei.w.wang@intel.com> References: <20220221021337.2190359-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/4] vaapi_encode_h265: Explicitly set and correct some flags 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 Cc: Mark Thompson , Fei Wang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xn+N/Ks/1fkV From: Mark Thompson max_14bit_constraint_flag should be set if the bit depth is not greater than 14 (currently always true). one_picture_only_flag should not be set because we don't support the still picture profiles. general_profile_compatibility_flag should be set according to general_profile_idc instead of bit depth. Signed-off-by: Fei Wang --- libavcodec/vaapi_encode_h265.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index 5b8dbe841d..8319848e4a 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -303,17 +303,21 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx) ptl->general_profile_idc = avctx->profile; ptl->general_tier_flag = priv->tier; - if (chroma_format == 1) { - ptl->general_profile_compatibility_flag[1] = bit_depth == 8; - ptl->general_profile_compatibility_flag[2] = bit_depth <= 10; + ptl->general_profile_compatibility_flag[ptl->general_profile_idc] = 1; + + if (ptl->general_profile_compatibility_flag[1]) + ptl->general_profile_compatibility_flag[2] = 1; + if (ptl->general_profile_compatibility_flag[3]) { + ptl->general_profile_compatibility_flag[1] = 1; + ptl->general_profile_compatibility_flag[2] = 1; } - ptl->general_profile_compatibility_flag[4] = 1; ptl->general_progressive_source_flag = 1; ptl->general_interlaced_source_flag = 0; ptl->general_non_packed_constraint_flag = 1; ptl->general_frame_only_constraint_flag = 1; + ptl->general_max_14bit_constraint_flag = bit_depth <= 14; ptl->general_max_12bit_constraint_flag = bit_depth <= 12; ptl->general_max_10bit_constraint_flag = bit_depth <= 10; ptl->general_max_8bit_constraint_flag = bit_depth == 8; @@ -323,6 +327,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx) ptl->general_max_monochrome_constraint_flag = chroma_format == 0; ptl->general_intra_constraint_flag = ctx->gop_size == 1; + ptl->general_one_picture_only_constraint_flag = 0; ptl->general_lower_bit_rate_constraint_flag = 1;