Interchange File Format
Encyclopedia
Interchange File Format (IFF), is a generic container file format originally introduced by the Electronic Arts
Electronic Arts
Electronic Arts, Inc. is a major American developer, marketer, publisher and distributor of video games. Founded and incorporated on May 28, 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers...

 company in 1985 (in cooperation with Commodore
Commodore International
Commodore is the commonly used name for Commodore Business Machines , the U.S.-based home computer manufacturer and electronics manufacturer headquartered in West Chester, Pennsylvania, which also housed Commodore's corporate parent company, Commodore International Limited...

-Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

) in order to ease transfer of data between software produced by different companies.

IFF files do not have any common extension. Most files with .iff extension are in fact ILBM
ILBM
ILBM is a subtype of the Interchange File Format used for storing picture data. ILBM stands for InterLeaved BitMap which refers to the way the pictures are stored. The image data is stored as a varying number of bitplanes, each storing one bit of data for each pixel in the image...

 files, wrongly named so because they are the most common IFF files and most assume that they are the only type of IFF files (on many systems that generate IFF files, file extensions are not important).

Structure

An IFF file is built up from chunk
Chunk (information)
A chunk is a fragment of information which is used in many multimedia formats, such as PNG, MP3 and AVI.Each chunk contains a header which indicates some parameters A chunk is a fragment of information which is used in many multimedia formats, such as PNG, MP3 and AVI.Each chunk contains a header...

