From patchwork Sat Oct 5 19:24:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 52078 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:938f:0:b0:48e:c0f8:d0de with SMTP id z15csp1535023vqg; Sun, 6 Oct 2024 11:26:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/F/M7sy8v2d4rTpBaqKDkBpIozSOD8FWYQ7F6KeZ8MVtALao071wufPwL1bwd+dgTfcz85Lhxj+/6j7IXhYnq@gmail.com X-Google-Smtp-Source: AGHT+IE74M7CtpKmX4fJPrTWDSCieXbaTbTIINn35l6Ul5vehpAC6KR8OqXUBHuAllmcVb1j5NKg X-Received: by 2002:a05:6512:282b:b0:539:936c:9845 with SMTP id 2adb3069b0e04-539ab9cf214mr5227153e87.37.1728239168164; Sun, 06 Oct 2024 11:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728239168; cv=none; d=google.com; s=arc-20240605; b=eSqdEkezawgzsvTZRuK/7Eho5pEHQYFpoqorDA4KlGFFaRMHqVhcpZ3ilwd8PKn79V Av0IqI4omQIxGrIEnu+lAabJMbw7tHZ3z931N30s2lNfhUu8ExX17L3OkN6I+2oYbppr vnSN5ar/aVy0GmKHCHpndsRpxW/yDqns69UJ7pDxFgzRZHmCKTZLBnS9D3yLchu3gBvL Wyw3SJo+rsb/XwYyDxvGbUBY1P+2+0I92hwjhuGLcxWrjFLiUysfl1jiva9c6eYkloJo H1Mw4JK96LVrQeqMU9oPya4JBspSHA5aMg5HzX7TfID6SFOmZbF5pGi4rda7KUSL2+sO R+vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=4FafWv+A9d1fEcwD6Ho7Gvjg4ibRref6nBact7gir3o=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=H44KsYlTL1/64eHx/vrMyRGy4+V0NP5EHa61x5R02joMztnKIvjW3WPeC3J2CtTdzH Fav8QNkTPkpLeWitaDpuhBvbN5XXOaEgLp69dOQxW0x7lCc6Mo8X4ImBNYun8LHpjaQJ 48xV2TuAJdUlYvx2QBVEPGk/Z0liTCglL975r/vDRwEr4h/LkaQMZoMj5FjTVHQi0c0c qWP1gTLzHz9QX+1viRImLHiOwlcME3Opdifn+7u9+nV1HhZ+rL0GdyNK6aqr6BfisJW3 FZQUtHHvE2YQOa49AZeuUJ0X5Bvo/95UChAx/m5qbzR1Ej0/LnMmszZ0GNWgHODymxFP 3bew==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=ZVipwf52; 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 2adb3069b0e04-539aff26200si1281916e87.450.2024.10.06.11.26.07; Sun, 06 Oct 2024 11:26:08 -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=@haasn.xyz header.s=mail header.b=ZVipwf52; 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 35B5868DB24; Sat, 5 Oct 2024 22:24:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C27768DA96 for ; Sat, 5 Oct 2024 22:24:18 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1728156255; bh=P+cF3En84oUN4t2bDZR+lGmOeN2NV2t6QIKOEfvH5Z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZVipwf52pZb92gJ3cdD2u7ENsKijtKMxgFuA+99bZSUfpZVSv++e8Xb65CnfBL8wF VsE2RYPf+zBq0xf7CZSyiVJisdM/fPf6ziegE+Cm3HBLhiNYTaiLtQBIM6MLgvbIzH BBVuu6rZS2JjlRnrdLUntOFQ0s78Q7qUOVmfDAno= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id EBB6E443FC; Sat, 5 Oct 2024 21:24:14 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sat, 5 Oct 2024 21:24:02 +0200 Message-ID: <20241005192403.2450339-11-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241005192403.2450339-1-ffmpeg@haasn.xyz> References: <20241005192403.2450339-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/12] swscale/internal: add typedefs for input reading functions 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: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dGG5H+rUN64E From: Niklas Haas Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale_internal.h | 47 +++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 0e9d37b5b0..e87b073d57 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -292,6 +292,31 @@ typedef void (*yuv2anyX_fn)(struct SwsContext *c, const int16_t *lumFilter, const int16_t **alpSrc, uint8_t **dest, int dstW, int y); +/** + * Unscaled conversion of luma/alpha plane to YV12 for horizontal scaler. + */ +typedef void (*planar1_YV12_fn)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, + const uint8_t *src3, int width, uint32_t *pal, + void *opaque); + +/** + * Unscaled conversion of chroma plane to YV12 for horizontal scaler. + */ +typedef void (*planar2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src, + const uint8_t *src2, const uint8_t *src3, + int width, uint32_t *pal, void *opaque); + +/** + * Unscaled conversion of arbitrary planar data (e.g. RGBA) to YV12, through + * conversion using the given color matrix. + */ +typedef void (*planarX_YV12_fn)(uint8_t *dst, const uint8_t *src[4], int width, + int32_t *rgb2yuv, void *opaque); + +typedef void (*planarX2_YV12_fn)(uint8_t *dst, uint8_t *dst2, + const uint8_t *src[4], int width, + int32_t *rgb2yuv, void *opaque); + struct SwsSlice; struct SwsFilterDescriptor; @@ -561,28 +586,18 @@ struct SwsContext { /// Opaque data pointer passed to all input functions. void *input_opaque; - /// Unscaled conversion of luma plane to YV12 for horizontal scaler. - void (*lumToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal, void *opq); - /// Unscaled conversion of alpha plane to YV12 for horizontal scaler. - void (*alpToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal, void *opq); - /// Unscaled conversion of chroma planes to YV12 for horizontal scaler. - void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal, void *opq); + planar1_YV12_fn lumToYV12; + planar1_YV12_fn alpToYV12; + planar2_YV12_fn chrToYV12; /** * Functions to read planar input, such as planar RGB, and convert * internally to Y/UV/A. */ /** @{ */ - void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, - void *opq); - void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], - int width, int32_t *rgb2yuv, void *opq); - void (*readAlpPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, - void *opq); + planarX_YV12_fn readLumPlanar; + planarX_YV12_fn readAlpPlanar; + planarX2_YV12_fn readChrPlanar; /** @} */ /**