Media File Formats Jon Ivins, DMU
Text Files n Two types n 1. Plain text (unformatted) u ASCII Character set is most common u 7 bits are used u This can represent 128 Code words F A = F a=
Parity / Extended Character Sets n Computers store data in bytes n The extra bit can be used for: u Error detection F A parity bit is used F (Odd Parity) u Extend codewords to 256 F IBM’s EBCDIC
Text Files n 2. Formatted Text u Used by Word Processors / DTP F Characters used to give text and formatting information F Bold, Italic, Position, etc F Also contains information on page numbers, version, index, etc u Formatted files are usually much larger than their plain text equivalent
Graphics Files n Consist of objects n Contain data on size, position, colour n These are called VECTOR graphics n Use INTER-ALIASING to smooth lines
Image Files n Consist of PIXELS n A pixel is a small area of the screen n VGA displays are 640 X 480 u 480 lines of 640 pixels u This is pixels n Pixels contain data on colour n Greyscale uses one byte u Black = 0, White = 255
n Colour uses 3 Bytes n 1 for Red, 1 for Green and 1 for Blue (RGB) n 24 bits gives 16 million RGB combinations BUT n most monitors are usually at 256 colours
Bit Mapped Files n Graphics use a mathematical relationship to describe their position & size n A line might be described by its end points 0,0, 10,10 n Double the size the co-ordinates are simply doubled 0,0, 20,20 n Graphic objects are scaleable n Normally, graphics objects are saved as BMP files which are not scaleable
GIF Files n Image files hold a lot of data u Image files tend to be large files n To reduce storage space COMPRESSION techniques are used n One solution is RUN LENGTH ENCODING u Count the number of pixels that are the same u Decoder uses this count to copy the original pixel X times
GIF Files u Developed by Compuserve u Used for single or multiple images u Based on LZW compression F Lempel, Ziv invented original algorithm F Welch developed it further u Replaces multiple strings of data with a TOKEN…….. And a count value u LZW can give reasonable compression 50%
GIF Files n Decompression is fairly quick n Universal standard n Not optimised for image compression n UNISYS hold patent on LZW so there may be a problem with royalties
JPEG Files n Joint Photographic Experts Group n Uses a Fourier Transform technique to eliminate high frequency components in image n Uses several algorithms including run-length encoding n Can be lossy u blockiness u posterisation u ringing
Video Files n AVI ( Audio Visual Interleave) u Supported on all versions of Windows from 1995 F Almost all PC users can watch AVI files F MAC users probably won’t be able to watch AVI files u Large file size ( 20 Mbytes per second)
MPEG n Motion Pictures Expert Group n Popular format u Good compression u Still large files n Uses similar compression techniques to JPEG
Other Video Formats n MOV u Mac format F can be difficult to play on PCs n Real Audio & Shockwave u “Streaming” files F Optimised for the Internet
Sound Files n Two main types n WAV files u Digital samples of analogue waveforms n Midi Files u Set of instructions to control computer
WAV Files n Sound is sampled according to Nyquist Sampling Theorem n SAMPLE RATE = 2 X Highest frequency n Telephone bandwidth is Hz u Sampling rate is 6800 times a second n Audio is , 000 Hz u Sampling rate is 40,000Hz
n We also need control information so sampling rate is always higher than the Nyquist limit n telephone speech is 8kHZ n CD Audio is approx.. 44kHZ n The better the frequencies the higher the sampling rate so the higher the quality
The sound is sampled at regular intervals
Conversion to digital n There are 21 signal levels u -10 to 0 to +10 n We need 5 bits to represent this range n Note 5 bits gives 32 combinations u Use 0XXXX for Positive values u Use 1XXXX for negative values
3volts is represented by volts is represented by volts is represented by volts is represented by volts is represented by volts is represented by volts is represented by n Each sample is transmitted to an output device sequentially
Quantisation noise n The example uses a 1 volt step range n What if the audio sample is 7.5 volts? n The encoder gives a value of 8 volts n The decoder outputs an 8 volt signal n This error is called QUANTISATION NOISE
Companding n Most audio signals are quiet u more signals at lower levels than high levels n Companding means using a non-linear scale u For example, 0-5 volts might have 20 values u 5- 8 volts might have 8 values u 8-10 volts might have 2 values n This gives better resolution at lower levels at the expense of high signal levels
CD Quality WAV files n Use 16 X 2 bits to represent the audio signal n This gives X 2 “steps” u Quantisation noise is low u A lot of bits will carry no information (low sound levels) u This means a lot of data redundancy u WAV file size becomes large u 1Mbyte = 0.7 seconds of sound
MIDI Files n These are digital sound files n Control computers, sequencers, etc n Each bit in the signal is used n Must have a MIDI player to hear the sound n File size is very small compared to WAV files
Audio Compression n ADPCM u Predicts next sample value n TrueSpeech u Based on mathematical model of airflow over vocal tract u Highly efficient (1/16th) n MPEG Audio u Fits with MPEG Video files
Zip Files n Popular file compression utility u Based on LZW n Used to transfer or store large files n Zipped files give good results for text and WAV files n Poor results for graphics / video (typically 3%)
File Size / Performance n There is a trade-off between: Speed of loading File size Quality n There is no one correct solution for all multimedia applications