s. Each chunk begins with what the spec calls a "Type ID" (what the Macintosh called an OSType
OSType
OSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...

 and Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 developers might call a FourCC
FourCC
A FourCC is a sequence of four bytes used to uniquely identify data formats.The concept originated in the OSType scheme used in the Macintosh system software and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives...

). This is followed by a 32-bit unsigned integer
Integer
The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...

 (all integers in IFF files' structure are big-endian) specifying the size of the following data (the chunk content) in bytes. Because the spec includes explicit lengths for each chunk, it is possible for a parser to skip over chunks which it either can't or doesn't care to process.

This structure is closely related to the type-length-value
Type-length-value
Within data communication protocols, optional information may be encoded as a type-length-value or TLV element inside of the protocol. TLV is also known as tag-length value....

 (TLV) representation.

There are predefined group chunks, with type IDs ‘FORM’, ‘LIST’ and ‘CAT ’. A FORM chunk is like a record structure, containing a type ID (indicating the record type) followed by nested chunks specifying the record fields. A LIST is a factoring structure containing a series of ‘PROP’ (property) chunks plus nested group chunks to which those properties apply. A CAT  is just a collection of nested chunks with no special semantics. Group chunks can contain other group chunks, depending on the needs of the application. Group chunks, like their simpler counterparts, contain a length element. Skipping over a group can thus be done with a simple Unix-style relative seek operation.

Chunks must begin on even file offsets, as befits the origins of IFF on the Motorola 68000 processor, which couldn't address quantities larger than a byte on odd addresses. Thus a chunk following an odd-length chunk will be preceded by a pad byte.

The top-level structure of an IFF file consists of exactly one of the group chunks: FORM, LIST or CAT , where FORM is by far the most common one.

Each type of chunk typically has different internal structure, that could be numerical data, text, or raw data. It is also possible to include other IFF files as if they are chunks (note that they have the same structure: four letters followed with length) and some formats use this. There are standard chunks that could be present in any IFF file, such as ‘AUTH’ (containing text with information about author of the file), ‘ANNO’ (containing text with annotation, usually name of the program that created the file), ‘NAME’ (containing text with name of the work in the file), ‘VERS’ (containing file version), ‘(c) ’ (containing text with copyright information). There are also chunks that are common among a number of formats, such as ‘CMAP’ which holds color palette in ILBM
ILBM
ILBM is a subtype of the Interchange File Format used for storing picture data. ILBM stands for InterLeaved BitMap which refers to the way the pictures are stored. The image data is stored as a varying number of bitplanes, each storing one bit of data for each pixel in the image...

, ANIM
ANIM
ANIM is a file format, used to store digital movies and computer generated animations , and is a variation of the ILBM format, which is a subformat of Interchange File Format.-Anim FileTypes:...

 and DR2D files (pictures, animations and vector pictures). There are chunks that have common name but hold different data such as ‘BODY’ which could store image in an ILBM
ILBM
ILBM is a subtype of the Interchange File Format used for storing picture data. ILBM stands for InterLeaved BitMap which refers to the way the pictures are stored. The image data is stored as a varying number of bitplanes, each storing one bit of data for each pixel in the image...

 file and sound in an 8SVX
8SVX
8SVX is a subformat of the Interchange File Format. The subformat is for 8-bit sampled sounds, supports both mono and stereo streams as well as loops; commonly used as a basic audio sample format on Amiga computers for many years...

 file. And finally, there are chunks unique to their file type. Some programs that create IFF files add to them chunks with their internal data; these same files can later be read by other programs without any disruption (because their parsers could skip uninteresting chunks) which is a great advantage of IFF and similar formats.

As a nestable, descriptive file format, there are architectural similarities to XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

. XML, however, is primarily a text format, whereas all IFF contains at least some binary data (the length fields). It is possible to mechanically convert IFF to an XML equivalent; however, XML has additional features such as descriptive data and metadata (attributes, entities, DTD
Document Type Definition
Document Type Definition is a set of markup declarations that define a document type for SGML-family markup languages...

's and schemas
XML schema
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself...

) and navigational features (XPath
XPath
XPath is a language for selecting nodes from an XML document. In addition, XPath may be used to compute values from the content of an XML document...

) which cannot be trivially mapped back to IFF.

SMUS

Simple MUsical Score or Sonix Music Driver, an IFF file format similar to the MIDI format. Apart from Aegis
Aegis
An aegis is a large collar or cape worn in ancient times to display the protection provided by a high religious authority or the holder of a protective shield signifying the same, such as a bag-like garment that contained a shield. Sometimes the garment and the shield are merged, with a small...

 Sonix and Electronic Arts
Electronic Arts
Electronic Arts, Inc. is a major American developer, marketer, publisher and distributor of video games. Founded and incorporated on May 28, 1982 by Trip Hawkins, the company was a pioneer of the early home computer games industry and was notable for promoting the designers and programmers...

' Deluxe Music Construction Set
Deluxe Music Construction Set
Deluxe Music Construction Set is a 1986 music composition, notation and playback program for the Amiga and Apple Macintosh home computers.-Summary:...

 almost no software uses this format. http://archive.cs.uu.nl/pub/MIDI/DOC/smus.formathttp://www.exotica.org.uk/wiki/Sonix_Music_Driver

See also

  • Type-length-value
    Type-length-value
    Within data communication protocols, optional information may be encoded as a type-length-value or TLV element inside of the protocol. TLV is also known as tag-length value....

     (TLV) representation.
  • Resource Interchange File Format (a little-endian variation of IFF)
  • Audio Interchange File Format
  • Interleaved Bitmap
    ILBM
    ILBM is a subtype of the Interchange File Format used for storing picture data. ILBM stands for InterLeaved BitMap which refers to the way the pictures are stored. The image data is stored as a varying number of bitplanes, each storing one bit of data for each pixel in the image...

  • FourCC
    FourCC
    A FourCC is a sequence of four bytes used to uniquely identify data formats.The concept originated in the OSType scheme used in the Macintosh system software and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives...

  • Magic number
  • Quetzal file format
    Quetzal file format
    Quetzal is a standardised file format for the saved state of Z-machine games, invented by Martin Frost. Prior to the introduction of Quetzal, each Z-machine interpreter saved games in its own format; Quetzal enabled players to begin a game on one architecture and end it on another...

  • OSType
    OSType
    OSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK