Return-Path: <tiff-bounces@lists.osgeo.org>
Received: from mailgate121.isp.belgacom.be ([195.238.20.53])
          by mailfep007.skynet.be
          (InterMail vM.8.04.03.28.4 201-2389-100-182-103-20180124)
          with ESMTP
          id <20210504174429.YCFY7205.mailfep007.skynet.be@mailgate121.isp.belgacom.be>
          for <chris.lindelaan@skynet.be>; Tue, 4 May 2021 19:44:29 +0200
Received-SPF: None (mx101.skynet.be: no sender authenticity
  information available from domain of
  tiff-bounces@lists.osgeo.org) identity=pra;
  client-ip=140.211.15.3; receiver=mx101.skynet.be;
  envelope-from="tiff-bounces@lists.osgeo.org";
  x-sender="tiff-bounces@lists.osgeo.org";
  x-conformance=sidf_compatible
Received-SPF: Pass (mx101.skynet.be: domain of
  tiff-bounces@lists.osgeo.org designates 140.211.15.3 as
  permitted sender) identity=mailfrom; client-ip=140.211.15.3;
  receiver=mx101.skynet.be;
  envelope-from="tiff-bounces@lists.osgeo.org";
  x-sender="tiff-bounces@lists.osgeo.org";
  x-conformance=sidf_compatible; x-record-type="v=spf1";
  x-record-text="v=spf1 mx a:mail.osgeo.org a:lists.osgeo.org
  a:mail.osgeo.osuosl.org a:tracsvn.osgeo.osuosl.org -all"
Received-SPF: Pass (mx101.skynet.be: domain of
  postmaster@lists.osgeo.org designates 140.211.15.3 as
  permitted sender) identity=helo; client-ip=140.211.15.3;
  receiver=mx101.skynet.be;
  envelope-from="tiff-bounces@lists.osgeo.org";
  x-sender="postmaster@lists.osgeo.org";
  x-conformance=sidf_compatible; x-record-type="v=spf1";
  x-record-text="v=spf1 mx a:mail.osgeo.org a:lists.osgeo.org
  a:mail.osgeo.osuosl.org a:tracsvn.osgeo.osuosl.org -all"
Authentication-Results: mx101.skynet.be; spf=None smtp.pra=tiff-bounces@lists.osgeo.org; spf=Pass smtp.mailfrom=tiff-bounces@lists.osgeo.org; spf=Pass smtp.helo=postmaster@lists.osgeo.org; dkim=hardfail (body hash did not verify [final]) header.i=@gmail.com; dkim=hardfail (body hash did not verify [final])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 +d/NcChzfIQwVpUu2fBmMZG9HEvcCjruOWXTciBwQ7rDOThimj877wH3Gjr2QjehZO26pnzW
 /ejwfi7L6iuP3T8G6j60b2z7B73OTs0cFCAsvksLl3FhzJhhyzbIpsH52u1QpFxt2H0U0nmt
 XArxArM61Img/sV1q4qxfsxAXsuQxGgxSJpGOwunftrdf0Qzg3EaN69OBkWyHU7Ectp7hHod
 Z29liEvJlaBw6oplWH2/H0UXhR5zOJiEtnuuIeiEFfXZATAYUh17A3zQd6FNMlEDjh4I4qVN
 NyBNzRjcw5TXqqK17euGdrzJiAfFQWWi2HTE8Lp9CP31Ft80xR/g83wsoQm3tFzpYhUt1/4f
 jeOKgArtBzZ/5TSap8AeMIRo+JBnfWQRTKWVjiXGjPJeU9N3jAq4H67dwOhN2XRA==
X-IronPort-Anti-Spam-Filtered: true
X-MGA-submission: =?us-ascii?q?MDFDh2ZW47nlKtQGWkP9rVzwC03K3MlSacBtzx?=
 =?us-ascii?q?NSn9Ni2yc6vn/2lo3GzRwYrzBx39/UH3TeJXWsHlD50OF+/9vgx2BTGy?=
 =?us-ascii?q?KnPIfB0yablsB7lx5stzkF/ObIpEqs5JLx7KA=3D?=
