SlideShare a Scribd company logo
INTERACTIVE
MULTIMEDIA SYSTEMS
CODING TECHNIQUES
RUN LENGTH CODING
• Suited for compressing any type of data
regardless of its information, but content of data
will affect the compression ratio. It achieves low
compression ratios, but easy to implement and
quick to execute. It works by reducing the size
of repeating string of characters. Repeating
strings called RUN is typically encoded into two
bytes. The first byte represents no of characters
in run & called RUN COUNT. The second byte
is value of character in run, is called run value.
• This is most useful on data that contains many
such runs: for example, relatively simple graphic
images such as icons, line drawings, and
animations. It is not useful with files that don't
have many runs as it could potentially double the
file size.
• RLE also refers to a little-used image format
• Consider a screen containing plain black text on a
solid white background. There will be many long
runs of white pixels in the blank space, and many
short runs of black pixels within the text. Let us take
a hypothetical single scan line, with B representing a
black pixel and W representing white:
RUN LENGTH CODING
• WWWWWWWWWWWWBWWWWWWWWWW
WWBBBWWWWWWWWWWWWWWW
• If we apply the run-length encoding (RLE) data
compression algorithm to the above hypothetical
scan line, we get the following:
– 12W1B12W3B15W
• Interpret this as twelve W's, one B, twelve W's, three
B's, etc.
• The run-length code represents the original 43
characters in only 13
RUN LENGTH CODING
HUFFMAN CODING
• Huffman coding algorithm determines the
optimal coding using minimum number of bits.
Huffman codes have the unique prefix attribute,
which means they can be correctly decoded
despite being variable length. The procedure for
building the tree is simple and elegant. The
individual symbols are laid out as a string of leaf
nodes that are going to be connected by a binary
tree. Each node has a weight, which is simply the
frequency or probability of the symbol’s
appearance.
• The tree is then built with the following steps
1. The two free nodes with the lowest weights are
located.
2. A parent node for these two nodes is created.
3. It is assigned a weight equal to the sum of the
two child nodes.
4. The parent node is added to the list of free
nodes, and the two child nodes are removed
from that list.
5. The previous steps are repeated until only one
free node is left. This free node is designated
the root of the tree
HUFFMAN CODING
• To generate a Huffman code you traverse the
tree to the value you want, outputting a 0 every
time you take a left-hand branch, and a 1 every
time you take a right-hand branch.
HUFFMAN CODING
• Lets say you have a set of numbers and their
frequency of use and want to create a Huffman
encoding for them:
FREQUENCY VALUE
5 1
7 2
10 3
15 4
20 5
45 6
HUFFMAN CODING
• Sort the list in ascending order of weights and
then just follow the steps.
• Create a parent node with a frequency that is the
sum of the two lower element's frequencies:
12:*
5:1 7:2
HUFFMAN CODING
• The two elements are removed from the list and
the new parent node, with frequency 12, is
inserted into the list by frequency. So now the
list, sorted by frequency, is:
10 : 3
12 : *
15 : 4
20 : 5
45 : 6
HUFFMAN CODING
• You then repeat the loop, combining the two
lowest elements.
22 : *
10 : 3 12 : *
5 : 1 7 : 2
HUFFMAN CODING
• and the list is now:
15 : 4
20 : 5
22 : *
45 : 6
• You repeat until there is only one element left in
the list.
35 : *
15 : 4 20 : 5
HUFFMAN CODING
22 : *
35 : *
45 : 6 57 : *
HUFFMAN CODING
102 : *
45 : 6
HUFFMAN CODING
HUFFMAN CODING
0
0
0
0
0
1
1
1
1
1
Thus value for 15:4 becomes - 010
And the value for 5:1 becomes- 0010 and so on.
ARITHMETIC CODING
• It bypasses the idea of replacing an input symbol
with a specific code. It replaces a stream of input
symbols with a single floating-point output
number. The output from an arithmetic coding
process is a single number less than 1 and
greater than or equal to 0.
• This single number can be uniquely decoded to
create the exact stream of symbols that went into
its construction. To construct the output
number, the symbols are assigned a set of
probabilities.
• The message “BILL GATES,” for example,
would have a probability distribution like this:
ARITHMETIC CODING
Character Probability
SPACE 1/10
A 1/10
B 1/10
E 1/10
G 1/10
I 1/10
L 2/10
S 1/10
T 1/10
ARITHMETIC CODING
• Once character probabilities are known,
individual symbols need to be assigned a range
along a “probability line,” nominally 0 to 1. The
nine-character symbol set used here would look
like the following:
ARITHMETIC CODING
SPACE 1/10 0.00 <= r < 0.10
A 1/10 0.10 <= r < 0.20
B 1/10 0.20 <= r < 0.30
E 1/10 0.30 <= r < 0.40
G 1/10 0.40 <= r < 0.50
I 1/10 0.50 <= r < 0.60
L 2/10 0.60 <= r < 0.80
S 1/10 0.80 <= r < 0.90
T 1/10 0.90 <= r < 1.00
Character Probability Range
ARITHMETIC CODING
• Each character is assigned the portion of the 0 to
1 range that corresponds to its probability of
appearance. The most significant portion of an
arithmetic-coded message belongs to the first
symbols—or B, in the message “BILL GATES.”
ARITHMETIC CODING
• To decode the first character properly, the final
coded message has to be a number greater than or
equal to .20 and less than .30. To encode this
number, track the range it could fall in. After the
first character is encoded, the low end for this
range is .20 and the high end is .30. During the
rest of the encoding process, each new symbol
will further restrict the possible range of the
output number. The next character to be encoded,
the letter I, owns the range .50 to .60 in the new
sub range of .2 to .3
ARITHMETIC CODING
• So the new encoded number will fall somewhere
in the 50th to 60th percentile of the currently
established range. Applying this logic will
further restrict our number to .25 to .26. The
algorithm to accomplish this for a message of
any length is
ARITHMETIC CODING
ARITHMETIC CODING
So the final low value, 0.2572167752, will uniquely
encode the message “BILL GATES” using our
present coding scheme.
Decoding The Text
• Given this encoding scheme, it is relatively easy to
see how the decoding process operates.
• Find the first symbol in the message by seeing
which symbol owns the space our encoded
message falls in.
• Since 0.2572167752 falls between .2 and .3, the
first character must be B. Then remove B from the
encoded number.
• We know the low and high ranges of B, remove
their effects by reversing the process that put them
in.
• Now, subtract the low value of B, giving .
0572167752. Then divide by the width of the
range of B, or .1. This gives a value of .
572167752. Then calculate where that lands,
which is in the range of the next letter, I.
The algorithm for decoding the incoming number is
Lec7 8 9_10 coding techniques

