[Ffmpeg-devel] [PATCH] TIFF encoder (Google SoC qualification task)
Justin Ruggles
justinruggles
Fri Mar 23 05:24:13 CET 2007
Michael Niedermayer wrote:
> Hi
>
> On Thu, Mar 22, 2007 at 12:01:46PM +0000, Kamil Nowosad wrote:
>
>>Writing a TIFF encoder is one of your SoC qualification tasks, and I am
>>now submitting what i have yet done.
>>
>>Apart from libavcodec, I have also updated the libavformat, so that it
>>is possible to include many images in one TIFF file.
>
>
>>Each image is divided into strips [of size ~8kB] and then compressed
>>using zlib or [when configured without zlib] packbits compression.
>
>
> the compression algorithm could be selected by using AVCodecContext.coder_type
> also why is the image split into strips? is this needed for tiff spec
> compliance or is there some other reason? iam asking simply because it would
> be simpler to have just 1 strip ...
The spec only recommends 8k strips...it doesn't require them. Most TIFF
files out there which use deflate actually only use 1 strip since it
compresses better.
> also it would be insterresting to encode an image with several different
> variants (especially the TIFF_PREDICTOR stuff) and choose the smallest
> one allthough this is optional and would have to be in a seperate patch
that would be cool. deflate+predictor would probably win out most often
anyway though. adding lzw encoding might give it a run for its money
though.
>>My TiffEncoderContext is small. I don't really need [yet] more than this
>>one field [file_offset]. Is it ok, or should I extend the structure?
>
>
> please elaborate on what file_offset does, its certainly an odd name for a
> variable in an encoder considering that an encoder has nothing to do with
> files
The TIFF format really looks more to me like a simple file system like
ISO9660 than a normal image format. :) The file is split into
"directories" which are located by their byte offset from the start of
the "file" (wherever the TIFF image starts). Also, tag and image data
locations are specified as absolute offsets.
-Justin
More information about the ffmpeg-devel
mailing list