Return-Path: <tiff-bounces@remotesensing.org>
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx019.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j2U0IkQI000879
        for <joris.at.lebbeke@skynet.be>; Wed, 30 Mar 2005 02:18:47 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id F11BE193BCD0; Tue, 29 Mar 2005 19:18:21 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from hank.shelbyville.oz (ppp47-112.lns1.adl1.internode.on.net
	[150.101.47.112])
	by xserve.flids.com (Postfix) with ESMTP id 37514193BCAC
	for <tiff@remotesensing.org>; Tue, 29 Mar 2005 19:18:19 -0500 (EST)
Received: from ron by hank.shelbyville.oz with local (Exim 4.50)
	id 1DGQuI-0004OP-29
	for tiff@remotesensing.org; Wed, 30 Mar 2005 09:48:02 +0930
Date: Wed, 30 Mar 2005 09:48:02 +0930
To: tiff@remotesensing.org
Message-ID: <20050330001802.GB4298@hank.shelbyville.oz>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.8i
From: Ron <ron@debian.org>
Subject: [Tiff] RFC: fast 'copy free' tiff decoding
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 000000000023ceae.00000020
X-MSP-STORE: Wed, 30 Mar 2005 02:18:55 +0200
Status:   


Hi,

I'm a little uncertain where to start with this one, since its
certainly going to be much more intrusive than anything I've
proposed to date and I really haven't been here very long to be
suggesting major upheavals, so bear with me and feel free to
bring as big a cluebat as you need.

It occurs to me that tiff was largely designed to be trivially
implemented in hardware.  I'd like to more actively exploit that
on platforms where we can and I think we can pick up a lot of
other niceties (like generic IFD support) very easily along the
way.

The basic idea is very simple.  First map a tiff into memory,
then cast carefully constructed C structures into the right
offsets of that memory space to be able to access the data
directly.

I have a proof of concept in C++ that simply mmap's the entire
file in one go, then walks the offset chain casting structures
into place to dump the header and the tags in each IFD.
Everything is available, but nothing is actually copied (or
potentially even paged in on a modern system) until you access
the members of the structures (which correspond to the elements
in the now decomposed tiff).  No attempt is made to interpret
anything beyond the most basic structure so any tiff, baseline
or private spec, may be accessed this way.  Conformance with
those standards and any needed codecs etc. can be cleanly
layered on top.  It can also be made to degrade nicely if the
tiff cannot be mmap'ed, or if only one tile at at time can be
etc.

The question now, is where to flesh that out.  I'm not really
interested in forking a 'competitor' to libtiff (for all the
usual long term time budget reasons), but this is a pretty big
tangent to throw you people on if you are busy stabilising what
you already have.  OTOH it seems like a very solid core to build
some of the other things we want upon, we get generic tiff for
free, and simply need to layer baseline tiff and all the other
stuff on top of that.

Is anybody else here interested in following that chain of
thought?  There are plenty of other real details I can flesh
this out with for people who are.  Would it be reasonable to run
an experimental branch of the libtiff cvs to shake some of these
ideas out?  I could whip up something more C friendly along
these lines to kick start that off if there was sufficient
interest.

best,
Ron


_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
