From patchwork Mon Nov 22 21:58:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ridley Combs X-Patchwork-Id: 31552 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp7667824iob; Mon, 22 Nov 2021 14:00:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHKPbA5AElzmMlf98El2r/yCRiAgrUsFqU7KGOfCs55+Vnu6oAlThiFsclpPeMBUEfg4iR X-Received: by 2002:a05:6402:1a4d:: with SMTP id bf13mr608259edb.101.1637618440922; Mon, 22 Nov 2021 14:00:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637618440; cv=none; d=google.com; s=arc-20160816; b=pw7f2PchY38IQ24nb6AC1njtauGgU6G+wMlbn95Mwyi5lwmurkKbjQMQ27oCScO07l Hlg8+5jqlxIRoKOGjjbqd/afgqzF8qk6wyjVuj5a8Y4TAeNTMNem4qTl48d1kSmYzpby kpVArv3o+zLfcjRVcLHSWpG2WIhXzcQxbCmDG0zeSRsyvf2qEqc/zluAqsA1+arkoNdl ZFd5IJVlFuOCOkfvpOVOKe25vYBTabY5HMaBCfZAEXeAMTSjAWn0A48M2Bc7Qbg0Lsix TdlmE5PYzEHN6xwC8Wuo6kPo8sppKhLjeL9a8HDnJXAc0WQ7jRJlBzliXI/wKdaCAVlU mOrA== 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=IZUWJZzBTGvSseXEcvIbUrLv7gyB3hZK/NauMz32CDM=; b=slTT3Azfatehu9dLnn3Mh9+/tD4qWuQql/W2rIDI0HwIVGE21xtgpThUi4Rh2A0eoW l7lL8IG44XN2anVpLoptSDcYRCmnmSTnCfFo1ba6ncIVrlekXCydSgMuRIQA837EGgOT eHQbbVvG0WfdkxWz3xsbH384/nP8VeMdCVKbHiicsO95dUGhkt+JzazwPoDE3DLHJQiA jALpAW/1ZV7Wf7i4VFdqrqwg3fCOKH9IdRkU56tnt5V4Lyi+cK9gDAUdFY07uleGFz9Q zlP++7alOLZxBWrPypHjJWdMxRn9UDnmBou9+k9x+xPREBs9tEpmiGUX7Bf7XcxJ8Spb +8iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rcombs.me header.s=google header.b=oh56h0pl; 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=rcombs.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id yd24si19751531ejb.658.2021.11.22.14.00.39; Mon, 22 Nov 2021 14:00:40 -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=@rcombs.me header.s=google header.b=oh56h0pl; 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=rcombs.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 932F468AEA4; Mon, 22 Nov 2021 23:58:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB92E68A96A for ; Mon, 22 Nov 2021 23:58:39 +0200 (EET) Received: by mail-io1-f44.google.com with SMTP id m9so25425585iop.0 for ; Mon, 22 Nov 2021 13:58:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rcombs.me; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7WjyuEncBhM/olWa5t2p7bXN2kDvnMF1fnTrMBx1oGA=; b=oh56h0plxx7elU5UKv3CVdULWURTHndleZIaNSnJAhVLZWqUzOtZPTpAiB+Oct2jC2 0GMYJRI4lbPooYtRFGtvvy3gaF8TiSfXWpewMNpe5/WyPWdOGhxbHWuWgEOmwOtzRLoa HvpRpilLuF0SogWfMWXiIjc0dOUjCxz9AJcoJsWgW4o1y0pndPME0KFQ27vXuUsQuQoM EEEoqR4zVPK7LZw6IXtQwF0sYyL+t9XS2EgieXVUCo15L32qGB4gZ229Qdr/tFOKNKvb 88NNrRNuI5yJuL9e/5dGqYvIgkMFainrLVyrJpcThQ7fyiVJ03PqlK43NsOrzN7Kedcz E2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7WjyuEncBhM/olWa5t2p7bXN2kDvnMF1fnTrMBx1oGA=; b=51FJfpr98oJEIoSmMV1tGX+XsJOgTKbgT82uiBJpzSlClds1fLVIK5VhHFsRIN5sa9 e6dsfxuJAF8CrRkCdVV20I5kFFUX4J9WL/vBgwulwLyYA4eGtBgdMe+fL4YX54kBIrfX B+pUe0U4BLvncs2ct/4u316ZE6zxByM9iLWWP8RQLIP3c1QXWh4K8I4Vxq5IzLjY8ASe ZQ5p6TFXtCsY9xhOgaI6JGxjDa/XJqJnQ9U6uXYBYaut3FCdFUcRulxVXfzdwIPJ1Uvi Rbp1iI6kj6/6JVyA2QRm48D/KWERZKUegx9nT2MagQowyPwM1tlx17aD1Rb4eRlyvMAS 6nxA== X-Gm-Message-State: AOAM531b0eXBHDsUXwPgWuFimo1c5U50iIkR2yVYuNnXZIwARsoMhak7 Riij1l+e+wXvfUZS0GcmKqgqUBwVr1r4nQ0= X-Received: by 2002:a02:a489:: with SMTP id d9mr273198jam.47.1637618318348; Mon, 22 Nov 2021 13:58:38 -0800 (PST) Received: from rcombs-mbp.localdomain ([2601:243:2000:5ac:edf5:499:2479:42a8]) by smtp.gmail.com with ESMTPSA id o1sm5668802ilj.41.2021.11.22.13.58.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Nov 2021 13:58:37 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Nov 2021 15:58:14 -0600 Message-Id: <20211122215821.9849-9-rcombs@rcombs.me> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211122215821.9849-1-rcombs@rcombs.me> References: <20211122215821.9849-1-rcombs@rcombs.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/16] lavc/hevcdec: support all color formats in videotoolbox hwaccel 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: k/7jjl4HiBK8 --- libavcodec/hevcdec.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 3e19f4ebed..f99cd7094e 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -420,7 +420,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) #if CONFIG_HEVC_NVDEC_HWACCEL *fmt++ = AV_PIX_FMT_CUDA; #endif -#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; #endif break; @@ -435,7 +435,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) #if CONFIG_HEVC_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; #endif -#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; #endif #if CONFIG_HEVC_VDPAU_HWACCEL @@ -451,16 +451,25 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) #endif #if CONFIG_HEVC_NVDEC_HWACCEL *fmt++ = AV_PIX_FMT_CUDA; +#endif +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL + *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; #endif break; case AV_PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P10LE: #if CONFIG_HEVC_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; +#endif +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL + *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; #endif break; - case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV444P10: +#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL + *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; +#endif + case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV444P12: #if CONFIG_HEVC_VDPAU_HWACCEL *fmt++ = AV_PIX_FMT_VDPAU;