From patchwork Sat Oct 5 19:23:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 52071 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:938f:0:b0:48e:c0f8:d0de with SMTP id z15csp1133604vqg; Sat, 5 Oct 2024 12:34:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWT44hw3hYf+9nzRtrYpu9KpwA0WTDdi2jd8i4z1bzy7RLnEwiXimmP61vK0PGEDq0miJNM7CBy4BnutJJQbrmV@gmail.com X-Google-Smtp-Source: AGHT+IFnSIpG6PPI/MhXTI2ezb7NRC33NnjIoGXKuvvbqIPQ1xkNfO86jBqWDKLom9H+b4tVJmRS X-Received: by 2002:adf:f203:0:b0:37c:cd1d:b870 with SMTP id ffacd0b85a97d-37d0e765eb0mr6284223f8f.29.1728156857324; Sat, 05 Oct 2024 12:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728156857; cv=none; d=google.com; s=arc-20240605; b=NGpjo32Irft5O4Mb2BXVRJqoqaz2WcLvl3DaZ2A1Euzgp4rkU6pk8tNTKyE50sNFwn JlLTdHm0uEGB1zfG6hZVlXhD3qT/Rc+azmaXf5m5gYy3vbLxiaSz+Fu5jQ0hgD7Odzry vuTbicESo+9F/poSfMwYyeOts6xsm59G85THNkuE7TLxS+B9g6roma6dGZ+2OURZxlMp TsaXw2Vgj1971eVLf7R8tDnSuuRMLJiGaBMVD3oHlJ04xL18jXY02g0CZndfeGRcyrDg 9v6hFEi2CKHnPLL9y/Vsk0XTSVxq99a3ilvjGiLY3hnDC5SIdW7HnjcAadyJfuhAi1+/ /lAQ== 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=n/cwMdnFbRlsGtXZyYfS6GA4a1RhW7vA6oBfeXIFmeg=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=Z8IDjB0U9fyPSdkd6ppA+oBg06yzniUj9IkJR5fUc6nlYebF6HFmhmKH0uke/6rl5C 9AWsm+dJx/toQLh9hZy8PT9zStZT2qyx654FuIgbTdy/URJpsOldZLNbruNVJuf08cxO AUjSq/PF7FI+ZduoCaLtcaNFlG80bB9YqAtsCxvptSeq5kbBOj7TZ0RU0J9k6GBBxnSH yBSzx+ATbE9yXeQi771VUxosjawRKTKGc1569BpbSLmPZqtGzsY2+b9vrFUFYWUWoAEG JVv4Iuc+XA/2PI0fviwaM2jXAMdk7XyPo+1Y9YidBORi1XNAWN3yZO06ZNVSnzhpd/WZ XJpQ==; 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=IHcoELgZ; 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 a640c23a62f3a-a9939dbc6desi125309866b.554.2024.10.05.12.34.17; Sat, 05 Oct 2024 12:34:17 -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=IHcoELgZ; 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 CCB6668DA9F; Sat, 5 Oct 2024 22:24:25 +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 1DC8B68DA4C 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=1728156253; bh=OJGeI1R/z//NUCq1Kh9rFpqNMkc4+LGZDeNTtaV7XCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IHcoELgZAoKLZEefRweG/n87668lN/t2ex4SzPduSU9oVm+FV5wIK1cldQgTxReLY lV4oRR9ffZYItykhDG9yyUldGhNEGc4m4e+DK0WnikA1tKc/njH+e8p7AnjNmKRwsY PfLE8fheCDijfhpbnptBgaudHAhkQw5o93iCcCnE= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id DF36543CEA; Sat, 5 Oct 2024 21:24:13 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sat, 5 Oct 2024 21:23:58 +0200 Message-ID: <20241005192403.2450339-7-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 07/12] swscale/internal: expose ff_update_palette() internally 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: LP3v0O454gXp From: Niklas Haas Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas --- libswscale/swscale.c | 4 ++-- libswscale/swscale_internal.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 4ba35a61e1..e9323efb87 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -753,7 +753,7 @@ void ff_rgb48Toxyz12(const SwsContext *c, uint8_t *dst, int dst_stride, } } -static void update_palette(SwsContext *c, const uint32_t *pal) +void ff_update_palette(SwsContext *c, const uint32_t *pal) { for (int i = 0; i < 256; i++) { int r, g, b, y, u, v, a = 0xff; @@ -951,7 +951,7 @@ static int scale_internal(SwsContext *c, memset(c->dither_error[i], 0, sizeof(c->dither_error[0][0]) * (c->dstW+2)); if (usePal(c->srcFormat)) - update_palette(c, (const uint32_t *)srcSlice[1]); + ff_update_palette(c, (const uint32_t *)srcSlice[1]); memcpy(src2, srcSlice, sizeof(src2)); memcpy(dst2, dstSlice, sizeof(dst2)); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 33f9404b34..d2dd3b63bd 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -694,6 +694,8 @@ void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4], void ff_updateMMXDitherTables(SwsContext *c, int dstY); +void ff_update_palette(SwsContext *c, const uint32_t *pal); + av_cold void ff_sws_init_range_convert(SwsContext *c); av_cold void ff_sws_init_range_convert_aarch64(SwsContext *c); av_cold void ff_sws_init_range_convert_loongarch(SwsContext *c);