From patchwork Fri Feb 3 02:09:22 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: 40229 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp836022pzk; Thu, 2 Feb 2023 18:11:25 -0800 (PST) X-Google-Smtp-Source: AK7set+OM17iBFTjIBGCtVaGLOwy85YlZlfGs2mtjasS+M/gPEbz3j5XuqpZsz6GVDEO9bJWskK4 X-Received: by 2002:a17:906:c213:b0:878:8074:713b with SMTP id d19-20020a170906c21300b008788074713bmr9223348ejz.53.1675390285442; Thu, 02 Feb 2023 18:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675390285; cv=none; d=google.com; s=arc-20160816; b=hX5hozU5qo/FqBoFMyTCe4fFzMcQ76ZlkeYuprJqk0VIKahfoDcBNbzUWm3T7svw42 NRwn1OezcTR+kLkpGUgQwLxoAr8fbKyISsy0rcmVnCgGZu2uHGCtm56njY24Aub2wRIu ougAhgT7bO2X6UEBYfYhCQQNU4qzbalKJCrQyHH5hd9qEA9xRqtREpY1cuK1J77dXUFg 7NkTQ+yJ1U/fHMhqLz5fUJQTiBp7td2yhEVvBsq/2xXuaJhjfe/um9A8R7GDhuFOPwwr okMaViZt46Zy4sSwJnMRsK/QZRF5cVRw1421djkkPOdWxBBrWMM4JkwI6ezv2WgVcuP9 pRpQ== 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=9y2sYznUwFcFbCgVreP4Jg/hY6yASofEwFIf3i7Tdq4=; b=GbN/SOZ1NfTVoXnzrdPUbuAGGuBgN4w5PhhjUyrrBsec4LjZtjDFX9gi8yTbjXEFks KKQNUURr5KqZSJTWLOX7q9k+PiJgxW1Nl4q5mxbIGz/fJ4wvnBMeocKc3mJmYpKEBd9d qHKfV3ERW9wufCJmvIl31jKz8hf9xf7NmCMveahHByU3fuBBS+bipUkj8DK1TxivXvpq gc5lZWjJnn3+rapFzC8hJVbiWBruf0Nu+lpyckrDr8NiSLQjduhP+dWkyp84wn6P/KO1 R+Isb9r+o87FcExqnNh9/amSHL9WM6YO6WTcSbZqcssiKgQNyLUqJFZvnunN1qGzNY3U 8UPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=CxefZ3um; 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 cq6-20020a056402220600b004a25a20af56si1077604edb.340.2023.02.02.18.11.24; Thu, 02 Feb 2023 18:11:25 -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=CxefZ3um; 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 0CD5868BE6B; Fri, 3 Feb 2023 04:10:43 +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 4291568BE5A for ; Fri, 3 Feb 2023 04:10:41 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675390241; x=1706926241; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=hmm96N2EuVMW4p26W3oPsqzIxixkqHwJHDxg3DAgbqM=; b=CxefZ3umITRx5Ihj8hQdtOtQkRHeyvot6YguvgL9jlk7Blm1GW0uxZWl C6xc5Z26v5PEvGnwIXr+U5J/ltHOgasdZfPRssoz2i5n5foZ+0RsWk49g uMuuOQoRhpvFpgDQyde05ln708vpVBxM8FX9M923Uxq36pFKQwmIPmiS0 9LoDLVnbqF7MUjyAFlZIi+pqMyX+SuO18R4zyvX8lrL9HfKpwXbhkrH4e BQSK+nPwL2IkrgE9VC7fsBFIFo7hCw44srsngPZOZDzxp8OkShT88vyYL rRiQ7/8xSvdTTDc/bxRGA9NMUcJmozwA764X+12BPLHujT9na7ArPOKsL A==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="328651752" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="328651752" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 18:10:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="667505880" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="667505880" Received: from t.sh.intel.com ([10.239.159.159]) by fmsmga007.fm.intel.com with ESMTP; 02 Feb 2023 18:10:30 -0800 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Fri, 3 Feb 2023 10:09:22 +0800 Message-Id: <20230203020924.443162-8-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230203020924.443162-1-fei.w.wang@intel.com> References: <20230203020924.443162-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 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: SpT8d1cmflHL 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 73a8f5b4ce..c10617a81a 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_rext_scc_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..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 */