From patchwork Thu Dec 1 08:14:04 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: 39556 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp196370pzb; Thu, 1 Dec 2022 00:15:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rBPDvWRQ6g0mgGyR/3LGHnCkrwlUUY/h+nVXJIiolirlSKf2DHuvHTUb7QU42NiPP10fA X-Received: by 2002:a17:906:6b1a:b0:7bb:32f2:720b with SMTP id q26-20020a1709066b1a00b007bb32f2720bmr29515002ejr.550.1669882556939; Thu, 01 Dec 2022 00:15:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669882556; cv=none; d=google.com; s=arc-20160816; b=mNKfEjFnQlKTZsX9eHiE70u7ycmO2U4g/MV4qj2T5hkyGkVW2/Bc1Jh6zgFNi3k/or tjj0ooKfO3kac2Z2FcksGLeVzaAjzqviADxrORdmm9HahcY3WG3Wk/oveegVyguwEE5u +hWt9SXSWS8adGuJwXG8ABX2puYja7f+mXlsMC1VdDCyEyLcmXylTMX9gQjBGA1PWfhy n8kBNWbCeYYNcVYTT642G0mBOKXJ5/RsCl2qDZD+lPlOX5XQQxax/ImafbOr5dO+V94w 85dvqHJuMhKrDvswV4Iq2pE4mnsQWKLxdIlJjmg7HqFtAjta6D3cQQAygluQV4UJ2qh5 C/qg== 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=t2Biqpgr+ZrhNlwNTJ3Vx3ZYlTYx6NxMQaPoJHLPouM=; b=gGKk9yEwQYA8tfwWvPyIg89HYQcJU21o+Yp9pVQ9ovXcvcitscf/eKH2QbDjPAxJzh HqyYke9SrqVg4u8Zf7mROvLntv/DLM4AkVUuhoz1JmZRsiGNQmngBkZLEnn2f3C7vDDK WJmX5zsDdoR/k52+zBHIZNzAJdlRR/YQVdvCdiYmN6wP88HKV+OU6uE0F54p4WFIXBEY S/lAZSQ/DHf5REGzg0Z8jRB6vOOil3vDh+2WBd78QpJYG42R1GnzjjQJ3vb3shTdDBgT vLFIQpWxLBdRMRFbB1AReYyetZrXMQaXdaZYJtuem6Pv6LwqcMparBso6R4D1D7O/a+y ecZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=lDNI9WAQ; 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 hp8-20020a1709073e0800b0078d027ceb41si3744849ejc.857.2022.12.01.00.15.56; Thu, 01 Dec 2022 00:15:56 -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=lDNI9WAQ; 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 F0F1F68BA85; Thu, 1 Dec 2022 10:15:02 +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 E8E2368B081 for ; Thu, 1 Dec 2022 10:14:59 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669882500; x=1701418500; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5YtNoxcg/LlwrY39YL4G4jb4Z7PMtw9f2BnfVdO2gz0=; b=lDNI9WAQjSZhXHPFk/brRRPT+0HRJfUxUxUCKUXQoECzUd8Ud3WYrrRF mWM8/SI9wLCP3P55jVGDXbxVpOfUeMWR0aF1e5WzcmNWwYnYWRjz7SFtL auIRo7MJhejskVuixxhqO88gEWpNKUifyl9SOx5u6YkkyyeOx9nP3Jjt2 s5xXXBD67iRn3S6MnXJ0aVTgZRGbYvAFmuaLb6IURlvic10hGQKe3KSzw 7N98IuOm7p5HTLqT7rP8stQVa0QuVADeghw6R909ULur1uEDDL8ZD5p3x DN3+b3R0uYfXpeA0xCcp45y3OEdNNLo6dDBXzGNha6WYO3fpOmIPnjNdu A==; X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="298989859" X-IronPort-AV: E=Sophos;i="5.96,207,1665471600"; d="scan'208";a="298989859" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2022 00:14:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="675341788" X-IronPort-AV: E=Sophos;i="5.96,207,1665471600"; d="scan'208";a="675341788" Received: from t.sh.intel.com ([10.239.159.159]) by orsmga008.jf.intel.com with ESMTP; 01 Dec 2022 00:14:52 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Dec 2022 16:14:04 +0800 Message-Id: <20221201081408.2194579-9-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221201081408.2194579-1-fei.w.wang@intel.com> References: <20221201081408.2194579-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v1 09/13] 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 Cc: Linjie Fu , Fei Wang , Linjie Fu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0p2Xz/bmqwg4 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..29ac439b36 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_profile ), + MAP(HEVC, HEVC_SCC, None, + ff_vaapi_parse_hevc_profile ), #endif MAP(MJPEG, MJPEG_HUFFMAN_BASELINE_DCT, JPEGBaseline), diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c index 750738d36e..6ce1e17fa8 100644 --- a/libavcodec/vaapi_hevc.c +++ b/libavcodec/vaapi_hevc.c @@ -586,9 +586,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_profile(AVCodecContext *avctx) { const HEVCContext *h = avctx->priv_data; const HEVCSPS *sps = h->ps.sps; @@ -627,6 +627,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..7662dca510 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_profile(AVCodecContext *avctx); #endif /* AVCODEC_VAAPI_HEVC_H */