Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
258 views

Unit 9 - Data and File Format Standards PDF

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
258 views

Unit 9 - Data and File Format Standards PDF

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Data and File Format Standards

Data and file format standardisation is standards as well as proprietary, are in use.
crucial We will examine a few very popular and
 for sharing data among multiple applica- typical formats:

COMP3600 Multimedia Systems tions, and  Rich-text format (RTF)


 for exchanging information between ap-  Tagged image file format (TIFF)
Data and File Format Standards plications.
 Resources image file format (RIFF)
Wai Wong However, standards are rarely final; they
must evolve on an ongoing basis to address
 Musical instrument digital interface
(MIDI)
new demands and new technology.
A large number of different formats,  Graphics interchange format (GIF)

COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 1 (199811) Slide 2

Rich-Text Format positions, left, right, and first indents Character formatting — Formatting informa-
Simple ASCII text is a limited form of document. These fonts are then mapped relative to document margins, and the tion, including bold, italic, underline (con-
data exchange because when text is moved to the fonts available in the receiving spacing between paragraphs. Paragraph tinuous, dotted, or word), strikethrough,
from one application to another, all formatting application for displaying the text. formatting information also includes style shadow text, outline text, and hidden text,
information is lost. sheets. are specified using control characters.
Colour table — lists the colours used in the
However, this remains one of the most General formatting — Formatting informa-
document for highlighting text (i.e., the
popular and convenient form of data ex- tion in this group includes items such as Special characters — Special characters in-
characters are a specific colour, not
change. footnotes, annotation, bookmarks, and clude hyphens non-breaking space back-
black).
Rich-text format (RTF) expands the range pictures. slashes, and so on.
of information that can be pass between Document formatting — information of the
applications. format applying to the entire document,
This assumes that both the source such as document margins, and so on.
application and destination application have
a reasonable common set of features. Section formatting — Section breaks (and
The key information carried in RTF files page breaks) are used to define separa-
are: tion of groups of paragraphs. The for-
matting information specifies the space
Character sets — determine the characters above and below the section.
that are ported in a particular implemen-
tation. Paragraph formatting — The RTF specifi-
cation defines control characters for
Font table — lists all fonts used in the specifying paragraph justification, tab
COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 3 (199811) Slide 4
TIFF File Format What is big-endian and little-endian?
TIFF file format was originally developed  it contains one or more image file
In different processor systems, the orders of data bytes stored in memory are different.
by Aldus Corp. in the Eighties. Currently dictionaries (IFD)
This is known as byte order. Two byte orders are used most often:
widely used TIFF specification is version 6.0
released in 1992. It is on of the most widely  it contains a number of blocks of image
used digital image file format. It is very data. The number of image data block is Big-endian Little-endian
portable. no maore than the number of IFD.
The most significant byte of a multi-byte The least significant byte of a multi-byte
TIFF file format can support: object is stored in the memory location of object is stored in the memory location of
 colour depth from 1-bit to 24-bit IFH lowest address. For example, a 32-bit word lowest address. For example, a 32-bit word
 more than one image in a file 0x12345678 will be stored as: 0x12345678 will be stored as:

 many different compression methods,


Addr. Value Addr. Value
IFD
1000 12 the most significant byte 1000 78 the least significant byte
including uncompressed, RLE, LZW, 1001 34 1001 56
CCITT Group 3 and Group 4, JPEG 1002 56 1002 34
 large image size (up to 232 , 1 bytes) 1003 78 the least significant byte 1003 12 the least significant byte
 support different platforms, including This byte order is used in Motolora processor This byte order is used in Intel processor
DOS, Macintosh, UNIX systems. systems.
The basic organisation of a TIFF file is as Image
data
follows:
 it begins with an image file header (IFH)
COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 5 (199811) Slide 6

TIFF File Format (Cont.) TIFF File Tags


 IFH has a fixed size of 8 bytes  The size of IFD is variable. Each IFD Each tag in a TIFF IFD is 12 bytes long. It The possible data types include the