Received: from osgeo6.osgeo.osuosl.org (HELO lists.osgeo.org) ([140.211.15.3])
  by mx101.skynet.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 19:44:27 +0200
Received: from osgeo6.osgeo.osuosl.org (localhost [127.0.0.1])
	by lists.osgeo.org (Postfix) with ESMTP id AB9E661346AF;
	Tue,  4 May 2021 10:44:22 -0700 (PDT)
Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com
 [209.85.167.52])
 by lists.osgeo.org (Postfix) with ESMTPS id 3BACC614803A
 for <tiff@lists.osgeo.org>; Tue,  4 May 2021 10:44:21 -0700 (PDT)
Received: by mail-lf1-f52.google.com with SMTP id x20so14544346lfu.6
 for <tiff@lists.osgeo.org>; Tue, 04 May 2021 10:44:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=wPv9CB9bv2NhhumTUf9wMWNOmq8ToIO9nemIERP1R4M=;
 b=Uc9vg4uws2WGdLyBOOmEH5vPU/bSkSdMG12B2iu68/OGOSyWlN9aljzz/RQQvrOQCb
 9NcaCMeoWPKYx2tEmm4+tuz8h6oKYc4bULYeBGY3P7OJ+88l1zdgaUPh9UTpg1q1OIJb
 l10sQ2PshnzSioqqDTP0pVr/ildi4NHw4Q6QyyYuf4YllwCEaXHihnP/rLLvqfCRIZiv
 JqQ2NZIyl9eLRXP9j3HlbsKxLj8ZUvrgakil9s0REZ8fhYubNYnLb/axCWQ+WIW7mP1/
 h/gU4D1lxbKX1Tp9V6VrO32My+2feGL+ZGYGPOYXkg9+88VMRuOHL/dZYGDS/R7m7jJD
 nuNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=wPv9CB9bv2NhhumTUf9wMWNOmq8ToIO9nemIERP1R4M=;
 b=eS4nmU5oC6aPTXMQM3ZDG2JWYrFeaFc6rjpZw98GKgjmy4F9NjYRLVIasGt+y92Nux
 sd50SozoWPpFBAHz5pvIcguKPV/w3cPU5BKZ3riA1bXfyp/69WFFppcRGqStKpY2aVWK
 BP8Mx3n0BZEAf026QB/eU+u5s6T2H4rSQLOj1wEq6Tdb7shHYjJrIc0EMtjgmPVBNf7K
 Rryt1adWsZ058tfPvIS4ICt2rf/V3hNxPik0IqJi1vrdyU7iEWbmiIY7e22ZeW9nLrfK
 Un3MWy7FbA1FzXyczlt1M4OHYgTxm9Hz3qIvLKsTe5aRlHB/264Y3KStD8Jy/nXemoWi
 qiPg==
X-Gm-Message-State: AOAM531qUrEeg1f9Ykp4rM05OxntvxskBxwQpSn2j4+Bz33AsmeQD0E+
 fi9rvbCz+mq8cVUT3uqBHYchIiaC3OeYaeAJUNNEYaSv3Hg=
X-Google-Smtp-Source: ABdhPJySQ9kIlifyfR35BhHDsgGgdGzUMOl4N8nfKAWyhR9htpUyIjT2fJ2JKX+ltk5WBXGMa8645kadeZ1GUho1ylk=
X-Received: by 2002:a05:6512:1143:: with SMTP id
 m3mr17804157lfg.366.1620150259395; 
 Tue, 04 May 2021 10:44:19 -0700 (PDT)
MIME-Version: 1.0
References: <2021.05.04.0748.29595@afu.wta.att.ne.jp>
 <55f40245-4bd8-92a3-1cd8-03969250043c@gmail.com>
