From patchwork Mon Nov 22 21:58:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ridley Combs X-Patchwork-Id: 31599 Delivered-To: andriy.gelman@gmail.com Received: by 2002:ab0:6957:0:0:0:0:0 with SMTP id c23csp7337547uas; Mon, 22 Nov 2021 13:59:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYxCIURkF5tdyoBX+ggG32sYmPYJKJ6bSe9GcB3TVy5xu2KPRdggNMNd9xsmfjp1O9pV8Z X-Received: by 2002:a17:906:f0d4:: with SMTP id dk20mr681596ejb.257.1637618349547; Mon, 22 Nov 2021 13:59:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637618349; cv=none; d=google.com; s=arc-20160816; b=i3XDNhXBB3oFYCuHXbenL6UMeFotdAk7OJoE+Gk5bgEnlsn5kYwAqnuUokDAyDP3Uy 7+okpojamurEmM87qKZAhDUDBRGjkQ7A7oTTsHTvQCbhP2uzHsocaZWZWMFNX88chefh pvOboR8sn0KzY3QMm//6NeaEGQBZpSCP67tafnbA+ugMR03v2VWqV+6lRrG5L8o1JilP 235fnMpiaGOtl89cFXvO54hnLEEfs/Bm1TPvqJOJFySvizLEIklmLKGd6/ex2w94rAd6 42r2UoYnieuIYUy45YUDblsbpUxJJ3W9ha2IbFD0zE8fhmfya383F99+3SwSTmZOzWFu PIGA== 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=srTRvVH+hebzDZTHFSVMmTStOO76PkGg5px9ANmvyRI=; b=bXSpQDebVpmAHfSyElD8cAkW46NVb9Mr3MA1LN1ScRhrdK5hAtlWOphGubg/39wlvu P2QHmUg4Vs72OjMRaiMTyxqx4XEgCu/LiRWugpVB/UIEC5QH9PrO0XQyj7re7XTFnz8o rIU0Zmp8sX1dkign2j3esf5NtyOwGmtT6V3C9S4hEO3SpRekPBCx9WaoZ5KcJld0OQn2 oQKTFVQTMyzKSjGf14E8fWAN4PV+fsdvV07B9XPIsolfWKLYNcqRF9kAFFhx/jntx1qt JMPsqdUKBSD0SrzHzXBGC3XKL1Ln6yAEJtmP+cnQEakFSkQ6j5Cw2bRuEO/+ldCebmoT 3+Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rcombs.me header.s=google header.b="H/xqoEiO"; 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 eb14si32016107edb.134.2021.11.22.13.59.09; Mon, 22 Nov 2021 13:59:09 -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="H/xqoEiO"; 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 A842A68A897; Mon, 22 Nov 2021 23:58:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F0FF168A96A for ; Mon, 22 Nov 2021 23:58:34 +0200 (EET) Received: by mail-io1-f51.google.com with SMTP id x6so3597227iol.13 for ; Mon, 22 Nov 2021 13:58:34 -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=Zxhfn7NPJs8PCgIItTNh/yfcO8YZF7Q3/kQwCPck1y0=; b=H/xqoEiONwuuyVY8xvNKYSQBqQcDs9l86coL7A935gEDlwmFqXkIQanMRnCsfpFUyo kBRmUqtSmEx+ZsLTk0CiItG7ni8hTzlBtbUoJNRlzDxNw5oeV55rcMU3EPMeCKso3UaW GBE1qYMyuK7c6O5MUtg9YnZKKlaxuK8p3iP3ZhKT+hpVt/H0SosXBsHYVDQgViE2qhEF 7nP+tFu+8O5+6I9xJTvINI+DyLwZ5GouRKJ6/s/BOLGk55wEdCALo6waqJWQDj4UtspA dDpNgj0vXC9YMup1Y/Q/hK5AuNjMpTkh0gUOlIMx7d82SA9MwWbqJH7PGPX48PG5pXwx Rd2g== 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=Zxhfn7NPJs8PCgIItTNh/yfcO8YZF7Q3/kQwCPck1y0=; b=Sk+zWII3Jn0eD4vgrEh3Ja0tOR1bTP/LaeKHvS3ynLWIqAoJoRGfL2+ED1DAYKP8HD iVVbxQ91TO8CjtTtZzT7crtIn9ToMcxDYvsH4aK36+jHQxBJgLPXwh4IKXkRZ8iJTHx1 gnr/EAwOeJpmEoaCjYD0r31IwFY6WxYFe7L1CgBVrukbeMdxslfCVPg62gATejRnf+1q WeJ0t7nURKAdcNr1lgspZYJmluB3I/ycC79pk5fXJlsrlwlKsn5rzWoGCBMdCX0FPY5Y /WZiQ3YlJapbryICSvJWxjZBYVSp42Vz6VhoXfhredxi0LFB7NsHkZMcG8S7tBmtROVX A+kQ== X-Gm-Message-State: AOAM530ZfGmgcu3fnln4JxaxeSexzIJxF7SfGzuE/gSwLx3E07jgBju6 DjuhBDNNBgTUoeSHswB/lzHmcjfVARrJ5u8= X-Received: by 2002:a05:6638:1607:: with SMTP id x7mr302182jas.27.1637618313333; Mon, 22 Nov 2021 13:58:33 -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.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Nov 2021 13:58:32 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Nov 2021 15:58:09 -0600 Message-Id: <20211122215821.9849-4-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 04/16] lavu/videotoolbox: add 422 and 444 pixel format mappings 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: ExyuMu8k2Y18 Content-Length: 5101 --- configure | 12 ++++++++ libavutil/hwcontext_videotoolbox.c | 44 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/configure b/configure index d068b11073..cc79b5b793 100755 --- a/configure +++ b/configure @@ -2329,6 +2329,12 @@ TYPES_LIST=" kCMVideoCodecType_HEVC kCMVideoCodecType_HEVCWithAlpha kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange + kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange + kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange + kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange + kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange + kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange + kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ kCVImageBufferTransferFunction_ITU_R_2100_HLG kCVImageBufferTransferFunction_Linear @@ -6282,6 +6288,12 @@ enabled videotoolbox && { check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia" check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia" check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo" check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo" check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo" check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo" diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c index 25f4e17715..f7a1299cc3 100644 --- a/libavutil/hwcontext_videotoolbox.c +++ b/libavutil/hwcontext_videotoolbox.c @@ -53,13 +53,57 @@ static const struct { { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange, false, AV_PIX_FMT_P010 }, { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange, true, AV_PIX_FMT_P010 }, #endif +#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE + { kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange, false, AV_PIX_FMT_NV16 }, + { kCVPixelFormatType_422YpCbCr8BiPlanarFullRange, true, AV_PIX_FMT_NV16 }, +#endif +#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE + { kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange, false, AV_PIX_FMT_P210 }, + { kCVPixelFormatType_422YpCbCr10BiPlanarFullRange, true, AV_PIX_FMT_P210 }, +#endif +#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE + { kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange, false, AV_PIX_FMT_P216 }, +#endif +#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE + { kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange, false, AV_PIX_FMT_NV24 }, + { kCVPixelFormatType_444YpCbCr8BiPlanarFullRange, true, AV_PIX_FMT_NV24 }, +#endif +#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE + { kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange, false, AV_PIX_FMT_P410 }, + { kCVPixelFormatType_444YpCbCr10BiPlanarFullRange, true, AV_PIX_FMT_P410 }, +#endif +#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE + { kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange, false, AV_PIX_FMT_P416 }, +#endif }; static const enum AVPixelFormat supported_formats[] = { +#ifdef kCFCoreFoundationVersionNumber10_7 AV_PIX_FMT_NV12, +#endif AV_PIX_FMT_YUV420P, AV_PIX_FMT_UYVY422, +#if HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE AV_PIX_FMT_P010, +#endif +#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE + AV_PIX_FMT_NV16, +#endif +#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE + AV_PIX_FMT_P210, +#endif +#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE + AV_PIX_FMT_P216, +#endif +#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE + AV_PIX_FMT_NV24, +#endif +#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE + AV_PIX_FMT_P410, +#endif +#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE + AV_PIX_FMT_P416, +#endif AV_PIX_FMT_BGRA, };