SlideShare a Scribd company logo
The Lossless JPEG standard
• y=(a+b)/2 = 145
• r=145-180=-35
• Category (r) = 6, Magnitude (r) = 100011
• 1’s complement of cat (r) = 011100
• Rep(35)={6,011100}
• Let Huff. code(6) = 1110
• Code(-35)=1110011100
100 191
100 180
MSB=0 fpr
numbers < 0
10 bits
The JPEG-LS standard
• Loco project (http://www.hpl.hp.com/loco/)
• Near-lossless encoding
• decoder output does not differ from the input
by no more than a pre-specified value
• JPEG-LS coder
• Context modeling – encoding of a pixel depends on the
previous pixels
• Run-length encoder – for smooth parts of the image
• Predictor – like in the lossless JPEG scheme
• Error Coder – to reconstruct the difference between the
prediction and the signal
The JPEG-LS standard
• Context Model
• two probability models: flat areas and edge-areas
• compute d1=d-a, d2=a-c, d3=c-b
• quantize d1, d2, d3 to Q1, Q2, Q3 using thresholds
T1, T2, T3. For 8-bit images they are 3, 7, 21
• any Q can take up to 9 possible values based on
the threshold interval it is in
• This produces 93
-1=728 combinations for
{Q1,Q2,Q3}, or 364 using symmetry
c a d
b X
The JPEG-LS standard
• Run-mode coder
• If gradients are close to 0, the encoder gets into a run-mode
• So long as |x-b| ≤ ε, the encoder reads subsequent samples
• Then it returns the run-length
• If end-of-line is reached, it encodes the last sample
• At the pixel x the predictor computes prediction error e=y-
x where
min(a,b) if c ≥ max(a,b)
y= max(a,b) if c ≤ min(a,b)
a+b-c
• Remove any prediction bias
• Remap e to e′ = 2e for positive e and –2e-1 for negative e
• Encode e′ with Golomb-Rice encoding
The JPEG-LS standard
• The parameter k for Golomb-Rice encoding is
obtained by
• k =
• A[i]: accumulated sum of prediction errors
• N[i]: number of prediction residuals seen in context i
• Removal of prediction bias
• Idea: the prediction error must follow a 2-sided
geometric distribution
• Computed using A[i] – how?
• B[i], sum of errors after correction and C[i], the
correction itself are also stored






][
][
log 2
iN
iA
Lempel-Ziv-Welch Compression
• Non-prefix encoding scheme
• Algorithm
• Step 1: Initialize string table with basic characters
• Step 2: Initialize prefix […] ← empty
repeat until no character left
• Step 3: Create variable currentStream by reading the next character C
from characterstream
• Step 4: Check if currentString in the string table
• If yes then […] ← […] C; go to step 3
• Else add to […] C the string table
• Output code for [...] to codestream
• […] ← next character
• Go to step 3
Lempel-Ziv-Welch Compression
• Take a 4 character alphabet: p q r s
• Consider a message “p q p r p q p”
• Construct String table
• 0:p, 1:q, 2:r, 3:s
• Initialize prefix
• prefix=[]
• currentstring = [] p
• This is in table, so prefix =[p]
• currentstring =[p] q
• Not in table, update table, and output code for p 0 →
• prefix=[q], code character : 0:p, 1:q, 2:r, 3:s, 4:pq
• currentstring =[q]p
• Not in table, update table, and output code for q 1 →
• Prefix=[p], code character : 0:p, 1:q, 2:r, 3:s, 4:pq, 5:qp
Representing digital raster
images
• Issues:
• Raw versus compressed
• Single-image versus multi- image
• Color representation
• Singe versus multi-resolution
The GIF Format
A file generated from the grammar
<GIF Data Stream> ::= Header <Logical Screen><Data>* Trailer
<Logical Stream> ::= Logical Screen Descriptor [Global Color Table]
<Data> ::= <Graphic Block> <Special Purpose Block>
<Graphic Block> ::= [Graphic Control Extension] <Graphic Rendering Block>
<Graphic Rendering Block> ::= <Table-Based Image> | Plain Text Extension
<Table-Based Image> ::= Image Descriptor [Local Color Table] Image Data
<Special Purpose Block> ::= Application Extension | Comment Extension
Control block
Not used for
decoding
The GIF Format
• Structure of a block
• Block Size:byte
• Data Value: byte
• Logical Screen Descriptor
• Logical Screen Width
• Logical Screen Height
• Packed Bits
• Global Color Table Flag
• Color Resolution: number of bits per primary color - 1
• Sort Flag
• Size of Global Color Table
• Background Color Index
• Pixel Aspect Ratio
The GIF Format
• Image Descriptor
• Image Separator
• Image Left Position
• Image Top Position
• Image Width
• Image Height
• Packed Fields
• Local Color Table Flag
• Interlace Flag: Interlace patter is 4-pass
• Sort Flag
• Size of Local Color Table
The GIF Format
• Table-Based Image Data
• LZW Minimum Code Size: same as number of color bits
• Compression Steps
– Establish Code Size
– Perform Compression
– Build Series of Bytes
– Package bytes into blocks
• Image Data in sub-blocks of at most 255 bytes
• Graphic Control Extension
• Extension Introducer
• Graphic Control Labrl
• Block Size
• Packed Bits
• Disposal method, user input flag, transparent color flag
• Delay Time
• Transparent Color Index
Network-Aware Formats
• A tradeoff problem
• Compression efficiency vs. progressive transmission
performance
• Network factors
• Packet loss
• Asynchronous arrival of packets at destination
• Progressive Transmission Factors
• % of picture visible as a function of time
• Same given a certain amount of packet loss
Network-Aware Formats
• Recent Research in University of Delaware
• NETCICATS project
(http://www.eecis.udel.edu/~iren/netcicats.html)
• Primary idea
• Break the picture into maximum transmission unit (MTU)
sized chunks that a link layer will carry without the IP layer
further fragmenting it
• The MTU sized picture fragments (also called application data
units) should be “self contained” to the extent possible
The GIFNC Proposal
• The Screen Descriptor
• An ADU could be a color map or data
• An ADU has an extra byte that identifies
• The image number of an image
• A local color map and the image identifier to which it belongs
• If an ADU is a color map
• The start and end indices of the color map
• The image descriptor
• The image is always interlaced
• L and G flags for the last image and all ADUs of the last image
respetively

More Related Content

PDF
Graph Regularised Hashing
PPT
35th 36th Lecture
PDF
Code quailty metrics demystified
PDF
Efficiently Performing Arithmetic Operation over Fq18 Extension Field
PPT
Woop - Workflow Optimizer
PPT
Matlab Nn Intro
PPTX
Explore ML Beginner Session on Linear Regression
PPTX
The Case for Learned Index Structures
Graph Regularised Hashing
35th 36th Lecture
Code quailty metrics demystified
Efficiently Performing Arithmetic Operation over Fq18 Extension Field
Woop - Workflow Optimizer
Matlab Nn Intro
Explore ML Beginner Session on Linear Regression
The Case for Learned Index Structures

What's hot (10)

PPTX
Carry look ahead adder
PPTX
Microprocessor Week 4-5 MCS-51 Arithmetic operation
PPTX
VLSI DESIGN Conference 2016, Kolkata- Authenticated Encryption Decryption
PPT
carry look ahead adder
PDF
Digital logic design1
PDF
Analysis of different bit carry look ahead adder using verilog code 2
PPTX
PPT
Lec6 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Can...
PPT
07f03 carryskip
PPTX
Sequential circuit multiplier
Carry look ahead adder
Microprocessor Week 4-5 MCS-51 Arithmetic operation
VLSI DESIGN Conference 2016, Kolkata- Authenticated Encryption Decryption
carry look ahead adder
Digital logic design1
Analysis of different bit carry look ahead adder using verilog code 2
Lec6 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Can...
07f03 carryskip
Sequential circuit multiplier
Ad

Similar to Mmclass3 (20)

PPT
ohh dear (1).ppt 1
PPT
Intro_OpenCV.ppt
PPT
Mmclass4
PPT
image compresson
PPT
Image compression
PPT
Unit I-cg.ppt Introduction to Computer Graphics elements
PPT
Introduction to Computer Graphics elements
PPT
Introduction to Computer Graphics computer
PPT
video compression techinique for headend.ppt
PPT
Mmclass5b
PDF
Cryptography
PPTX
DIGITAL ELECTRONICS KMAP Boolean algebra
PDF
CMOS Image Sensor Design_h20_10_jpeg.pdf
PDF
Image style transfer & AI on App
PPTX
Cahall Final Intern Presentation
PPT
notes_Image Compression_edited.ppt
PPTX
MATLAB & Image Processing
PDF
Hpg2011 papers kazakov
PPT
Prinsip gambar digital
ohh dear (1).ppt 1
Intro_OpenCV.ppt
Mmclass4
image compresson
Image compression
Unit I-cg.ppt Introduction to Computer Graphics elements
Introduction to Computer Graphics elements
Introduction to Computer Graphics computer
video compression techinique for headend.ppt
Mmclass5b
Cryptography
DIGITAL ELECTRONICS KMAP Boolean algebra
CMOS Image Sensor Design_h20_10_jpeg.pdf
Image style transfer & AI on App
Cahall Final Intern Presentation
notes_Image Compression_edited.ppt
MATLAB & Image Processing
Hpg2011 papers kazakov
Prinsip gambar digital
Ad

More from Hassan Dar (10)

PPT
Mmclass9
PPT
Mmclass6
PPT
Mmclass5
PPT
Mmclass2
PPT
Mmclass1
PPT
Lecture1
PPT
Chapter 1
PPT
PPT
Msd ch2 issues in multimedia
PPT
Mmclass10
Mmclass9
Mmclass6
Mmclass5
Mmclass2
Mmclass1
Lecture1
Chapter 1
Msd ch2 issues in multimedia
Mmclass10

Recently uploaded (20)

PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
introduction to high performance computing
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PPT
Total quality management ppt for engineering students
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
Feature types and data preprocessing steps
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPTX
communication and presentation skills 01
PPT
Occupational Health and Safety Management System
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPTX
Artificial Intelligence
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
Visual Aids for Exploratory Data Analysis.pdf
introduction to high performance computing
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Total quality management ppt for engineering students
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Feature types and data preprocessing steps
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
communication and presentation skills 01
Occupational Health and Safety Management System
Fundamentals of safety and accident prevention -final (1).pptx
Artificial Intelligence
III.4.1.2_The_Space_Environment.p pdffdf
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...

Mmclass3

  • 1. The Lossless JPEG standard • y=(a+b)/2 = 145 • r=145-180=-35 • Category (r) = 6, Magnitude (r) = 100011 • 1’s complement of cat (r) = 011100 • Rep(35)={6,011100} • Let Huff. code(6) = 1110 • Code(-35)=1110011100 100 191 100 180 MSB=0 fpr numbers < 0 10 bits
  • 2. The JPEG-LS standard • Loco project (http://www.hpl.hp.com/loco/) • Near-lossless encoding • decoder output does not differ from the input by no more than a pre-specified value • JPEG-LS coder • Context modeling – encoding of a pixel depends on the previous pixels • Run-length encoder – for smooth parts of the image • Predictor – like in the lossless JPEG scheme • Error Coder – to reconstruct the difference between the prediction and the signal
  • 3. The JPEG-LS standard • Context Model • two probability models: flat areas and edge-areas • compute d1=d-a, d2=a-c, d3=c-b • quantize d1, d2, d3 to Q1, Q2, Q3 using thresholds T1, T2, T3. For 8-bit images they are 3, 7, 21 • any Q can take up to 9 possible values based on the threshold interval it is in • This produces 93 -1=728 combinations for {Q1,Q2,Q3}, or 364 using symmetry c a d b X
  • 4. The JPEG-LS standard • Run-mode coder • If gradients are close to 0, the encoder gets into a run-mode • So long as |x-b| ≤ ε, the encoder reads subsequent samples • Then it returns the run-length • If end-of-line is reached, it encodes the last sample • At the pixel x the predictor computes prediction error e=y- x where min(a,b) if c ≥ max(a,b) y= max(a,b) if c ≤ min(a,b) a+b-c • Remove any prediction bias • Remap e to e′ = 2e for positive e and –2e-1 for negative e • Encode e′ with Golomb-Rice encoding
  • 5. The JPEG-LS standard • The parameter k for Golomb-Rice encoding is obtained by • k = • A[i]: accumulated sum of prediction errors • N[i]: number of prediction residuals seen in context i • Removal of prediction bias • Idea: the prediction error must follow a 2-sided geometric distribution • Computed using A[i] – how? • B[i], sum of errors after correction and C[i], the correction itself are also stored       ][ ][ log 2 iN iA
  • 6. Lempel-Ziv-Welch Compression • Non-prefix encoding scheme • Algorithm • Step 1: Initialize string table with basic characters • Step 2: Initialize prefix […] ← empty repeat until no character left • Step 3: Create variable currentStream by reading the next character C from characterstream • Step 4: Check if currentString in the string table • If yes then […] ← […] C; go to step 3 • Else add to […] C the string table • Output code for [...] to codestream • […] ← next character • Go to step 3
  • 7. Lempel-Ziv-Welch Compression • Take a 4 character alphabet: p q r s • Consider a message “p q p r p q p” • Construct String table • 0:p, 1:q, 2:r, 3:s • Initialize prefix • prefix=[] • currentstring = [] p • This is in table, so prefix =[p] • currentstring =[p] q • Not in table, update table, and output code for p 0 → • prefix=[q], code character : 0:p, 1:q, 2:r, 3:s, 4:pq • currentstring =[q]p • Not in table, update table, and output code for q 1 → • Prefix=[p], code character : 0:p, 1:q, 2:r, 3:s, 4:pq, 5:qp
  • 8. Representing digital raster images • Issues: • Raw versus compressed • Single-image versus multi- image • Color representation • Singe versus multi-resolution
  • 9. The GIF Format A file generated from the grammar <GIF Data Stream> ::= Header <Logical Screen><Data>* Trailer <Logical Stream> ::= Logical Screen Descriptor [Global Color Table] <Data> ::= <Graphic Block> <Special Purpose Block> <Graphic Block> ::= [Graphic Control Extension] <Graphic Rendering Block> <Graphic Rendering Block> ::= <Table-Based Image> | Plain Text Extension <Table-Based Image> ::= Image Descriptor [Local Color Table] Image Data <Special Purpose Block> ::= Application Extension | Comment Extension Control block Not used for decoding
  • 10. The GIF Format • Structure of a block • Block Size:byte • Data Value: byte • Logical Screen Descriptor • Logical Screen Width • Logical Screen Height • Packed Bits • Global Color Table Flag • Color Resolution: number of bits per primary color - 1 • Sort Flag • Size of Global Color Table • Background Color Index • Pixel Aspect Ratio
  • 11. The GIF Format • Image Descriptor • Image Separator • Image Left Position • Image Top Position • Image Width • Image Height • Packed Fields • Local Color Table Flag • Interlace Flag: Interlace patter is 4-pass • Sort Flag • Size of Local Color Table
  • 12. The GIF Format • Table-Based Image Data • LZW Minimum Code Size: same as number of color bits • Compression Steps – Establish Code Size – Perform Compression – Build Series of Bytes – Package bytes into blocks • Image Data in sub-blocks of at most 255 bytes • Graphic Control Extension • Extension Introducer • Graphic Control Labrl • Block Size • Packed Bits • Disposal method, user input flag, transparent color flag • Delay Time • Transparent Color Index
  • 13. Network-Aware Formats • A tradeoff problem • Compression efficiency vs. progressive transmission performance • Network factors • Packet loss • Asynchronous arrival of packets at destination • Progressive Transmission Factors • % of picture visible as a function of time • Same given a certain amount of packet loss
  • 14. Network-Aware Formats • Recent Research in University of Delaware • NETCICATS project (http://www.eecis.udel.edu/~iren/netcicats.html) • Primary idea • Break the picture into maximum transmission unit (MTU) sized chunks that a link layer will carry without the IP layer further fragmenting it • The MTU sized picture fragments (also called application data units) should be “self contained” to the extent possible
  • 15. The GIFNC Proposal • The Screen Descriptor • An ADU could be a color map or data • An ADU has an extra byte that identifies • The image number of an image • A local color map and the image identifier to which it belongs • If an ADU is a color map • The start and end indices of the color map • The image descriptor • The image is always interlaced • L and G flags for the last image and all ADUs of the last image respetively