More Related Content

What's hot

Data compression huffman coding algoritham
Data compression huffman coding algorithamData compression huffman coding algoritham
Data compression huffman coding algoritham
Rahul Khanwani
 
Data Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length EncodingData Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length Encoding
MANISH T I
 
Text compression
Text compressionText compression
Text compression
Sammer Qader
 
Huffman's Alforithm
Huffman's AlforithmHuffman's Alforithm
Huffman's Alforithm
Roohaali
 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic coding
Vikas Goyal
 
Source coding
Source coding Source coding
Source coding
Shankar Gangaju
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
Muhammad Saqib Rehan
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
Nihal Gupta
 
Multimedia lossless compression algorithms
Multimedia lossless compression algorithmsMultimedia lossless compression algorithms
Multimedia lossless compression algorithms
Mazin Alwaaly
 
Arithmetic Coding
Arithmetic CodingArithmetic Coding
Arithmetic Coding
anithabalaprabhu
 
Lec32
Lec32Lec32
Data Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano codingData Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano coding
Dr Rajiv Srivastava
 
Huffman Code Decoding
Huffman Code DecodingHuffman Code Decoding
Huffman Code Decoding
Rex Yuan
 
Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compression
anithabalaprabhu
 
Shannon Fano
Shannon FanoShannon Fano
Shannon Fano
anithabalaprabhu
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
Ehtisham Ali
 
Data communication & computer networking: Huffman algorithm
Data communication & computer networking:  Huffman algorithmData communication & computer networking:  Huffman algorithm
Data communication & computer networking: Huffman algorithm
Dr Rajiv Srivastava
 
Lossless
LosslessLossless
Lossless
Vishal Suri
 
Huffman codes
Huffman codesHuffman codes
Huffman codes
Nargis Ehsan
 

What's hot (19)

Data compression huffman coding algoritham
Data compression huffman coding algorithamData compression huffman coding algoritham
Data compression huffman coding algoritham
 
Data Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length EncodingData Compression - Text Compression - Run Length Encoding
Data Compression - Text Compression - Run Length Encoding
 
Text compression
Text compressionText compression
Text compression
 
