From patchwork Thu Feb 16 05:46:35 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: 40417 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp244901pzk; Wed, 15 Feb 2023 21:50:45 -0800 (PST) X-Google-Smtp-Source: AK7set/Pgl21tSUvaYt1qzhlDs1skU+2Itq5H5D8y2zfioWE56v3fq1Mc1xICOlqMWBY808hvY00 X-Received: by 2002:a17:907:119c:b0:8b1:264d:6187 with SMTP id uz28-20020a170907119c00b008b1264d6187mr5335951ejb.46.1676526645075; Wed, 15 Feb 2023 21:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676526645; cv=none; d=google.com; s=arc-20160816; b=R7tuiG83POqN8J6TXW29CJiRG9LHm7oDkdUyscqHCGnIJNQa0orI1tcb4s3FVPDBlW BV/PaYWVPKINNSo+zP8Nt1QShS41H5DqplDvwGkFXbudub1aW9+OS/eS7kfYpTARZ5nf VEmGnQUXp/vmFfTLyvCayaELhePV9u/rwqV9l5u5f+dChhiPbK99n6187SvEVmnVNuzA aiGSiqxNMXO9cqUGhQDn8I7xdjw6t43MFF7AKRPbwsD0/bncCNhc9+ssBDr+AbotmgkG +q2np0l1TOZ9LhVaaLUXGN+qcWSApNDqBkxLlFWwAlQuZN9MyAt2zTqD285s65DeUU1Y vVrA== 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=q4pjzCre+9kPaCfATRqTLjZ0V1SNj8jGBuNCpfhgkQ1Poq+rPmp0a2kX4OPZtLZiRi nfmHgO1b17DQZj5sWWvRrvUOMKewtsFfSqkfrgSlI4nR6FQ97TA+36hG1GE8t60+Z75f +cK1lTj6kHy3T8ayKgpzFg9DysH+a2UPuAiw9n3A5/TXZafU+SDCU9wFOFqIF2lii0M6 eoyg5KhQUziEc1wqnSbGSihHkTi8L4AyripvWXAIOeoiKDO5mN7YcM3EW83DmE/TCbA8 98y6gp3XovoD8NxBm+cXMBCBHsb/Z/PFlsXlehf8FUpXx2FBsVa3qWyWqWhzx6WwqFLT 4k6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=AcKiJt3A; 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 ay8-20020a170907900800b008b12652459csi832164ejc.392.2023.02.15.21.50.44; Wed, 15 Feb 2023 21:50:45 -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=AcKiJt3A; 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 2FB4568BF3F; Thu, 16 Feb 2023 07:49:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27FB668BF22 for ; Thu, 16 Feb 2023 07:49:20 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676526566; x=1708062566; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pXuG7eU4H624rWvc2n1fx8dkJ3wQyvtUr03EAJbcv3A=; b=AcKiJt3AV2C9oA4D7yp4HNmrikpoueFV1ESJxvCbzZQ/2xXljt+b8kgX q9wfb5+3f0TS7T+JmB88qfE+9TTss81Ppayxp8ev1UDpf1HTfSB9FuMZr TCjJusNrtilAY0wQsty6GlVe0R/ICRRws//Kvbx7dnW/l0hcW67fZcQ7B omcI6zyHkwjnO9HgfWFpZ6lgzihkLO6E7kJQK3IYjSgLMeZj2SiH5eTZH G8WFeIWM4WfTzwspRftNyNLi+0kCAkUHaN5QbzkOzlK9UEhPCEe93GAaj VYZJ1JEBtBYwIuTnsSULMhxgoMGO7WRsGSmt85AXBAxtlYGwhKy4tvyzU A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="331633193" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="331633193" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 21:49:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="915547520" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="915547520" Received: from t.sh.intel.com ([10.239.159.159]) by fmsmga006.fm.intel.com with ESMTP; 15 Feb 2023 21:49:07 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Feb 2023 13:46:35 +0800 Message-Id: <20230216054637.159397-8-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230216054637.159397-1-fei.w.wang@intel.com> References: <20230216054637.159397-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v7 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: 1zO61b6KJl5Y 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 */