From patchwork Thu Mar 17 06:41:51 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: 34806 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp645369nkb; Wed, 16 Mar 2022 23:48:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmTFx8qThUWMS/o9tiqEwt6yfQ7R910Olkp+udM+ZqYSIVsaQoXUf8wUOCF4GrSvEc26fY X-Received: by 2002:a17:907:9506:b0:6da:b4cd:515b with SMTP id ew6-20020a170907950600b006dab4cd515bmr3010103ejc.602.1647499696272; Wed, 16 Mar 2022 23:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647499696; cv=none; d=google.com; s=arc-20160816; b=VteG+byfdbfPBD3QtgfD/LpjM4RpeKwH3MT40dbUPF7OiLtXedzxlqDdCIBmRxD/xk P8UU+Xs94nyvkfeXmjUZ3LTzGWtF7T2/Jo6Pg029UXxm0hcD3sGZkqXQS+xdseFN4O/Y 7Lxq5lNpZLC0z8LJzh2SVXW0sY3X9Q7dYDTRnj9LaUWDLHP2RW4qrGGhzQNbBv1BjvPH 5WnPTbZSi5NZdDr1uGXxhsn12RoEasoQGdD0ybYs8EwuKVSDUD4dtgolNXanC92qhqcS bsB4U5eh+utIMkg5+ghGrsUcfv1D4pEfI6+MQYysOSXqcZgNcJMHwTqzpRZemBwXu0CZ UO/A== 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=mVR1+yG7yOktCeDV+UxjYS8nyG7gsvaApP3kw6v0vMs=; b=o3efaARxJlsg87Yzr/xyfFOwoOorZZtXd6PiAeUBS50zQTJAnIKLJqmLCmKr/8HRqA TyDnHzPHCR/0xGc0vrcAGiyIKB7ZMt12A1YqgAbUFEfN7hTRZL0wHfU1YQqnQ7VjMtHR c49Tigv5Ip0MFPL3V1gzgKrLWRDVBCYp5LU6/EeOppifiw3mU0kc3IpngNGKcGG+NoM4 2A5/tlEMdOxzZcgJAfWDg44cGIJ2SaewVC6nRYOYm85xDXYfO503FTT4hXKE5lpoRyuG Ds/ITDKAm5iG86e5qvEnuKZNZRPaNbtAs9kQDxQ4TlQvtWhEZs5E0PJUe/Hnn0UVuEmS N/Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b="O/FqjDh0"; 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 n17-20020a509351000000b00418c2b5be53si816831eda.309.2022.03.16.23.48.15; Wed, 16 Mar 2022 23:48:16 -0700 (PDT) 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="O/FqjDh0"; 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 A406268B165; Thu, 17 Mar 2022 08:48:00 +0200 (EET) 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 C61F968AEA2 for ; Thu, 17 Mar 2022 08:47:52 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647499678; x=1679035678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sVxPY9uHQIST9BqtrHlhsPu95BZTdwm99pzeO4VLRXM=; b=O/FqjDh0QF3XCLHUQZd8/LqRuuhuQLNsjIkSe3loy8S4ySHzwZ7eWDSK hy2nLjdJcWDs7VtiFq+Hnz3ubBHKtcdGkVC9mnbXuTMRP3GtucdISYKXr r+PusNMA0oC6n8JFNBsry/qP/0wKjmuHm2DU8aV3b5hFmG0o0HQIqc9K0 k0JP/Xe4JO5lJH9iv7IdgCJ7e8+h9iaH2IFPrQvUPsigMFQrhqJB4vWHJ Z77mZSbk6jIqu4yTSEKEwMuryJqd3c6PpBSRXXPkeg64FisISYFdFDZpq 4L0wFy07L2af/LI4soR6Uup9kK/uyMEanm38vQ7j4IBJ8jDOVJzcThq7g A==; X-IronPort-AV: E=McAfee;i="6200,9189,10288"; a="238960174" X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="238960174" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 23:47:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="714919929" Received: from t.sh.intel.com ([10.239.159.147]) by orsmga005.jf.intel.com with ESMTP; 16 Mar 2022 23:47:50 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Thu, 17 Mar 2022 14:41:51 +0800 Message-Id: <20220317064152.430212-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220317064152.430212-1-fei.w.wang@intel.com> References: <20220317064152.430212-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 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: 9WCFKbbETFzE 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 706ec5d849..cafc860772 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;