Huffman's Alforithm
Huffman's AlforithmHuffman's Alforithm
Huffman's Alforithm
 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic coding
 
Source coding
Source coding Source coding
Source coding
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
 
Multimedia lossless compression algorithms
Multimedia lossless compression algorithmsMultimedia lossless compression algorithms
Multimedia lossless compression algorithms
 
Arithmetic Coding
Arithmetic CodingArithmetic Coding
Arithmetic Coding
 
Lec32
Lec32Lec32
Lec32
 
Data Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano codingData Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano coding
 
Huffman Code Decoding
Huffman Code DecodingHuffman Code Decoding
Huffman Code Decoding
 
Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compression
 
Shannon Fano
Shannon FanoShannon Fano
Shannon Fano
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Data communication & computer networking: Huffman algorithm
Data communication & computer networking:  Huffman algorithmData communication & computer networking:  Huffman algorithm
Data communication & computer networking: Huffman algorithm
 
Lossless
LosslessLossless
Lossless
 
Huffman codes
Huffman codesHuffman codes
Huffman codes
 

Viewers also liked

06 Arithmetic 1
06 Arithmetic 106 Arithmetic 1
06 Arithmetic 1
anithabalaprabhu
 
Training material umts cell selection and reselection
Training material umts cell selection and reselectionTraining material umts cell selection and reselection
Training material umts cell selection and reselection
tositoru
 
Line codes
Line codesLine codes
Line codes
Madhumita Tamhane
 
Line coding
Line codingLine coding
Line coding
Gagan Randhawa
 
Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)
anithabalaprabhu
 
Digital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shapingDigital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shaping
Aayush Kumar
 
Line coding
Line codingLine coding
Line coding
srkrishna341
 
Multimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesMultimedia system, Architecture & Databases
Multimedia system, Architecture & Databases
Harshita Ved
 
Coding and Decoding
Coding and DecodingCoding and Decoding
Coding and Decoding
Sudiksha Joshi
 
Information theory & coding (ECE)
Information theory & coding (ECE)Information theory & coding (ECE)
Information theory & coding (ECE)
nitmittal
 
Encoding and Decoding
Encoding and DecodingEncoding and Decoding
Encoding and Decoding
mrhaken
 
The Encoding
The EncodingThe Encoding
The Encoding
Jen W
 
Line coding
Line coding Line coding
Line coding
Ravindra Rathore
 
Line coding
Line codingLine coding
Line coding
Rina Ahire
 
Encoding/Decoding Stuart Hall
Encoding/Decoding Stuart HallEncoding/Decoding Stuart Hall
Encoding/Decoding Stuart Hall
Nic JM
 
Chapter 1: Introduction to Data Communication and Networks
Chapter 1: Introduction to Data Communication and NetworksChapter 1: Introduction to Data Communication and Networks
Chapter 1: Introduction to Data Communication and Networks
Shafaan Khaliq Bhatti
 
Data Encoding
Data EncodingData Encoding
Data Encoding
Luka M G
 

Viewers also liked (17)

06 Arithmetic 1
06 Arithmetic 106 Arithmetic 1
06 Arithmetic 1
 
Training material umts cell selection and reselection
Training material umts cell selection and reselectionTraining material umts cell selection and reselection
Training material umts cell selection and reselection
 
Line codes
Line codesLine codes
Line codes
 
Line coding
Line codingLine coding
Line coding
 
Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)
 
Digital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shapingDigital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shaping
 
Line coding
Line codingLine coding
Line coding
 
Multimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesMultimedia system, Architecture & Databases
Multimedia system, Architecture & Databases
 
Coding and Decoding
Coding and DecodingCoding and Decoding
Coding and Decoding
 
Information theory & coding (ECE)
Information theory & coding (ECE)Information theory & coding (ECE)
Information theory & coding (ECE)
 
Encoding and Decoding
Encoding and DecodingEncoding and Decoding
Encoding and Decoding
 
The Encoding
The EncodingThe Encoding
The Encoding
 
Line coding
Line coding Line coding
Line coding
 
Line coding
Line codingLine coding
Line coding
 
Encoding/Decoding Stuart Hall
Encoding/Decoding Stuart HallEncoding/Decoding Stuart Hall
Encoding/Decoding Stuart Hall
 
Chapter 1: Introduction to Data Communication and Networks
Chapter 1: Introduction to Data Communication and NetworksChapter 1: Introduction to Data Communication and Networks
Chapter 1: Introduction to Data Communication and Networks
 
