Title: Compression
1Compression
2Compression Why?
- Size of files
- Image
- width x height x number of colours
- 1024 x 768x 16M colours 2.25MB
- Sound
- Duration x SampleFreq x SampleSize x stereo
- 5 x 60 x 44100 x 16bit x 2 50MB
- Video
- Duration x ImageSize x fps
- 5 x 60 x 1024 x 768 x 16M colours x24fps 15.8GB
3Compression considerations
- File size can be reduced before compression by
- Image reduce width, height, number of colours
- Sound use lower sample frequency, sample size,
mono - Video as image plus reduce fps
4Compression - Images
- Lossless GIF, PNG
- Lossy JPG
- Vector/cartoon often better using GIF/PNG
- Picture usually better with JPG
- Can be trial and error - Demo
5Lossless vs Lossy
- Lossless GIF, PNG
- required for text, some security apps
- original file when decoded
- Lossy JPEG
- Some of the image is thrown away
- Cannot get back to original
- Different amounts thrown away (you can specify)
- Throws away details we do not see
6Compression - Sound
- WAV little compression
- MP3 101 average
- MP3 is MPEG2 Layer 3
- discards portions that are considered less
important to human hearing - A given bit rate suffices for some listeners but
not for others. Individual acoustic perception
may vary, so it is not evident that a certain
psychoacoustic model can give satisfactory
results for everyone. - http//en.wikipedia.org/wiki/Mp3
7Compression - Video
- AVI Windows, some compression, files cant be
bigger than 2Gb, getting long in the tooth, some
old codecs are not recognised - MOV Apple, better compression than WAV, need
Quicktime
8Compression - MPEG
- MPEG different varieties
- MPEG1 VCD
- MPEG2 DVD
- MPEG4 Variable rate for streaming
- MPEG7 for content definition not compression
- MPEG21 security
- http//info.comp.lancs.ac.uk/year2/notes/csc200/20
00-2001/Richard20and20Oliver.swf - http//en.wikipedia.org/wiki/Moving_Picture_Expert
s_Group
9Compression - Video
- 2 hour film
- 2x60x60x1024x768x3x24 Mb
- 1024 x 1024
- 388800 Mb
- 379Gb
- Therefore need 1001 compression to fit onto a
DVD of 4.7Gb
10Compression - When
- Applications
- need to fit onto CD
- think how much video/sound/image can you fit into
600-800Mb - Internet
- time to download
- streaming
- Videoconferencing
- transfer over networks
11Video transmission
- Text data uses narrow bandwidth, can be
transmitted slowly - Multimedia needs wider bandwidth and real time
transmission - H.261 - video compression standard designed for
communications bandwidths between 64kbps - 2Mbps
- designed primarily for VC over ISDN - Video image - 300x200 (24bit colour) to transmit
at 30fps. The size of the video clip that needs
to be transmitted in 1 second is 5.5 MB (Note for
VC you also have sound as well) - Using conventional telephone network - bandwidth
about 2400 bps would take 18,000 secs (5hours) to
transmit the clip - Not possible without compression
12Problems with MM over networks
- LAN conferencing deploys information by dividing
it into packets - Each packet has an ID and destination address
- Packets are sent individually through a network
- Depending on conditions packets may take
different routes and may arrive at different
times or out of order - Can be buffered at receiver end and reordered,
but delay detrimental to interactive applications - Lost data can cause jerky video/sound
13Streaming
- Down-loading is like pouring a drink from a
bottle into a glass, -
- ....then drinking it
- Streaming is like drinking it straight from the
bottle
14Client continuously receives data while
simultaneously displaying what has already been
received
Media is captured and stored on the server
machine
Media stream payloads are broken into packets
Client receiver
Data accessed and viewed via receivers i.e.
Internet, Digital TV, Cell phone, Cable,
Satellite
Buffer resends and recovers lost data .packet
loss will not halt streaming but may give poor
quality
Protocols attempt to maintain the integrity of
the stream
15Two types of streaming
client
client
2 request
1 request
3 stream
3 stream
Server
Server
1 upstream
No files stored server identifies data stream,
encoder digitises encodes and sends
2 access
Clips stored as files