contains a number of tags. The size of contains four elements: followings:
– the first word (two bytes) indicates the
each tag is fixed, and it is 12 bytes long.
type order used in the file (0x4D4D tag ID (word) — this identifies the tag Type Code Description
for big-endian and 0x4949 for little- – the first word of an IFD indicates the BYTE 1 8-bit, unsigned byte

endian) number of tags in this IFD data type (word) — this tells what type of ASCII 2 8-bit, NULL-terminated string

– the second word indicates the TIFF – this is followed by the tags data this tag contains SHORT 3 16-bit, unsigned number

version which is always 0x002A LONG 4 32-bit, unsigned number


– the last double word is a pointer to the length (double word) — the number of data RATIONAL 5 two 32-bit unsigned numbers
– the last two words is a 32-bit pointer next IFD. The pointer in the last IFD is this tag contains
pointing to the first IFD NULL TIFF format has a large number of tags
value / value pointer (double word) — it con- defined. Some of them are required while
Number of tags

tag 0 tag ID tains the data value if the size of the data others are optional. The required tags for
data type
is less than or equal to 4 bytes, otherwise bi-level, gray scale, palette-colour and RGB
tag 1
length it is a point to the data block colour images are listed on the next page.
value
...
tag ID

data type
tag n-2
length
tag n-1 pointer to value
data value
pointer to next IFD

COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 7 (199811) Slide 8
The Required TIFF File Tags The TIFF Image Data
Bi-level and Gray Scale YCbCr colour  Image data in a TIFF file can be in any RowsPerStrip
Strip 1
Tag ID Tag Name Data location SHORT

 Image data are divided into strips


1
Dec. Hex. Type These images require all tags listed above
254 00FE NewSubFileType LONG 10
plus the followings:
256 0100
257 0101
ImageWidth
ImageLength
SHORT/LONG
SHORT/LONG  Each strip contains one or more contigu- StripOffsets
LONG Strip 10
258 0102 BitPerSample SHORT Tag ID Tag Name Data
Dec. Hex. Type
ous rows of bitmapped data 10
259 0103 Compression SHORT
262 0106
273 0111
PhotometricInterpretation
StripOffsets
SHORT
SHORT/LONG
529 0217
530 0218
YCbCrCoefficients
YCbCrSubSampling
RATIONAL
SHORT
 Three TIFF tags are used to identify the StripByteCounts
277 0115 SamplePerPixel SHORT 531 0219 YCbCrPositioning SHORT image data; LONG
278 0116 RowsPerStrip SHORT/LONG 532 021A ReferencelackWhite LONG 10 35
279 0117 StripByteCounts SHORT/LONG RowsPerStrip — indicates the number of 42 ...
282 011A XResolution RATIONAL 76
283 011B YResolution RATIONAL
rows of compressed, bitmapped data
296 0128 ResolutionUnit SHORT in each strip
Fax Class StripOffsets — pointers to every strip Strip 2

StripByteCounts — an array of values


Palette-colour and RGB colour These images require all tags listed in the bi- that indicates the size of each strip in
These images require all tags listed above level images plus the followings: bytes.
plus the followings: Tag ID Tag Name Data Note: The last strip may not have the same
Tag ID Tag Name Data Dec. Hex. Type
Dec. Hex. Type 326 0146 BadFaxLine SHORT/LONG number of rows as the others. All strips The advantages of this organisation are to
284 011C PlanarConfiguration SHORT 327 0147 CleanFaxData SHORT must use the same compression method and allow smaller systems to read only part of the
320 0140 ColorMap SHORT 328 0148 ConsecutiveBadFaxLine SHORT/LONG
configurations. images, and to allow random access.

COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 9 (199811) Slide 10

Resource Interchange File Format (RIFF) Organisation of RIFF Chunks


 RIFF files can contain different multime- RIFF chunk — defines the contents of the
dia elements in a single file RIFF file ID ID

 RIFF files contain different kinds of data


SIZE SIZE
List chunk — allows embedding additional form type form type
may appear as different types of files information ID ID

because they use different file name SIZE


RIFF
SIZE
Subchunk — allows adding more information Subchunk list type
extensions, e.g., data
chunk
List RIFF
to a primary chunk data ID
chunk chunk
.WAV Waveform audio file SIZE data
.AVI Audio video interleaved file All chunks begin with a 8-byte header: the ID Subchunk
data
.RMI MIDI file first four bytes are the chunk ID which is a SIZE Subchunk

.RDI Device independent bitmap file four character string identifying the type of data
ID
.PAL Palette file the chunk, and the next four bytes indicate SIZE
Subchunk
the size of the data in the chunk in little-
 RIFF provides a standard way to endian format.
data

organise data in a file The data of the chunk follow the header ID
SIZE Subchunk
Data in a RIFF file is divided into chunks. immediately. The first four bytes of the data
data
The RIFF specification defines three kinds of is known as the form type which identifies the
chunks: type of data, e.g., WAVE, AVI , and so on.

COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 11 (199811) Slide 12
RIFF Waveform Audio File Format RIFF MIDI File Format
 The form type of the RIFF chunk is WAVE  The new RIFF WAVE format has the  The form type of the RIFF chunk is RMID 2 — one or more sequentially indepen-
 It has two mandatory subchunks and a following extra subchunks:
 It has a single data subchunk which is the dent tracks
list chunk fact — this is a required subchunk in the MIDI data following the standard MIDI file  The remaining chunk(s) is(are) track
 The two subchunks are: new format. It contains file dependent format chunck(s)

fmt — the format subchunk specifying


information.
Standard MIDI files
 Each track chunk contains a sequence of
the format of the waveform data, such cue — this subchunk identifies a series events.
as the sampling rate, resolution and of positions in the wave form data  Data in a standard MIDI file are also  Each event is preceded by a delta time
number of channels stream (the cue points) divided into chunks which is the elapse time between the
playlist — this subchunk specifies a play
data — the data subchunk contains the
order for a series of cur points  The first chunk is the header chunk
current event and the previous event
actual samples
which contains information about the  There are two kinds of events:
 The list subchunk contains information associated data — this subchunk pro- entire file: the type of the file, number of
about the file, such as the date of vides a means of attaching informa- MIDI events — are for playing the notes
tracks and the timing. There are three
creation, the creator, copyright, and so tion, such as labels, to sections of the and controlling the MIDI channels
types of MIDI files:
on. waveform data stream System events — apply to the complete
0 — single multi-channel track system. They include events such
1 — one or more simultaneous track of a as setting the timing parameters,
sequence configuring the sequencer, and so on

COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 13 (199811) Slide 14

Graphics Interchange Format (GIF) GIF File Data Blocks


 The current version is GIF89a which was GIF file organisation  header — (mandatory) specifies the top-left position of the block relative
introduced in July 1989. global information to the screen, the width and height of
Signature
 It is one of the most popular image file Version Header Mandatory Signature — it is always the three the block, and whether there is a local
colour table.
format. Logical screen descriptor character GIF
Local colour table may be present to
 Images in GIF file use indexed colour Global colour table Optional
Version — it is either 87a or 89a
define colour used in this image
with maximum depth of 8-bit. Logical Screen descriptor — contains in-
Extension block Optional
formation about the width and height block.
 The maximum resolution is 65536  65536 Local image descriptor
of the screen, the global colour table, Image data are the pixel values. The
pixels. Local colout table
Image 1 Optional the background colour index and the data is compressed using the LZW
 More than one image can be store in a Image data
pixel aspect ratio. encoding method. They are stored
single file. Local image descriptor
 Global colour table — (optional) it is a as a series of sub-blocks. Each sub-
 It is a little-endian format. Local colout table Image 2 Optional series of three-byte triples making up the block begins with a count byte. The
image data is always stored by scan
 It is a stream-based format,
Image data
entries in the colour table. The number
i.e., it line and by pixel. The scan line
Extension block Optional of entries is always a power of 2, i.e., 2,
consists of a series of data packets, can be stored in consecutive order
Trailer Mandatory 4, 8, . . . , up to a maximum of 256.
known as blocks, along with additional or interlaced. GIF uses a four-pass
protocol information.  Image data — (optional) Each image interlacing scheme.
block can be divided into three parts:
Local image descriptor contains informa-  trailer
— (mandatory) is a single byte
tion about this image block, such the whose value it always 0x3B.
COMP3600 Multimedia Systems 9. File Formats COMP3600 Multimedia Systems 9. File Formats
(199811) Slide 15 (199811) Slide 16

You might also like