From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#74476: [PATCH] Explore JPEG loading without quantization Date: Sat, 30 Nov 2024 19:55:17 +0000 Message-ID: References: <871pz39v6p.fsf@ledu-giraud.fr> <86iks581nf.fsf@gnu.org> <87y11093gx.fsf@ledu-giraud.fr> <87h67obpn6.fsf@ledu-giraud.fr> <878qt0bmj9.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18944"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 74476@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 30 20:56:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tHTZh-0004l0-Sm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Nov 2024 20:56:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHTZV-00075d-0B; Sat, 30 Nov 2024 14:56:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHTZS-00072Q-PL for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 14:56:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHTZS-0008AN-Eb for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 14:56:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=Z9gDfyCzDr/8lVHb2oaO35w747p7sbAfgfpLghB8Y1I=; b=Ca4cIMyuMcQDHUdDCbLZsJewwI0labv7n7iUggNQIJr7n01pzz2EUSnDeLQM339TxxgYhQF0dF+y8ZvbhACU/2DYnfMMFFJxtCh4HxNTBCN0bnQafYfhQj+2zleB6knnQ90dwkLMe4ezhSa6unooAszLK9YTsH8VOtyWoF4KX1qt0i706bpy3L219OaHjS7g7ijbR9tZpwLKmNdok36/HsrraV1KH7SGNVI867UBeg9WYvR91dBk5y7Bp/YVgAKanl7QmvDPglRDbYZn0T+bV+6Cqr9UOKr2gYMpw04DEN4ovfNnxhvlMpZFpeP1TH690O6A+ZQ0irChgVVIW8iLsQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHTZS-0005mv-5Y for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 14:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74476 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74476-submit@debbugs.gnu.org id=B74476.173299652722174 (code B ref 74476); Sat, 30 Nov 2024 19:56:02 +0000 Original-Received: (at 74476) by debbugs.gnu.org; 30 Nov 2024 19:55:27 +0000 Original-Received: from localhost ([127.0.0.1]:49192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHTYt-0005la-76 for submit@debbugs.gnu.org; Sat, 30 Nov 2024 14:55:27 -0500 Original-Received: from dane.soverin.net ([185.233.34.148]:45211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHTYr-0005lG-SG for 74476@debbugs.gnu.org; Sat, 30 Nov 2024 14:55:26 -0500 Original-Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4Y11472T20z2xCX; Sat, 30 Nov 2024 19:55:19 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4Y11466DdnzTq; Sat, 30 Nov 2024 19:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1732996519; bh=7Ftkzavbx8ejqCyMFjxnfT9efdjBMraC8esJ9ZrYdLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zj/JGb+vO7AW88SiDCtCaHFL4u4l/JFTzUlb6A6ILjybQbNif/324Cu8njnFiQZWL uDYWF00UZ2m2Qdoon9jFIwNumh6QU1ghEnT4f7rGubQBTAC65ciyCbC9Sx0tOQ6IGP yS/885wFYOpN7HVsklKmKcSJ3vmkhn8hC8F0tvuAG3lNPJpsC8IH+e7IsgqCuySWp0 Iuv26EiYNlKO698Gz9XACoJQfu/PwnMtUGA1npwCIMq3To8dP3xjxH39pzKhtgFUwH 0APgvS8+5cUO1XJtNSCXSPFfSZlpJm0gueV+n4TLOWzTOG2A9RqhJ/pHrQLb1H/LsU wHD/tAgosrLhA== Original-Received: from localhost (faroe.holly.idiocy.org [local]) by faroe.holly.idiocy.org (OpenSMTPD) with ESMTPA id b3fa038c; Sat, 30 Nov 2024 19:55:17 +0000 (UTC) Mail-Followup-To: Alan Third , Manuel Giraud , Eli Zaretskii , 74476@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <878qt0bmj9.fsf@ledu-giraud.fr> X-Spampanel-Class: ham X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296208 Archived-At: On Sat, Nov 30, 2024 at 07:32:10PM +0100, Manuel Giraud wrote: > Alan Third writes: > > > Probably I could do with finding some larger images as the whole thing > > completes in under a second even without your patch. > > FYI, I have used images of 4000 by 3000 pixels. > > > I've had a quick dig into lookup_rgb_color and assuming you have a > > true colour display and there's no gamma calculation going on (I don't > > know when that happens) it shouldn't be doing a whole lot more. > > Perhaps it's just the extra over-head of calling a function? > > It seems a bit much for just a function call. Or maybe it is the > init_color_table call? Should it be done for each jpeg_load? It's 4000x3000 function calls, so it might have an effect... I think it should be done for each load. And I just noticed you need to add a free_color_table call after you're done with it. I get that it's a waste of time allocating the table on a true colour display because it's never going to be used, but it seems to make no performance difference here and it is still needed on other display types. Purely for testing purposes I tried changing the PUT_PIXEL call to this: PUT_PIXEL (ximg, x, y, x_make_truecolor_pixel (FRAME_DISPLAY_INFO(f), r, g, b)); I think it might have given an improvement, but it was so slight I can't say for sure. That obviously can't be used outside of testing, but it lets us rule out the function call, etc. -- Alan Third