From patchwork Thu Feb 16 01:32:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Fei W" X-Patchwork-Id: 40407 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp116192pzk; Wed, 15 Feb 2023 17:36:49 -0800 (PST) X-Google-Smtp-Source: AK7set9sqlfJsMRrca39Sz/3qLKKRTIdKRl99r9cC3iIFNTrMpBJ32m4/xqzNzfcDxmaulsSYYc4 X-Received: by 2002:a17:907:72cf:b0:88d:72c0:611 with SMTP id du15-20020a17090772cf00b0088d72c00611mr6051216ejc.3.1676511408759; Wed, 15 Feb 2023 17:36:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676511408; cv=none; d=google.com; s=arc-20160816; b=h8OKKANsMu1RiAQ+DiAU1dkQ5Kb81HdvbkWzQnN1qCak1Y+Tat95M4GApUu3G5xUrL d7HIpTBo+x1ilIjZ3Ju/0htwifCOoY8y7Ay4nMjtmxUawTb15m7iGLIvHGOKCgQHbHjm geCgTia+7cUIppeaujogauVplGCDgBNXZ6mji/rYu1MV2795Ab04CtarxW0ofK+S7XfF ZAIt/HccBXmwi76P53VVD0B8Ot3VinTQp4DHWQRMSocByeEy3V+0GIH5drwFUz4ap06f IBL8URwXRMCn6UZnxLzbVF0DBX/OBQIi/e+PIXTnPi6k2QK9q7a+3+zOwOrSJoUdW3uV pCPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=y6VDCV3HyRaDIO/VKOcANrlsNddy21JEgopJdML0CnU=; b=w0YrreLcW0X/h2qtzmz6NQ+svUA06j6U8srjbSZbKOCmRabCptUiNFuymlIKVK8+l7 axwcqUcFUmLc/wH8O0OPAs7hr/jwn0qP2ft6E7aCMAHcUdp0wKT2ZzQvursn6Vz+L6x8 Or7nkfgYhERabY9dIjJQCdxvD231R1To/epoVngbsQE8zFRuLw8zjjRbjS9wB/bmaE4+ DfKfdLOoQN06mooDdoGcyiQQ1wCcVOjo8T7dTbsuYkeOyS+TuQsXzbdHSgjPm+K6eArR vjad9crvA6hPLBlpjL//y9AVlyB6PQriVoKi3pTg1btxoF/BIi2SIz6x87YC9PI2aM2t vZYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=fHnurAJH; 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 fu35-20020a170907b02300b008b12dcfd307si260131ejc.762.2023.02.15.17.36.48; Wed, 15 Feb 2023 17:36:48 -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=fHnurAJH; 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 9F3AA68BEFB; Thu, 16 Feb 2023 03:35:38 +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 4B48768BEC3 for ; Thu, 16 Feb 2023 03:35:29 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676511334; x=1708047334; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pXuG7eU4H624rWvc2n1fx8dkJ3wQyvtUr03EAJbcv3A=; b=fHnurAJHEsVYY2m/UnNHCdJT0crHTSwGdKUUCEYiHPmbydyHPfHvriIx 2BklxdGVK7tLqIFuASXAH+eyrWI1mzmAFApNF6to6s8S6qjoXjwOC4NKj d5jJwTUDzCHIzbi9TC8PWi1A1bqSa0y3navjJZSRxfZWgeGoCdiLFUtNb cNnHSsUexDG0Hs4wOByQxJN5CSmfla2OnAAqG32eXq1jgXrBzxHTjgE5v wtUUssB8RmPq9cOaxXU4v/PaJyOHYr4jKVsm67WldhWoBPL9KL8R1Nnx0 JwFn+SzKTgUNumQqM4VttxFm9weVFoVMB7ABIOl1QeqH/Aav1FrYB9uc4 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="311223809" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="311223809" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 17:35:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="779168810" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="779168810" Received: from t.sh.intel.com ([10.239.159.159]) by fmsmga002.fm.intel.com with ESMTP; 15 Feb 2023 17:35:18 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Feb 2023 09:32:46 +0800 Message-Id: <20230216013248.23044-8-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230216013248.23044-1-fei.w.wang@intel.com> References: <20230216013248.23044-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v6 08/10] lavc/vaapi_hevc: Add vaapi profile parse support for SCC 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zCPpYZjeUtsA From: Linjie Fu Note that Screen-Extended Main 4:4:4 and 4:4:4 10 supports chroma_format_idc from 0, 1 or 3, hence both 420 and 444 are supported. Signed-off-by: Linjie Fu Signed-off-by: Fei Wang --- libavcodec/vaapi_decode.c | 4 +++- libavcodec/vaapi_hevc.c | 14 ++++++++++++-- libavcodec/vaapi_hevc.h | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 134f10eca5..ab8c12e364 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -410,7 +410,9 @@ static const struct { #endif #if VA_CHECK_VERSION(1, 2, 0) && CONFIG_HEVC_VAAPI_HWACCEL MAP(HEVC, HEVC_REXT, None, - ff_vaapi_parse_hevc_rext_profile ), + ff_vaapi_parse_hevc_rext_scc_profile ), + MAP(HEVC, HEVC_SCC, None, + ff_vaapi_parse_hevc_rext_scc_profile ), #endif MAP(MJPEG, MJPEG_HUFFMAN_BASELINE_DCT, JPEGBaseline), diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c index a7b541750c..1cf43bd4dc 100644 --- a/libavcodec/vaapi_hevc.c +++ b/libavcodec/vaapi_hevc.c @@ -591,9 +591,9 @@ static int ptl_convert(const PTLCommon *general_ptl, H265RawProfileTierLevel *h2 } /* - * Find exact va_profile for HEVC Range Extension + * Find exact va_profile for HEVC Range Extension and Screen Content Coding Extension */ -VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx) +VAProfile ff_vaapi_parse_hevc_rext_scc_profile(AVCodecContext *avctx) { const HEVCContext *h = avctx->priv_data; const HEVCSPS *sps = h->ps.sps; @@ -632,6 +632,16 @@ VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx) else if (!strcmp(profile->name, "Main 4:4:4 12") || !strcmp(profile->name, "Main 4:4:4 12 Intra")) return VAProfileHEVCMain444_12; + else if (!strcmp(profile->name, "Screen-Extended Main")) + return VAProfileHEVCSccMain; + else if (!strcmp(profile->name, "Screen-Extended Main 10")) + return VAProfileHEVCSccMain10; + else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4")) + return VAProfileHEVCSccMain444; +#if VA_CHECK_VERSION(1, 8, 0) + else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4 10")) + return VAProfileHEVCSccMain444_10; +#endif #else av_log(avctx, AV_LOG_WARNING, "HEVC profile %s is " "not supported with this VA version.\n", profile->name); diff --git a/libavcodec/vaapi_hevc.h b/libavcodec/vaapi_hevc.h index b3b0e6fc1e..449635d0d7 100644 --- a/libavcodec/vaapi_hevc.h +++ b/libavcodec/vaapi_hevc.h @@ -22,6 +22,6 @@ #include #include "avcodec.h" -VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx); +VAProfile ff_vaapi_parse_hevc_rext_scc_profile(AVCodecContext *avctx); #endif /* AVCODEC_VAAPI_HEVC_H */