From patchwork Sat Jul 23 18:53:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 36929 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp1157199pzb; Sat, 23 Jul 2022 11:54:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vt5cHnSDvCzS9S5VIGCy73/BrQDB3jdefGaJT9dKRyld4ItI8AA8oRg1zdBsJ0IEQqmeLg X-Received: by 2002:a05:6402:5489:b0:43b:b935:db37 with SMTP id fg9-20020a056402548900b0043bb935db37mr5525889edb.347.1658602451634; Sat, 23 Jul 2022 11:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658602451; cv=none; d=google.com; s=arc-20160816; b=1Drd6Q67PQZDYtV8j+5dvkioXdkj5QFKc7gNshme5TANQASN39SCA1d6KczM1qOpvY 4hpUJrKv3wfQdsqHqpMa7AF5T7APVEKD5CKd1c5cI0Kc3Jl2aMWZwOzG52yE478/WaYM OJPB3q3P4+P/nTQlAoNkRdTzkVxERXb3DvKXpv8N7hZltwXe2k3w5gCXrj+0cccGU91t 5LqqGfbiNB7+Z65tp73LIQOOsW9Zp5dTpCifzEMLrDPvdzvgL0M19LrbKmoh2OH5lyuN etMfXNmIiIIkE6NFQz8mHbmh2bqXw41Fnf5ZtQc/G7GNylm8r1Aaa0ymCiRv5hEPCocv uXfg== 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=0i+cqY0p4s3etfk8Qm86pW0C+sw6HDUvCd10K3DsGLY=; b=NqlHrKINq6IrrCJvvwzdvuNiyZANgay71jkRxeVX7HPM4VSnTRfO0wFL4GA3KIVEoJ SEFPOg1VV12p/Ii8SceN1lpW9DTvxc7U+Q/XYfM7n64vQpUrP2SIp/DhTyvS7M53qasO G1RL7xgXzT1dSmheluDEuHXo3yu/A4HQEEAtgtJkJjLnxAW2RpYIKPeE+igi1/useHi5 jg/Zt2YYAeNiJx696ukUNgIl3JjwthzAsgABsfmi8/7WwkCu1C4S3NrAqeo2aFePITaw J+0nBPV8GOFojL3aWXc/xU0q1jvFpJLE9iXBnChaAMPeH9IkKPizFMvNcC9wb+HrPBEl mtjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=k53G+wNe; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=overt.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id su7-20020a17090703c700b007156fc5217bsi2598367ejb.899.2022.07.23.11.54.11; Sat, 23 Jul 2022 11:54:11 -0700 (PDT) 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=@overt.org header.s=mail header.b=k53G+wNe; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=overt.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CFBA168B7D4; Sat, 23 Jul 2022 21:53:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B707768B6AC for ; Sat, 23 Jul 2022 21:53:33 +0300 (EEST) Received: from authenticated-user (mail.overt.org [157.230.92.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 632D53F6BC; Sat, 23 Jul 2022 13:53:32 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1658602412; bh=+yeTzvq5x4FCCYXXaOlWeHJ9uyiGANV7uZ+TnIBnzPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k53G+wNe3Q+zxyO/2ynkglx1Jpwxm0H+Cxr4+u5Uh+x68TW9mfRGRvmGhx09P07pS uVnJCfIbpDtj1rfnikY+K/5u7vKM9fDOsINshixv+u+tE45qt4dgj9vVseghwfJskQ OQ9TmoQJZfHKGK45Warv1odtBq4KIyAh9GCsMPDrhFNfHJRKqEE7VOmb2xGtuMdq5b QP+BPwDcPHftrInFseROdxR+iz70MA5lQh9ogc0JmkMkSQW/0VfGRgDCGu2RtRfcoh eSoZh22vs0laygG+JFkNVyHzoqNcL+CFZMv0KWkDyiyTyvfG8bkoTI6h38JqATydKW X+j1LqLTXgRLA== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Jul 2022 11:53:15 -0700 Message-Id: <20220723185315.207081-4-philipl@overt.org> In-Reply-To: <20220723185315.207081-1-philipl@overt.org> References: <20220723185315.207081-1-philipl@overt.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] lavc/vaapi: Declare support for decoding 8bit 4:4:4 content 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: Mark Thompson , Philip Langdale Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UDGXFDzUILai Now that we have a combination of capable hardware (new enough Intel) and a mutually understood format ("AYUV"), we can declare support for decoding 8bit 4:4:4 content via VAAPI. This requires listing AYUV as a supported format, and then adding VAAPI as a supported hwaccel for the relevant codecs (HEVC and VP9). I also had to add VP9Profile1 to the set of supported profiles for VAAPI as it was never relevant before. --- Changelog | 1 + libavcodec/hevcdec.c | 3 +++ libavcodec/vaapi_decode.c | 2 ++ libavcodec/version.h | 2 +- libavcodec/vp9.c | 5 +++++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 92780c9953..a5539d5ec3 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,7 @@ version : - ffmpeg -shortest_buf_duration option - ffmpeg now requires threading to be built - ffmpeg now runs every muxer in a separate thread +- VAAPI hwaccel for 8bit 444 HEVC and VP9 version 5.1: diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 2d06d09b75..7070ed3f02 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -452,6 +452,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) #endif break; case AV_PIX_FMT_YUV444P: +#if CONFIG_HEVC_VAAPI_HWACCEL + *fmt++ = AV_PIX_FMT_VAAPI; +#endif #if CONFIG_HEVC_VDPAU_HWACCEL *fmt++ = AV_PIX_FMT_VDPAU; #endif diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index a7abddb06b..db48efc3ed 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -267,6 +267,7 @@ static const struct { MAP(422V, YUV440P), // 4:4:4 MAP(444P, YUV444P), + MAP(AYUV, VUYA), // 4:2:0 10-bit #ifdef VA_FOURCC_P010 MAP(P010, P010), @@ -410,6 +411,7 @@ static const struct { MAP(VP9, VP9_0, VP9Profile0 ), #endif #if VA_CHECK_VERSION(0, 39, 0) + MAP(VP9, VP9_1, VP9Profile1 ), MAP(VP9, VP9_2, VP9Profile2 ), #endif #if VA_CHECK_VERSION(1, 8, 0) diff --git a/libavcodec/version.h b/libavcodec/version.h index f2f14eaed1..ecdbc51c74 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #include "version_major.h" #define LIBAVCODEC_VERSION_MINOR 39 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 12ec87992c..834fbebb01 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -231,6 +231,11 @@ static int update_size(AVCodecContext *avctx, int w, int h) #endif #if CONFIG_VP9_VDPAU_HWACCEL *fmtp++ = AV_PIX_FMT_VDPAU; +#endif + break; + case AV_PIX_FMT_YUV444P: +#if CONFIG_VP9_VAAPI_HWACCEL + *fmtp++ = AV_PIX_FMT_VAAPI; #endif break; }