BITS 2513 - Internet Technology Presentation Layer
BITS 2513 - Internet Technology Presentation Layer
Lecture 6:
Presentation Layer
Topics Covered
Introduction to Presentation Layer
Data Representation
Data Compression
Image
Audio
Video
Encryption
Presentation Layer
The presentation layer is the sixth level of
the seven layer OSI model.
It responds to service requests from the
application layer and issues service
requests to the session layer.
Concerned with syntax and semantics of
the information exchanged between two
systems.
Presentation Layer
Fromapplicationlayer Toapplicationlayer
Data Data
Presentationlayer Presentationlayer
Tosessionlayer Fromsessionlayer
Presentation Format
In the case of the sender and receiver
seeing the same data, the issue is one of
agreeing to a message format, called a
presentation format .
The presentation layer may represent
(encode) the data in various ways (e.g.,
data compression, or encryption), but the
receiving peer will convert the encoding
back into its original meaning (decode).
Encoding/Decoding
The sending program translates the data
it wants to transmit from the
representation it uses internally into a
message that can be transmitted over the
network
→ the data is encoded in a message.
On the receiving side, the application
translates this arriving message into a
representation it can process
→ the message is decoded .
Presentation formatting
Application Application
data data
Presentation Presentation
encoding decoding
■■■
Message Message Message
Picture Picture
Uncompressed
Quantization
Preparation Processing
Picture
Entropy
Encoding
Compressed
Picture
Major steps of image compression, can also be applied to audio and video data
DATA COMPRESSION
IMAGE COMPRESSION
Image Compression
to represent images with less data in
order to save storage costs or
transmission time.
possible to reduce file size to 10% from
the original without noticeable loss in
quality.
Image compression can be lossless or
lossy .
Image Compression
Lossless
- Image quality is not reduced.
Use in : artificial images that contain sharp-
edged lines such as technical drawings, textual
graphics, comics, maps or logos.
Methods : run-length encoding (RLE), entropy
coding (Huffman coding) and dictionary coders
(LZW) .
Image Compression
Lossy
- reduces image quality. Cannot get the
original image back & lose some
information.
Use in : natural images such as photos of
landscapes
Methods : discrete cosine transform (DCT,
used in JPEG) or wavelet transform (used
in JPEG 2000), color quantization
FORMAT FILE TYPE OF METHODS USAGE
EXTENTI COMPRESSIO
ON N
BMP (bitmap) .bmp Cosiderably ZIP used to store bitmap
compressed with digital images
lossless
JPEG .jpg , Lossy - Discrete Cosine For natural images
(Joint Photographic .jpeg , .jpe Transform (DCT) &
Experts Group) Chroma Subsampling
Lossless - Run-Length Encoding
(RLE)
GIF (Graphics .gif , .giff , Lossless LZW (Lempel-Ziv- For artificial images
Interchange Format .gfa Welch) (sharp-edge lines and
few colors) & support
animation
PNG (Portable .png Lossless DEFLATE Better compression &
Network Graphics) features than GIF, but
don’t support animation
TIFF (Tagged Image .tiff , .tif Lossless RLE / LZW / DEFLATE / Flexible file format, can
File Format) ZIP store multiple images in
a single file
JPEG2000 jp2, .j2c, Lossy & Lossless Discrete Wavelet Better image quality
jpc, j2k, jpx Transform (DWT) than JPEG (up to 20%),
not widely used because
of some patent issues.
Comparison of graphics file formats
Block Diagram of JPEG
Compression
AUDIO COMPRESSION
Audio Compression
A form of data compression designed to
reduce the size of audio files
Audio compression can be lossless or
lossy
Audio compression algorithms are
typically referred to as audio codecs .
Audio Compression
Lossless - allows one to preserve an exact copy
of one's audio files
Usage: For archival purposes, editing, audio quality.
Codecs:
Free Lossless Audio Codec (FLAC)
Apple Lossless
MPEG-4 ALS
Monkey's Audio
Lossless Predictive Audio Compression (LPAC)
Lossless Transform Audio Compression (LTAC)
Audio Compression
Lossy - irreversible changes , achieves far greater
compression, use psychoacoustics to recognize that
not all data in an audio stream can be perceived by
the human auditory system.
Usage: distribution of streaming audio, or
interactive applications
Codecs:
MP2- MPEG-1Layer 2 audio codec
MP3 – MPEG-1 Layer 3 audio codec
MPC Musepack
Vorbis Ogg Vorbis
AAC Advanced Audio Coding (MPEG-2 and MPEG-4)
WMA Windows Media Audio
AC3 AC-3 or Dolby Digital A/52
MPEG
Stands for Moving Picture Experts Group. MPEG is an
ISO/IEC working group, established in 1988 to develop
standards for digital audio and video formats.
MPEG-1
Designed for up to 1.5 Mbit/sec
Standard for the compression of moving pictures and
audio. Most popular is level 3 of MPEG-1 (MP3). MPEG-1
is the standard of compression for VideoCD.
MPEG-2
Designed for between 1.5 and 15 Mbit/sec
Standard on which Digital Television set top boxes and
DVD compression is based. Designed for the compression
and transmission of digital broadcast television
MPEG (cont.)
MPEG-4
Standard for multimedia and Web compression.
MPEG-4 is based on object-based compression,
similar in nature to the Virtual Reality Modeling
Language. It also allows developers to control
objects independently in a scene, and therefore
introduce interactivity.
MPEG-7 (under development) - also called the
Multimedia Content Description Interface.
Contrary to the previous MPEG standards, which
described actual content, MPEG-7 will represent
information about the content.
MPEG Audio Encoding
Divisionin32
Uncompressed Frequency Quantization
Audio Signal Bands
(if applicable)
Entropy
Psychoacoustic Encoding
Model controls
Compressed
Audi o Data
Audio Compression Formats – MP3
Creation Process Stages:
Separation into Frames
Spectral Analysis
“Masking” ( P sychoacoustic M odels )
Processing ~ Bit Rate & Joint Stereo
Compressing ( Hoffman ZIP )
CBR & VBR (Constant Bit Rate and Variable Bit
Rate)
Most Popular
Many codec's and players
Audio Compression Formats
– Ogg Vorbis
Creation Process Stages:
Same as those in MP3
Improvements over MP3
Designed for Streaming Connection
Real Stereo ~ No Multiplexing
Multi-Channel Support (more than Mono & Stereo)
Bit Rate Scaling
Preferred VBR
New Codec
Free Source Code
One codec and few players
Audio Compression Formats –
WMA
Advanced System Format (ASF) including:
Support for Meta Data
Scripting
Security Features
CBR & VBR (only after version 9)
Industrial Support
Free Codec
Few Players
DATA COMPRESSION
VIDEO COMPRESSION
Video Compression
Storing and transmitting uncompressed raw
video is not an efficient technique because it
needs large amounts of storage and
bandwidth.
DVD, DSS, and internet video, all use digital
data → take a lot of space to store and large
bandwidth to transmit.
Video compression technique is used to
compress the data for these applications
→ less storage space and less bandwidth to
transmit data.
Video Compression
Videos are sequences of images displayed at a
high rate. Each of these images is called a frame.
Human eye can not notice small changes in the
frames such as a slight difference in color.
Therefore, video compression standards do not
require the encoding of all the details and some
of the less important video details are lost. This is
because lossy compression is used due to its
ability to get very high compression ratios.
Typically 30 frames are displayed on the screen
every second.
Video Compression Process
n Start by encoding the first frame using a still
image compression method.
n
It should then encode each successive frame by
identifying the differences between the frame
and its predecessor, and encoding these
differences. If the frame is very different from its
predecessor it should be coded independently of
any other frame.
In the video compression literature, a frame that
is coded using its predecessor is called inter
frame (or just inter), while a frame that is
coded independently is called intra frame (or
just intra).
Video Compression Techniques
Flow Control and Buffering
Temporal Compression
Spatial Compression
Discrete Cosine Transform (DCT)
Vector Quantization (VQ)
Fractal Compression
Discrete Wavelet Transform (DWT).
Video Compression Formats
The ISO/IEC, or International Organization for
Standardization and the International
Electrotechnical Commission, have a group called
the Moving Pictures Experts Group or MPEG.
MPEG is responsible, for the familiar compression
formats MPEG-1 , MPEG-2 and MPEG-4 .
The ITU-T standardizes formats for the
International Telecommunications Union, a United
Nations Organization. Some popular ITU-T
compression formats include the H.261 and H.264
formats.
There are other compression formats, such as Intel
Indeo and RealVideo (based on the ITU-T H.263
codec), AVI, DivX, Quicktime, Windows Media
Video (WMV).
ENCRYPTION
Encryption
• To carry sensitive information, a system must
be able to assure privacy.
• As the number of attacks increase and as the
public Internet is used to transmit private
data, it is increasingly difficult to protect
information.
• One way to safeguard data from attacks is
encrypting the data.
• Practically, encryption is suitably done in
presentation layer besides transport and
physical layer.
Encryption
Encryption – sender transform original
information (plaintext) to another form
(ciphertext) by a function that is
parameterised by a key.
Decryption – reverses the original process to
transform the message (ciphertext) back to
its original form (plaintext).
Encryption
Plaintext Plaintext
Ciphertext