In-Reply-To: <55f40245-4bd8-92a3-1cd8-03969250043c@gmail.com>
From: Larry Bank <laurencebank@gmail.com>
Date: Tue, 4 May 2021 13:44:08 -0400
Message-ID: <CAHYwHP4xx98y4f=kx-BY2+q_m6JT6U8SdjOQfLgpYUgUVZnAjw@mail.gmail.com>
To: steveu@coppice.org
Cc: tiff@lists.osgeo.org
Subject: Re: [Tiff] SIMD optimizations
X-BeenThere: tiff@lists.osgeo.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.osgeo.org>
List-Unsubscribe: <https://lists.osgeo.org/mailman/options/tiff>,
 <mailto:tiff-request@lists.osgeo.org?subject=unsubscribe>
List-Post: <mailto:tiff@lists.osgeo.org>
List-Help: <mailto:tiff-request@lists.osgeo.org?subject=help>
List-Subscribe: <https://lists.osgeo.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.osgeo.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6924414360414154554=="
Errors-To: tiff-bounces@lists.osgeo.org
Sender: "Tiff" <tiff-bounces@lists.osgeo.org>

--===============6924414360414154554==
Content-Type: multipart/alternative; boundary="000000000000b1af6505c184a0b1"

--000000000000b1af6505c184a0b1
Content-Type: text/plain; charset="UTF-8"

Steve,
I brought up this issue years ago. The libtiff G4 encoder is needlessly
inefficient in both its encoding of the output bits and its searching the
current and reference lines for runs of bits. There isn't just a tweak to
fix it, the encoder needs to be tossed out and replaced. A faster encoder
will use a bit more memory, but at this point I don't think anyone will
mind using an additional 8 bytes per pixel width (current + reference line
runs as uint32_t). I've been recently reminded on this mailing list that my
time is better spent optimizing more important libraries like libpng. Are
there any good reasons to change my mind? I still think that libtiff G4
encoding is used widely in scanned document generation (embedded in
scanners and on PCs/mobile), so it should be improved.

Larry B.


Il giorno mar 4 mag 2021 alle ore 13:35 Steve Underwood <coppice12@gmail.com>
ha scritto:

> On 03/05/2021 23:50, Akira Urushibata wrote:
> > Bob Friesenhahn wrote:
> >
> >> A list member posted repeatedly that he had private/proprietary CCITT
> >> Group 4 fax support which was much faster than what is in libtiff.
> >> Given this, one must assume that libtiff's implementation can be
> >> faster.
> > I work on Netpbm and I have written the code for CCITT Group 3 fax
> > in the programs g3topbm and pbmtog3.
> >
> > Netpbm is one bit per pixel for bilevel black and white images.  This
> > is called PBM format.  The Group 3 fax to pbm encoder pbmtog3 works on
> > the bits directly in byte chunks (=8 pixels at a time), so in a way it
> > is like SIMD.
> >
> > For Group 4 I have the algorithm in my head, but have never had the
> > time to write down the code.  For high efficiency the knack is to
> > measure spans of white or black, determine the inflexion points (white
> > - black borders) and work on them instead of testing one pixel at a
> > time.
>
> Group 4 encoding is just Group 3 2D encoding without the regular
> insertion of 1D lines among the 2D lines (i.e the error recovery has
> been removed, because G4 uses an error free communications channel).
> I've never seen a 2D encoder that truly works bit by bit. Its
> pointlessly inefficient.
>
> A long time ago I submitted fixes for buffer overflows in libtiff's G3
> and G4 handling. I had some speedups for the buffer management, but I
> don't think I submitted those. At the time my priority was making
> libtiff robust, so it didn't crash on numerous slightly miscoded images
> (e.g. a fax received with uncorrected errors). I remember it was
> certainly possible to speed things up a bit with relatively simple tweaks.
>
> Regards,
>
> Steve
>
>
> _______________________________________________
> Tiff mailing list
> Tiff@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/tiff
>

--000000000000b1af6505c184a0b1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:small">Ste=
ve,</div><div class=3D"gmail_default" style=3D"font-size:small">I brought u=
p this issue years ago. The libtiff G4 encoder is needlessly inefficient in=
 both its encoding of the output bits and its=C2=A0searching the current an=
