From patchwork Fri Mar 11 09:00:45 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: 34680 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp1511547nkb; Fri, 11 Mar 2022 01:08:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfTWLWjPR+ghXLer5ASpYV8Dqt5yQU7M3g5D6mC+vJ6Hv4IrAs9xPmLvLcH60u3nfj98aJ X-Received: by 2002:a17:906:6d09:b0:6b9:2e0e:5bdd with SMTP id m9-20020a1709066d0900b006b92e0e5bddmr7508532ejr.246.1646989703948; Fri, 11 Mar 2022 01:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646989703; cv=none; d=google.com; s=arc-20160816; b=K4kobkzNYr5r87qloYgwxf0U5bMlExeh2Bi8G12qD7DptlvxEDFutyuIKaMgrFlmG8 ykHMMaWuEh5HRprAZGmCgBTgy2ZVi/HeRQ0UqTRJJvgzVBGJfemC21X7X5s4JfYSWnN5 PjtEEB8XOT96axEgcBQ4WOb210hXnC5jqiNV7K+lx0Vo41N5m3BQzqNFgRxDrq+CCW7s tsdfHAZM75seiJarur/tkB4qj1eCILVRiS5NG6Z+uKbuOqr1xgbXX1L/aWCg2QQCcNUD 4mF5xAYxpCSXf4N78dEq9V6imy4rL+D4ODESMYQWOoYpIuHzUWxs2Yt9/geYZV/efZoc RFgQ== 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=G2KoUUbpO1w/VlN8NvB4l9uaIO/xEM/9R6bKrIhh6Nc=; b=zfxVgAPq6ERpQ5Pmi4r412GGP/8yr7wSQQDRvUAZzmgUusU0W/+I+Wli08OokyX3/F qPdcaW3FodbwTI5QzndlAbWFWkgqzIkcdYN3fZM/Nr8Dy5ke/xR22y/x2wqaFTcy/4Lr VFP3ijKctnwhD0SzMx/cgMHiCbVVC3pTsw9wtFDKwQZRq0CuGvdgQYrIIgYPEFxQcIJR F5S283qV1SdjPJ9lahbsrrp2t7VChO+gM3DMqhYiTZStAEnY5RvXfmgJ/Cp5Ahc1xkNf hgblV0/On5x9/n7XfxbnRIQQAaZ6Ot/2rwVWjdehh/SRuOJfactcHBwF8SYu31TKEkeR /sTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=HqiCi86A; 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 8-20020a170906024800b006ac3d8b2389si5048718ejl.847.2022.03.11.01.08.23; Fri, 11 Mar 2022 01:08:23 -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=HqiCi86A; 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 C4F0A68B27B; Fri, 11 Mar 2022 11:08:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 47A1D68B276 for ; Fri, 11 Mar 2022 11:08:13 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646989698; x=1678525698; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=05AFo1ISAkYtLxurthTKjGH8KcFyk6Hbhco3nIUnSXE=; b=HqiCi86AUnSKplGawPHdfYAY0FOeFhYORVvy1m6Cs8NYmTqhIFssFvuu C49aa738/FhgzoHv92hceqdDZy0kqxqaQb/sND4xRB+0ELy6J4lhNI1+y fsl+dA6ZjMgit+ZDGIZP1XF5nfMry2Pl+ZFh/tl/cmAQdp2COlreIcdCE JXvBAYxXwPOdW6oIn22HqHT/R1mLaItIi0Dou979yRgTSDJ4quFMghmQa FPWqFBoHEbSMDr8hf1lymCeBNvQfDbIzZShv+La1SVjnK0tZDSKd/Ta7z Tr4v/iXEOfayFW5hnaRchf3xEtbidgF6AJHq83V4TiqkydkXl52AhRknU w==; X-IronPort-AV: E=McAfee;i="6200,9189,10282"; a="255483344" X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208";a="255483344" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 01:06:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208";a="644872471" Received: from t.sh.intel.com ([10.239.159.147]) by orsmga004.jf.intel.com with ESMTP; 11 Mar 2022 01:06:42 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Mar 2022 17:00:45 +0800 Message-Id: <20220311090046.262777-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220311090046.262777-1-fei.w.wang@intel.com> References: <20220311090046.262777-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 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: CSpaK20fWCqy 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 099a68cc1b..e486e64eb9 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;