YUVPAK

From AtariForumWiki
Jump to navigation Jump to search
January 31, 1993  (Go Cowboys!!!)
YUVPAK is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

                              YUVPAK 2.0
                                 for
                       Fractal Image Compression
                         (Color Targa Version)

                       *****  WHATS NEW? *****

1.  Images are stored in 40 bits per transform... but still only 34 bits
are significant.  If anybody wants to help with that... let me know.

2.  All .ifs files begin with a 12 byte header.  It contains info that I
wanted... but didn't want to write down.  Such as compression time, rms
tolerance, and plenty of room for growth.

3.  The go32 environment variable still has to be set for every program included.

4.  Compression ranges between 10 and 45 to 1.

                       ***** Introduction *****

I posted this program to let some of the folks on the net know
what's going on in the area of FRACTAL IMAGE COMPRESSION.
For references:
        ftp the file /pub/inls-ucsd/fractal-2.0.tar at lyapunov.ucsd.edu
This is Yuval Fisher's paper... not mine.  It is in POSTSCRIPT.
If you don't have ftp access, I will be uploading this document in a short
time to local bbses.

The compression is a 2-level quadtree compression.  If you read the paper
I use ranges of 8x8 and 4x4.  If you don't read the paper... then you won't
know what I'm talking about, but it's not really important.

I really need to get more images to compress.  If you would like something
compressed... get it to 256x256 and 24 bit color and in .TGA or .TIF format.
Sharp images with good contrast are preferred... grain kills!
If I think the image is worthy of my time... (it probably will be)
I'll be glad to post a copy somewhere. 

                     ***** DISTRIBUTION STUFF *****

The program YUVUNPAK.EXE performs a decompression of images
compressed using YUVPAK.EXE. (now included in this distribution)

YUVUNPAK was written in 'C', and compiled using GCC 1.09 for MSDOS systems.
The source is included, along with some sample compressed images.
(I'm a mathematician, not a 'C' programmer... I just dabble in 'C',
no hate mail, please)

The files YUVUNPAK.EXE and YUVPAK.EXE are stubbized (gcc talk).  GO32.EXE
must be in the path.

                  ***** GETTING YUVUNPAK.EXE TO RUN *****

YUVUNPAK.EXE and YUVPAK.EXE will run only on a 386 or higher.
A math coprocessor is really required.

I recommend at least 1 meg of memory, but it will be _slow_.
It is very fast as long as is doesn't have to page to disk.

Drivers for supported video cards are included.
You'll have to decide by the driver filename whether there is
one for your card.  These come straight from GCC 1.09 distribution.

You need to set the following environment variables:
        set 387=yes
        set GO32=driver "your .grd driver here, no quotes" gw 640 gh 480

The program is written to display at 640x480 with 256 shades of gray.
(of course we know vga cards only display 6 bits worth)
The 640x480 will allow you to see all of the data mentioned below.
If all you can get is 320x200x256... it will run but you'll be missing
alot.

syntax is:
        YUVUNPAK foo.ifs foo.tga

To decompress 'peppers.ifs':
        YUVUNPAK peppers.ifs peppersc.tga  (don't use a name that is already
                                            taken.)

The peppers should appear... if not, check the parameters and make sure
your GO32 variable is set to the right card.

After that the file peppersc.tga will be viewable.  You will probably
have to dither it down to 256 colors to view it.  I recommend PICLAB's
makepal option.

If you wish to compress your own files, they need to be 256x256 with
24 bits of color.  Only .TGA is supported currently.  Syntax is
        YUVPAK rms infile.tga outfile.ifs  (the extensions are required)

        rms is a numerical value set by you.  It will affect the quality
        and compression time.  A higher value will decrease quality
        and compression time.  I usually use a value of 4.

There is very little error checking, so be careful and don't walk on any
saved images.

                   ***** INFORMATION ON IMAGES *****

The images are _not_ stored optimally.  I'm still working on the actual
compression routines, so I'm not concerned with writing the files out
optimally just yet.  My thesis doesn't have to be finished until
June 1993, so don't expect anything soon.

Each transformation uses 40 bits of storage, but only 34 bits
are significant.  (I _think_ it will come down to 32 bits per
transformation with no loss of quality)
The number of transformations displayed at decompression time.
There is also a 12 byte header.  The header info is for my benefit.
It does not have anything to do with the actual decompression.

Thanks to DJ Delorie who made this work possible by porting
GCC to MSDOS.  Send him money:
                                 DJ Delorie
                                 24 Kirsten Ave
                                 Rochester NH  03867-2954

YUVPAK 2.0 is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I can be contacted at wdy@tenet.edu.


Copyright (C) 1993 WD Young


Back to Packer/Depacker