10/10/04 ian/modules/com342/com342_l5.ppt l5/1/28 com342 networks and data communications ian...

27
10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrum Room 5D03B Tel: 90 366364 voice mail on 6 th ring Email: [email protected] Web site: http://www.eej.ulst.ac.uk Lecture 5: Practical applications of Multimedia in Particular

Upload: emerald-bell

Post on 16-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/1/28

COM342Networks and Data Communications

Ian McCrum Room 5D03B

Tel: 90 366364 voice mail on 6th ring

Email: [email protected]

Web site: http://www.eej.ulst.ac.uk

Lecture 5: Practical applications of Multimedia in Particular

Page 2: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/2/28

After this lecture you should be able to:

• Understand the need for data compression, particularly in relation to video and audio.

• Realise the difference between lossless and lossy encoding systems.

• Be aware of the difference between symmetrical and asymmetrical coding systems.

• Have a good appreciation of the implementation the JPEG standard.

• Invitation to look at MPEG standard

Page 3: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/3/28

That which must be compressed• Audio frequencies

– 20Hz to 20KHz– amplitude variation of million

– comment upon power-amplitude p724

• Sample amplitude and digitise using ADC– sampling frequency 40,000/sec from Nyquist– number samples 8bits reduce perception of

quantisation.

• telephone 8000x8bit samples per sec and CD (44.1k samples of 16 bits)/sec

• Music Instrument Digital Interface

Page 4: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/4/28

Fig 7.57 (a) AST

Page 5: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/5/28

Quantisation

Page 6: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/6/28

Telephone systems

• Compression has been attempted which has a model of the head which generates the human voice.

• Vocal tract, resonant cavity, tongue, jaw etc.• the parameters of the model are determined from

sampling a portion of speech.• the coefficients are then transmitted representing

speech.• fine until non-head sound is attempted.

Page 7: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/7/28

That which must be compressed II

• Video– film ~20 frames/sec– TV 25 full frames or 50 1/2 frames/sec

– see Fig 7-77

• UK TV 625lines * 25frames/sec = line frequency of 15.625kHz

• USA TV 525lines * 30frames/sec = line frequency of 15.750kHz

• therefore 640samples * 3colours * 8 bits *625lines *25frames/sec =240*106 bits/sec

Page 8: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/8/28

Page 9: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/9/28

points to ponder

• nb Teletext,

• interlaced fields,

• PAL, NTSC,

• luminance and chrominance.

• requirement for colour pictures to viewed on existing B/W TV

Page 10: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/10/28

Compression• encoding• decoding• symmetrical• asymmetrical• lossless• lossy

• think about the process of reducing an A4 page to 50% of its original size and then expanding it up again, in terms of the list above.

Page 11: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/11/28

Entropy encoding• no account taken of type of bits

– run length encoding– Huffman encoding– Colour lookup tables

• determine actual colours combinations used out of 224 possible colours perhaps only 256 actual, determine table and then choose by index. (asymmetrical and lossless)

Page 12: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/12/28

Source encoding• recognise properties of data.• differential encoding(audio)

– difference from previous value– possibly cannot track large scale rapid changes in

consecutive samples– information lost– symmetrical

• Transformations– transform signals from one domain to another– time(frequency) as a list of amplitudes– TX incomplete list– lossy

Page 13: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/13/28

Transformations continued

• cf 4 x 4 matrix of pixels 8bit grey scale

• subtract upper lhs element from all others.

• if data is slowly varying then encode as 4bits with one 8bit number for ulhs sample

• lossless

• symmetrical

Page 14: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/14/28

Source encoding continued• Vector quantisation for image data

– divide image into rectangles– construct a code book– send index to rectangle– perform dynamically– asymmetrical

• pattern matching when encoding– can be lossy if best match is used– should recognise when no compression is possible

Page 15: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/15/28

JPEG leading to MPEG• Image of 640 x 480 RGB 24bits/pixel=7,372,800b

– Fig 7.80

• Compute matrix of luminances and chrominances according to formulae– Fig 7.81

• now 640 x 480 x 8bits luminance = 2,457,600b• 2 off 320 x 240 x 8bits chrominance = 1,228,800• subtract 128 so that 0 is middle value.• divide each matrix into 8x8pixel blocks• Y has 4800 and U and V each 1200

Page 16: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/16/28

Page 17: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/17/28

Luminance

Page 18: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/18/28

Chrominances

Page 19: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/19/28

next

• apply discrete cosine transformation to each of the blocks

• see Fig 7.82

• output is an 8x8 matrix of coefficients

• describes spectral power at each spatial frequency (losses due to rounding)

• quantisation (further losses) to reduce higher spatial frequencies.

• encode (0,0) element differentially using previous block’s(0,0)

• run length encode the zig zag list of elements.

• Huffman encode resulting numbers.

• 20:1 lossy and asymmetrical

Page 20: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/20/28

Page 21: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/21/28

Page 22: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/22/28

Page 23: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/23/28

Page 24: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/24/28

Page 25: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/25/28

Page 26: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/26/28

Compression pointers

• Stalling’s Book can be got from the link below: http://www1.shore.net/~ws/DCC5e.html

• Tanenbaum’s home page can be got at the url: http://www.cs.vu.nl/~ast/

• Compression utilities can be found for all operating systems at: http://www.gromwin.demon.co.uk/ vanessa/compress.htm

Page 27: 10/10/04 ian/modules/COM342/COM342_L5.ppt L5/1/28 COM342 Networks and Data Communications Ian McCrumRoom 5D03B Tel: 90 366364 voice

10/10/04 www.eej.ulster.ac.uk/~ian/modules/COM342/COM342_L5.ppt L5/27/28

you should now be able to:• Understand the need for data compression,

particularly in relation to video and audio.• Realise the difference between lossless and

lossy encoding systems.• Be aware of the difference between

symmetrical and asymmetrical coding systems. • Have a good appreciation of the

implementation the JPEG standard• you should now be able to investigate the

MPEG standard 738-744 A.T.