From patchwork Mon Dec 5 06:09:25 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: 39609 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp3010762pzb; Sun, 4 Dec 2022 22:11:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gFL0UXv0f6uQ62/RugOkYTal5fEZCZz3U7sKIpUormbN9zB4R9UqJHN5qmUKP8n5ktX5o X-Received: by 2002:a05:6402:530b:b0:461:f919:caa4 with SMTP id eo11-20020a056402530b00b00461f919caa4mr73387471edb.255.1670220701169; Sun, 04 Dec 2022 22:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670220701; cv=none; d=google.com; s=arc-20160816; b=M3X/rnt11Ofm8tTg+VFKYmyOIh2yv2ZkKtwJ1KK6tcyi+rP/ut31Bv19hJp5EK2Rzs RaKdyhcOabh0jZOyI1VTBY2Cdia7dQ4eMS37dZXMM5hy/iXqMY9kjp2JPcb+Kd+4Yo1n cgT3/URVT4ZxyzFs0B58t+UC+zqdGcvJGSu33lDCnD9a5kQnffVOQ/oZHYXqQ2gT2WU8 +dJrrYulP88UpzUjtVy2TrQfIyqYcLNqbzghr0BWVwwYKv1AKDDU9vdnsR+zXl06sKnT yguLD9NP84MwKT7O4s24UCwMVojvLgRVMzq+OSiypxJqjZMRaK3q+coRBwdvGLuyZAMj AbEg== 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=IGFvkfWvL6TNTw8GTsnIgE8a1ur0bfEdR1qk3cZeQcELS/6/81hKjYnXERtL7NQsgU XqaR+RwbIR8YHM0qoflEWWL0BAcR/v1WAQgE+C60icy0LNz8SEUShl/J9FDbJ5ciYvEM aISsfd8i4ydhTHkzGhTkRAn2kOrul26iGCCJVOtgDTMTGThAZcE5tASENwunCpymry19 /K8wCSo/NkzThF51PH7N0Th9Uv6omP7lv2H2D9Lem0Z6OUcZj31bOFpeOi8RfPIxIKlg hIBboSudYNnmX1tQ83YOZJq8PyDRV1QPH0cFl3je+63HDwURmfxZCfVMVvDpHV8IsAiw hsuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=Bt6QPKdU; 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 js4-20020a17090797c400b0073d8830e4c7si12089709ejc.954.2022.12.04.22.11.40; Sun, 04 Dec 2022 22:11:41 -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=Bt6QPKdU; 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 5C1E568BC82; Mon, 5 Dec 2022 08:10:14 +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 9EF4E68BC6B for ; Mon, 5 Dec 2022 08:10:04 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670220609; x=1701756609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5YtNoxcg/LlwrY39YL4G4jb4Z7PMtw9f2BnfVdO2gz0=; b=Bt6QPKdU0/fCozGlpiOEqqge22ZkZPHb9NBBus0E/6G8/4wGViZFpK5z N0FTD4ckBCR+gbwtZev1LKHHIi6eTFNoyt7o+zOwCB9Zk8Akx6+MTtWb3 xvqHCfzHdlQKKeLtdiYbsjMrM9blyQV8QwSWgFTkuehZqW2dqumHJR3Da wxdFXRDEC0W738PpyG9r4R21dQg3RB07mYraVUYvWKeXrCS3NLqdIr57G YkIy6/AySrLErMjWlXRLzR8iYDVrkv82ZA7f0mTbBi82HEV22BBPa/Ye4 0v1rTXX/jsAXVCIo1n2NgdzH2iXdcrM/uFgC5Yc3nQUDSCOI74+QQe3wS A==; X-IronPort-AV: E=McAfee;i="6500,9779,10551"; a="295971392" X-IronPort-AV: E=Sophos;i="5.96,218,1665471600"; d="scan'208";a="295971392" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2022 22:09:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10551"; a="645700103" X-IronPort-AV: E=Sophos;i="5.96,218,1665471600"; d="scan'208";a="645700103" Received: from t.sh.intel.com ([10.239.159.159]) by orsmga002.jf.intel.com with ESMTP; 04 Dec 2022 22:09:57 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Dec 2022 14:09:25 +0800 Message-Id: <20221205060929.2511871-9-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221205060929.2511871-1-fei.w.wang@intel.com> References: <20221205060929.2511871-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: 9H1ZtcP+2MQb 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 */