Data Encoding
Data EncodingData Encoding
Data Encoding
 

Similar to Lec7 8 9_10 coding techniques

Module-IV 095.pdf
Module-IV 095.pdfModule-IV 095.pdf
Module-IV 095.pdf
SamrajECE
 
Compression Ii
Compression IiCompression Ii
Compression Ii
anithabalaprabhu
 
Compression Ii
Compression IiCompression Ii
Compression Ii
anithabalaprabhu
 
Compression ii
Compression iiCompression ii
Compression ii
Chandra Mohan Negi
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptx
MedinaBedru
 
data representation
 data representation data representation
data representation
Haroon_007
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octal
noor300491
 
B sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lcktB sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lckt
MahiboobAliMulla
 
ATT SMK.pptx
ATT SMK.pptxATT SMK.pptx
ATT SMK.pptx
MadhavKarve
 
Abcs of_adcs
Abcs of_adcsAbcs of_adcs
Abcs of_adcs
nthulasiram121
 
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
sudarmani rajagopal
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
NabeelaNousheen
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
ISMT College
 
004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf
MaheShiva
 
Encoder-and-decoder.pptx
Encoder-and-decoder.pptxEncoder-and-decoder.pptx
Encoder-and-decoder.pptx
KamranAli649587
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction system
Rekha dudiya
 
computer architecture organization in Ece
computer architecture organization in Ececomputer architecture organization in Ece
computer architecture organization in Ece
Bayesayohannis
 
Presentation 1
Presentation 1Presentation 1
Presentation 1
RONITKUMAR77
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
LibanMohamed26
 

Similar to Lec7 8 9_10 coding techniques (20)

Module-IV 095.pdf
Module-IV 095.pdfModule-IV 095.pdf
Module-IV 095.pdf
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Compression ii
Compression iiCompression ii
Compression ii
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptx
 
data representation
 data representation data representation
data representation
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octal
 
B sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lcktB sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lckt
 
ATT SMK.pptx
ATT SMK.pptxATT SMK.pptx
ATT SMK.pptx
 
Abcs of_adcs
Abcs of_adcsAbcs of_adcs
Abcs of_adcs
 
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 
004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf
 
Encoder-and-decoder.pptx
Encoder-and-decoder.pptxEncoder-and-decoder.pptx
Encoder-and-decoder.pptx
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction system
 
computer architecture organization in Ece
computer architecture organization in Ececomputer architecture organization in Ece
computer architecture organization in Ece
 
Presentation 1
Presentation 1Presentation 1
Presentation 1
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 

More from Dom Mike

Mm10lifecycle
Mm10lifecycleMm10lifecycle
Mm10lifecycle
Dom Mike
 
Lecture ethics
Lecture ethicsLecture ethics
Lecture ethicsDom Mike
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Dom Mike
 
Lecture 1 prof practices
Lecture 1 prof practicesLecture 1 prof practices
Lecture 1 prof practices
Dom Mike
 
Lec51 52 pre and post production
Lec51 52 pre and post productionLec51 52 pre and post production
Lec51 52 pre and post production
Dom Mike
 
Lec49 50 digital rights management
Lec49 50 digital rights managementLec49 50 digital rights management
Lec49 50 digital rights management
Dom Mike
 
Lec40 45 video conferencing
Lec40 45 video conferencingLec40 45 video conferencing
Lec40 45 video conferencing
Dom Mike
 
Lec28 29 30 animation
Lec28 29 30 animationLec28 29 30 animation
Lec28 29 30 animation
Dom Mike
 
Lec14 15 16 text
Lec14 15 16 textLec14 15 16 text
Lec14 15 16 text
Dom Mike
 
Lec11
Lec11Lec11
Lec11
Dom Mike
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compression
Dom Mike
 
Lec5 interactive multimedia tools
Lec5 interactive multimedia toolsLec5 interactive multimedia tools
Lec5 interactive multimedia tools
Dom Mike
 
Lec3 4 mm applications and use
Lec3 4 mm applications and useLec3 4 mm applications and use
Lec3 4 mm applications and use
Dom Mike
 
Lec1 2 introduction
Lec1 2 introductionLec1 2 introduction
Lec1 2 introduction
Dom Mike
 
Introduction
IntroductionIntroduction
Introduction
Dom Mike
 