d reference lines for runs of bits. There isn&#39;t just a tweak to fix it,=
 the encoder needs to be tossed out and replaced. A faster encoder will use=
 a bit more memory, but at this point I don&#39;t think anyone will mind us=
ing an additional 8 bytes per pixel width (current=C2=A0+ reference line ru=
ns as uint32_t). I&#39;ve been recently reminded on this mailing list that =
my time is better spent optimizing more important libraries like libpng. Ar=
e there any good reasons to change my mind? I still think that libtiff G4 e=
ncoding is used widely in scanned document generation (embedded in scanners=
 and on PCs/mobile), so it should be improved.</div><div class=3D"gmail_def=
ault" style=3D"font-size:small"><br></div><div class=3D"gmail_default" styl=
e=3D"font-size:small">Larry B.</div><div class=3D"gmail_default" style=3D"f=
ont-size:small"><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"=
ltr" class=3D"gmail_attr">Il giorno mar 4 mag 2021 alle ore 13:35 Steve Und=
erwood &lt;<a href=3D"mailto:coppice12@gmail.com">coppice12@gmail.com</a>&g=
t; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">O=
n 03/05/2021 23:50, Akira Urushibata wrote:<br>
&gt; Bob Friesenhahn wrote:<br>
&gt;<br>
&gt;&gt; A list member posted repeatedly that he had private/proprietary CC=
ITT<br>
&gt;&gt; Group 4 fax support which was much faster than what is in libtiff.=
<br>
&gt;&gt; Given this, one must assume that libtiff&#39;s implementation can =
be<br>
&gt;&gt; faster.<br>
&gt; I work on Netpbm and I have written the code for CCITT Group 3 fax<br>
&gt; in the programs g3topbm and pbmtog3.<br>
&gt;<br>
&gt; Netpbm is one bit per pixel for bilevel black and white images.=C2=A0 =
This<br>
&gt; is called PBM format.=C2=A0 The Group 3 fax to pbm encoder pbmtog3 wor=
ks on<br>
&gt; the bits directly in byte chunks (=3D8 pixels at a time), so in a way =
it<br>
&gt; is like SIMD.<br>
&gt;<br>
&gt; For Group 4 I have the algorithm in my head, but have never had the<br=
>
&gt; time to write down the code.=C2=A0 For high efficiency the knack is to=
<br>
&gt; measure spans of white or black, determine the inflexion points (white=
<br>
&gt; - black borders) and work on them instead of testing one pixel at a<br=
>
&gt; time.<br>
<br>
Group 4 encoding is just Group 3 2D encoding without the regular <br>
insertion of 1D lines among the 2D lines (i.e the error recovery has <br>
been removed, because G4 uses an error free communications channel). <br>
I&#39;ve never seen a 2D encoder that truly works bit by bit. Its <br>
pointlessly inefficient.<br>
<br>
A long time ago I submitted fixes for buffer overflows in libtiff&#39;s G3 =
<br>
and G4 handling. I had some speedups for the buffer management, but I <br>
don&#39;t think I submitted those. At the time my priority was making <br>
libtiff robust, so it didn&#39;t crash on numerous slightly miscoded images=
 <br>
(e.g. a fax received with uncorrected errors). I remember it was <br>
certainly possible to speed things up a bit with relatively simple tweaks.<=
br>
<br>
Regards,<br>
<br>
Steve<br>
<br>
<br>
_______________________________________________<br>
Tiff mailing list<br>
<a href=3D"mailto:Tiff@lists.osgeo.org" target=3D"_blank">Tiff@lists.osgeo.=
org</a><br>
<a href=3D"https://lists.osgeo.org/mailman/listinfo/tiff" rel=3D"noreferrer=
" target=3D"_blank">https://lists.osgeo.org/mailman/listinfo/tiff</a><br>
</blockquote></div>

--000000000000b1af6505c184a0b1--

--===============6924414360414154554==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff

--===============6924414360414154554==--
