home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
gfx
/
viewtek-2.1.378.lha
/
Viewtek
/
Anim7.doc
next >
Wrap
Text File
|
1992-12-06
|
29KB
|
602 lines
A N I M
An IFF Format For CEL Animations
Revision date: 4 May 1988
prepared by:
SPARTA Inc.
23041 de la Carlota
Laguna Hills, Calif 92653
(714) 768-8161
contact: Gary Bonham
also by:
Aegis Development Co.
2115 Pico Blvd.
Santa Monica, Calif 90405
213) 392-9972
Anim7 Appendix (july 92) by:
Wolfgang Hofer
A-2722 Winzendorf
Wr. Neustaedterstr. 140
1.0 Introduction
The ANIM IFF format was developed at Sparta originally for the
production of animated video sequences on the Amiga computer. The
intent was to be able to store, and play back, sequences of frames
and to minimize both the storage space on disk (through compression)
and playback time (through efficient de-compression algorithms).
It was desired to maintain maximum compatibility with existing
IFF formats and to be able to display the initial frame as a normal
still IFF picture.
Several compression schemes have been introduced in the ANIM format.
Most of these are strictly of historical interest as the only one
currently being placed in new code is the vertical run length
encoded byte encoding developed by Jim Kent.
1.1 ANIM Format Overview
The general philosophy of ANIMs is to present the initial frame
as a normal, run-length-encoded, IFF picture. Subsequent
frames are then described by listing only their differences
from a previous frame. Normally, the "previous" frame is two
frames back as that is the frame remaining in the hidden
screen buffer when double-buffering is used. To better
understand this, suppose one has two screens, called A and B,
and the ability to instantly switch the display from one to
the other. The normal playback mode is to load the initial
frame into A and duplicate it into B. Then frame A is displayed
on the screen. Then the differences for frame 2 are used to
alter screen B and it is displayed. Then the differences for
frame 3 are used to alter screen A and it is displayed, and so
on. Note that frame 2 is stored as differences from frame 1,
but all other frames are stored as differences from two frames
back.
ANIM is an IFF FORM and its basic format is as follows (this
assumes the reader has a basic understanding of IFF format
files):
FORM ANIM
. FORM ILBM first frame
. . BMHD normal type IFF data
. . ANHD optional animation header
chunk for timing of 1st frame.
. . CMAP
. . BODY
. FORM ILBM frame 2
. . ANHD animation header chunk
. . DLTA delta mode data
. FORM ILBM frame 3
. . ANHD
. . DLTA
...
The initial FORM ILBM can contain all the normal ILBM chunks,
such as CRNG, etc. The BODY will normally be a standard
run-length-encoded data chunk (but may be any other legal
compression mode as indicated by the BMHD). If desired, an ANHD
chunk can appear here to provide timing data for the first
frame. If it is here, the operation field should be =0.
The subsequent FORMs ILBM contain an ANHD, instead of a BMHD,
which duplicates some of BMHD and has additional parameters
pertaining to the animation frame. The DLTA chunk contains
the data for the delta compression modes. If
the older XOR compression mode is used, then a BODY chunk
will be here. In addition, other chunks may be placed in each
of these as deemed necessary (and as code is placed in player
programs to utilize them). A good example would be CMAP chunks
to alter the color palette. A basic assumption in ANIMs is
that the size of the bitmap, and the display mode (e.g. HAM)
will not change through the animation. Take care when playing
an ANIM that if a CMAP occurs with a frame, then the change must
be applied to both buffers.
Note that the DLTA chunks are not interleaved bitmap representations,
thus the use of the ILBM form is inappropriate for these frames.
However, this inconsistency was not noted until there were a number
of commercial products either released or close to release which
generated/played this format. Therefore, this is probably an
inconsistency which will have to stay with us.
1.2 Recording ANIMs
To record an ANIM will require three bitmaps - one for
creation of the next frame, and two more for a "history" of the
previous two frames for performing the compression calculations
(e.g. the delta mode calculations).
There are five frame-to-frame compression methods currently
defined. The first three are mainly for historical interest.
The product Aegis VideoScape 3D utilizes the third method in
version 1.0, but switched to method 5 on 2.0. This is
the only instance known of a commercial product generating
ANIMs of any of the first three methods. The fourth method
is a general short or long word compression scheme which has
several options including whether the compression is horizontal
or vertical, and whether or not it is XOR format. This offers
a choice to the user for the optimization of file size and/or
playback speed. The fifth method is the byte vertical run length
encoding as designed by Jim Kent. Do not confuse
this with Jim's RIFF file format which is different than ANIM.
Here we utilized his compression/decompression routines within the
ANIM file structure.
The following paragraphs give a general outline of each of the
methods of compression currently included in this spec.
1.2.1 XOR mode
This mode is the original and is included here for historical
interest. In general, the delta modes are far superior.
The creation of XOR mode is quite simple. One simply
performs an exclusive-or (XOR) between all corresponding
bytes of the new frame and two frames back. This results
in a new bitmap with 0 bits wherever the two frames were
identical, and 1 bits where they are different. Then this
new bitmap is saved using run-length-encoding. A major
obstacle of this mode is in the time consumed in performing
the XOR upon reconstructing the image.
1.2.2 Long Delta mode
This mode stores the actual new frame long-words which are
different, along with the offset in the bitmap. The
exact format is shown and discussed in section 2 below.
Each plane is handled separately, with no data being saved
if no changes take place in a given plane. Strings of
2 or more long-words in a row which change can be run
together so offsets do not have to be saved for each one.
Constructing this data chunk usually consists of having
a buffer to hold the data, and calculating the data as
one compares the new frame, long-word by long-word, with
two frames back.
1.2.3 Short Delta mode
This mode is identical to the Long Delta mode except that
short-words are saved instead of long-words. In most
instances, this mode results in a smaller DLTA chunk.
The Long Delta mode is mainly of interest in improving
the playback speed when used on a 32-bit 68020 Turbo Amiga.
1.2.4 General Delta mode
The above two delta compre