Ch7
Ch7Ch7
Ch6
Ch6Ch6
Assessing technology landscape
Assessing technology landscapeAssessing technology landscape
Assessing technology landscape
Dom Mike
 
Lecture 2 19-2
Lecture 2 19-2Lecture 2 19-2
Lecture 2 19-2
Dom Mike
 
Uzair ppt
Uzair pptUzair ppt
Uzair ppt
Dom Mike
 

More from Dom Mike (20)

Mm10lifecycle
Mm10lifecycleMm10lifecycle
Mm10lifecycle
 
Lecture ethics
Lecture ethicsLecture ethics
Lecture ethics
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Lecture 1 prof practices
Lecture 1 prof practicesLecture 1 prof practices
Lecture 1 prof practices
 
Lec51 52 pre and post production
Lec51 52 pre and post productionLec51 52 pre and post production
Lec51 52 pre and post production
 
Lec49 50 digital rights management
Lec49 50 digital rights managementLec49 50 digital rights management
Lec49 50 digital rights management
 
Lec40 45 video conferencing
Lec40 45 video conferencingLec40 45 video conferencing
Lec40 45 video conferencing
 
Lec28 29 30 animation
Lec28 29 30 animationLec28 29 30 animation
Lec28 29 30 animation
 
Lec14 15 16 text
Lec14 15 16 textLec14 15 16 text
Lec14 15 16 text
 
Lec11
Lec11Lec11
Lec11
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compression
 
Lec5 interactive multimedia tools
Lec5 interactive multimedia toolsLec5 interactive multimedia tools
Lec5 interactive multimedia tools
 
Lec3 4 mm applications and use
Lec3 4 mm applications and useLec3 4 mm applications and use
Lec3 4 mm applications and use
 
Lec1 2 introduction
Lec1 2 introductionLec1 2 introduction
Lec1 2 introduction
 
Introduction
IntroductionIntroduction
Introduction
 
Ch7
Ch7Ch7
Ch7
 
Ch6
Ch6Ch6
Ch6
 
Assessing technology landscape
Assessing technology landscapeAssessing technology landscape
Assessing technology landscape
 
Lecture 2 19-2
Lecture 2 19-2Lecture 2 19-2
Lecture 2 19-2
 
Uzair ppt
Uzair pptUzair ppt
Uzair ppt
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 

Lec7 8 9_10 coding techniques

  • 2. RUN LENGTH CODING • Suited for compressing any type of data regardless of its information, but content of data will affect the compression ratio. It achieves low compression ratios, but easy to implement and quick to execute. It works by reducing the size of repeating string of characters. Repeating strings called RUN is typically encoded into two bytes. The first byte represents no of characters in run & called RUN COUNT. The second byte is value of character in run, is called run value.
  • 3. • This is most useful on data that contains many such runs: for example, relatively simple graphic images such as icons, line drawings, and animations. It is not useful with files that don't have many runs as it could potentially double the file size. • RLE also refers to a little-used image format • Consider a screen containing plain black text on a solid white background. There will be many long runs of white pixels in the blank space, and many short runs of black pixels within the text. Let us take a hypothetical single scan line, with B representing a black pixel and W representing white: RUN LENGTH CODING
  • 4. • WWWWWWWWWWWWBWWWWWWWWWW WWBBBWWWWWWWWWWWWWWW • If we apply the run-length encoding (RLE) data compression algorithm to the above hypothetical scan line, we get the following: – 12W1B12W3B15W • Interpret this as twelve W's, one B, twelve W's, three B's, etc. • The run-length code represents the original 43 characters in only 13 RUN LENGTH CODING
  • 5. HUFFMAN CODING • Huffman coding algorithm determines the optimal coding using minimum number of bits. Huffman codes have the unique prefix attribute, which means they can be correctly decoded despite being variable length. The procedure for building the tree is simple and elegant. The individual symbols are laid out as a string of leaf nodes that are going to be connected by a binary tree. Each node has a weight, which is simply the frequency or probability of the symbol’s appearance.
  • 6. • The tree is then built with the following steps 1. The two free nodes with the lowest weights are located. 2. A parent node for these two nodes is created. 3. It is assigned a weight equal to the sum of the two child nodes. 4. The parent node is added to the list of free nodes, and the two child nodes are removed from that list. 5. The previous steps are repeated until only one free node is left. This free node is designated the root of the tree HUFFMAN CODING
  • 7. • To generate a Huffman code you traverse the tree to the value you want, outputting a 0 every time you take a left-hand branch, and a 1 every time you take a right-hand branch. HUFFMAN CODING
  • 8. • Lets say you have a set of numbers and their frequency of use and want to create a Huffman encoding for them: FREQUENCY VALUE 5 1 7 2 10 3 15 4 20 5 45 6 HUFFMAN CODING
  • 9. • Sort the list in ascending order of weights and then just follow the steps. • Create a parent node with a frequency that is the sum of the two lower element's frequencies: 12:* 5:1 7:2 HUFFMAN CODING
  • 10. • The two elements are removed from the list and the new parent node, with frequency 12, is inserted into the list by frequency. So now the list, sorted by frequency, is: 10 : 3 12 : * 15 : 4 20 : 5 45 : 6 HUFFMAN CODING
  • 11. • You then repeat the loop, combining the two lowest elements. 22 : * 10 : 3 12 : * 5 : 1 7 : 2 HUFFMAN CODING
  • 12. • and the list is now: 15 : 4 20 : 5 22 : * 45 : 6 • You repeat until there is only one element left in the list. 35 : * 15 : 4 20 : 5 HUFFMAN CODING
  • 13. 22 : * 35 : * 45 : 6 57 : * HUFFMAN CODING
  • 14. 102 : * 45 : 6 HUFFMAN CODING
  • 15. HUFFMAN CODING 0 0 0 0 0 1 1 1 1 1 Thus value for 15:4 becomes - 010 And the value for 5:1 becomes- 0010 and so on.
  • 16. ARITHMETIC CODING • It bypasses the idea of replacing an input symbol with a specific code. It replaces a stream of input symbols with a single floating-point output number. The output from an arithmetic coding process is a single number less than 1 and greater than or equal to 0.
  • 17. • This single number can be uniquely decoded to create the exact stream of symbols that went into its construction. To construct the output number, the symbols are assigned a set of probabilities. • The message “BILL GATES,” for example, would have a probability distribution like this: ARITHMETIC CODING
  • 18. Character Probability SPACE 1/10 A 1/10 B 1/10 E 1/10 G 1/10 I 1/10 L 2/10 S 1/10 T 1/10 ARITHMETIC CODING
  • 19. • Once character probabilities are known, individual symbols need to be assigned a range along a “probability line,” nominally 0 to 1. The nine-character symbol set used here would look like the following: ARITHMETIC CODING
  • 20. SPACE 1/10 0.00 <= r < 0.10 A 1/10 0.10 <= r < 0.20 B 1/10 0.20 <= r < 0.30 E 1/10 0.30 <= r < 0.40 G 1/10 0.40 <= r < 0.50 I 1/10 0.50 <= r < 0.60 L 2/10 0.60 <= r < 0.80 S 1/10 0.80 <= r < 0.90 T 1/10 0.90 <= r < 1.00 Character Probability Range ARITHMETIC CODING
  • 21. • Each character is assigned the portion of the 0 to 1 range that corresponds to its probability of appearance. The most significant portion of an arithmetic-coded message belongs to the first symbols—or B, in the message “BILL GATES.” ARITHMETIC CODING
  • 22. • To decode the first character properly, the final coded message has to be a number greater than or equal to .20 and less than .30. To encode this number, track the range it could fall in. After the first character is encoded, the low end for this range is .20 and the high end is .30. During the rest of the encoding process, each new symbol will further restrict the possible range of the output number. The next character to be encoded, the letter I, owns the range .50 to .60 in the new sub range of .2 to .3 ARITHMETIC CODING
  • 23. • So the new encoded number will fall somewhere in the 50th to 60th percentile of the currently established range. Applying this logic will further restrict our number to .25 to .26. The algorithm to accomplish this for a message of any length is ARITHMETIC CODING
  • 25. So the final low value, 0.2572167752, will uniquely encode the message “BILL GATES” using our present coding scheme.
  • 26. Decoding The Text • Given this encoding scheme, it is relatively easy to see how the decoding process operates. • Find the first symbol in the message by seeing which symbol owns the space our encoded message falls in. • Since 0.2572167752 falls between .2 and .3, the first character must be B. Then remove B from the encoded number. • We know the low and high ranges of B, remove their effects by reversing the process that put them in.
  • 27. • Now, subtract the low value of B, giving . 0572167752. Then divide by the width of the range of B, or .1. This gives a value of . 572167752. Then calculate where that lands, which is in the range of the next letter, I.
  • 28. The algorithm for decoding the incoming number is