SlideShare a Scribd company logo
1 of 5
Topics:LZ77 & LZ78
Lossless compression
Lossless compression is a class of data compression algorithms that allows the original data to
be perfectly reconstructed from the compressed data. By contrast, lossy compression permits
reconstruction only of an approximation of the original data, though usually with improved
compression rates (and therefore reduced file sizes).
Lossless data compression is used in many applications. For example, it is used in the ZIP file
format and in the GNU tool gzip. It is also often used as a component within lossy data
compression technologies (e.g. lossless mid/side joint stereo preprocessing by MP3 encoders and
other lossy audio encoders).
Lossless compression is used in cases where it is important that the original and the
decompressed data be identical, or where deviations from the original data would be
unfavourable. Typical examples are executable programs, text documents, and source code.
Some image file formats, like PNG or GIF, use only lossless compression, while others like TIFF
and MNG may use either lossless or lossy methods. Lossless audio formats are most often used
for archiving or production purposes, while smaller lossy audio files are typically used on
portable players and in other cases where storage space is limited or exact replication of the
audio is unnecessary.
LZ77 and LZ78
LZ77 and LZ78 are the two lossless data compression algorithms published in papers by
Abraham Lempel and Jacob Ziv in 1977[1] and 1978.[2] They are also known as LZ1 and LZ2
respectively.[3] These two algorithms form the basis for many variations including LZW, LZSS,
LZMA and others. Besides their academic influence, these algorithms formed the basis of
several ubiquitous compression schemes, including GIF and the DEFLATE algorithm used in
PNG and ZIP.
They are both theoretically dictionary coders. LZ77 maintains a sliding window during
compression. This was later shown to be equivalent to the explicit dictionary constructed by
LZ78—however, they are only equivalent when the entire data is intended to be decompressed.
Since LZ77 encodes and decodes from a sliding window over previously seen characters,
decompression must always start at the beginning of the input. Conceptually, LZ78
decompression could allow random access to the input if the entire dictionary were known in
advance. However, in practice the dictionary is created during encoding and decoding by
creating a new phrase whenever a token is output.[4]
The algorithms were named an IEEE Milestone in 2004
1 History
 In 1977, Jacov Zivy AbrahamLempel propose the LZ77 algorithm.
 In the eighties,abranchof LZ77 knownas LZSS and isimplementedbyHaruyasuYoshizaki inthe
program LHARC,discoveringthe possibilitiesof the LZ77 encoding.
 Afterthat,a large numberof textcompressorshave beenbasedonthe LZ77 idea(ora variation
of it).Some of the mostfamousare: ARJ,RAR,gzipand 7z.
2 FundamentalsofLZ77
 LZ77 processesasequence of symbolsusingthe structure:
 The dictionaryandthe look-aheadbufferhave afixedsize andcan be consideredasa sliding
window,where the inputof a new symbol generatesthe outputof the oldestone,which
becomesthe newestsymbolof the dictionary.
3 TheLZ77 encoder
1. Let I the lengthof the dictionaryandJ the lengthof the buffer.
2. Inputthe first J symbolsinthe buffer.
3. While the inputisnotexhausted:
1. Let i the positioninthe dictionaryof the firstj symbolsof the bufferand k the symbol
that makesthat j can notbe larger.
2. Outputijk.
3. Inputthe nextj + 1 in the buffer.
4 TheLZ77 decoder
1. While the code-wordsijkare notexhausted:
1. Outputthe j symbolsextractedfromthe positioni inthe dictionary.
2. Outputk.
3. Introduce all the decodedsymbolsintothe buffer.
Encodingexample
Dict.Buffer Output Comment
abab cbababaaaaaa 0 0 a Emptydictionary
ababc bababaaaaaa 0 0 b b Notfound
ababcb ababaaaaaa 2 2 c ab found
a babcbaba baaaaaa 0 3 a bab found
ababc bababaaa aaa 0 2 a ba found
ababcbab abaaaaaa 2 3 a aaa found
0123
5 Decoding example
Input Output Dict.Buffer
0 0 a a a
0 0 b b ab
2 2 c abc ababc
0 3 a baba a babcbaba
0 2 a baa ababc bababaa
2 3 a aaaa ababcbabab abaaaaaa
0123
 Notice thatthe parametersI and J control the performance of the algorithm.Theyshouldbe
large enoughtoguarantee the matchingof longstrings,but shouldkeepsmall inorderto
reduce the numberof bitsof the code-wordsijk.Typical sizesare:log2(I) =12.0 and log2(J) =
4.0.
LZW compression
 LZW compression is the compression of a file into a smaller file using a table-based
lookup algorithm invented by Abraham Lempel, Jacob Ziv, and Terry Welch. Two
commonly-used file formats in which LZV compression is used are the GIF image format
served from Web sites and the TIFF image format. LZW compression is also suitable for
compressing text files.
 A particular LZW compression algorithm takes each input sequence of bits of a given
length (for example, 12 bits) and creates an entry in a table (sometimes called a
"dictionary" or "codebook") for that particular bit pattern, consisting of the pattern itself
and a shorter code. As input is read, any pattern that has been read before results in the
substitution of the shorter code, effectively compressing the total amount of input to
something smaller. Unlike earlier approaches, known as LZ77 and LZ78, the LZW
algorithm does include the look-up table of codes as part of the compressed file. The
decoding program that uncompresses the file is able to build the table itself by using the
algorithm as it processes the encoded input.
what are the issues surrounding it?
LZW (Lempel-Ziv-Welch) is a popular compression algorithm used by a number of formats,
including GIF, TIFF, PostScript, PDF, Unix Compress, and V.42bis. It is based on LZ77 and
LZ78, methods developed by Abraham Lempel and Jacob Ziv in the 1970s, and was later refined
into LZW by Terry Welch. It effectively compresses repetitive data and does so with minimal
computational overhead.
Unisys used to hold the patent for LZW, though many companies and developers, including
CompuServe, mistakenly believed it to be in the public domain. Unisys had always required
licenses from companies that used LZW in their hardware (e.g., modem manufacturers), but for
many years it overlooked LZW implementations in software. When it came to light that LZW
was used in CompuServe's GIF image format, Unisys began to require that developers pay
licensing fees for programs that could display or create GIF files. Although it did not require end
users or the creators of freeware and other non-profit software to acquire licenses, Unisys was
heavily criticized for its actions. Critics accused Unisys of trying to cash in on a format that, with
the explosive growth of the World Wide Web, had become a universal standard. Unisys has
denied these charges.
The US patentthat UnisysheldexpiredinJune 2003, and patentsinotherparts of the worldhadall
expiredbyJuly7,2004. Unisyscurrentlyholdsandhaspatentspendingonimprovementsto the LZW
compressionalgorithm

More Related Content

What's hot

Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)bolovv
 
Chapter Eight(1)
Chapter Eight(1)Chapter Eight(1)
Chapter Eight(1)bolovv
 
Introduction to Structure Programming with C++
Introduction to Structure Programming with C++Introduction to Structure Programming with C++
Introduction to Structure Programming with C++Mohamed Essam
 
Hooking signals and dumping the callstack
Hooking signals and dumping the callstackHooking signals and dumping the callstack
Hooking signals and dumping the callstackThierry Gayet
 
C programming session 08
C programming session 08C programming session 08
C programming session 08Dushmanta Nath
 
Huffman coding || Huffman Tree
Huffman coding || Huffman TreeHuffman coding || Huffman Tree
Huffman coding || Huffman TreeGurunadh Guru
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with Cgpsoft_sk
 
C programming session 05
C programming session 05C programming session 05
C programming session 05Dushmanta Nath
 
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...corehard_by
 
Huffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalHuffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalEkansh Agarwal
 
Types of pointer in C
Types of pointer in CTypes of pointer in C
Types of pointer in Crgnikate
 
1. python programming
1. python programming1. python programming
1. python programmingsreeLekha51
 
Chapter Three(1)
Chapter Three(1)Chapter Three(1)
Chapter Three(1)bolovv
 

What's hot (18)

Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)
 
Chapter Eight(1)
Chapter Eight(1)Chapter Eight(1)
Chapter Eight(1)
 
Advanced+pointers
Advanced+pointersAdvanced+pointers
Advanced+pointers
 
Introduction to Structure Programming with C++
Introduction to Structure Programming with C++Introduction to Structure Programming with C++
Introduction to Structure Programming with C++
 
Hooking signals and dumping the callstack
Hooking signals and dumping the callstackHooking signals and dumping the callstack
Hooking signals and dumping the callstack
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
Huffman coding || Huffman Tree
Huffman coding || Huffman TreeHuffman coding || Huffman Tree
Huffman coding || Huffman Tree
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with C
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...
 
Adaptive Huffman Coding
Adaptive Huffman CodingAdaptive Huffman Coding
Adaptive Huffman Coding
 
Huffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalHuffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh Agarwal
 
Types of pointer in C
Types of pointer in CTypes of pointer in C
Types of pointer in C
 
1. python programming
1. python programming1. python programming
1. python programming
 
Python revision tour II
Python revision tour IIPython revision tour II
Python revision tour II
 
Chapter Three(1)
Chapter Three(1)Chapter Three(1)
Chapter Three(1)
 

Similar to Topics:LZ77 & LZ78

Lossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDALossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDAIOSR Journals
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.pptAllamJayaPrakash
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.pptAllamJayaPrakash
 
Compression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of TradeoffsCompression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of TradeoffsDataWorks Summit
 
Compression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of TradeoffsCompression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of TradeoffsDataWorks Summit
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithmijistjournal
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithmijistjournal
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To SymbianMark Wilcox
 
FINAL PROJECT REPORT
FINAL PROJECT REPORTFINAL PROJECT REPORT
FINAL PROJECT REPORTDhrumil Shah
 
An Overview of Hadoop
An Overview of HadoopAn Overview of Hadoop
An Overview of HadoopAsif Ali
 
List the most common arguments and describe the effect of that argumen.docx
List the most common arguments and describe the effect of that argumen.docxList the most common arguments and describe the effect of that argumen.docx
List the most common arguments and describe the effect of that argumen.docxdarlened3
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascriptAndrei Sebastian Cîmpean
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesLinaro
 
Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...
Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...
Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...Sumeet Singh
 
BASIC Programming Language
BASIC Programming LanguageBASIC Programming Language
BASIC Programming LanguageJeff Valerio
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdbRoman Podoliaka
 

Similar to Topics:LZ77 & LZ78 (20)

Lossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDALossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDA
 
Chap54
Chap54Chap54
Chap54
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
Compression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of TradeoffsCompression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of Tradeoffs
 
Compression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of TradeoffsCompression Options in Hadoop - A Tale of Tradeoffs
Compression Options in Hadoop - A Tale of Tradeoffs
 
Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithm
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithm
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To Symbian
 
Lzw
LzwLzw
Lzw
 
FINAL PROJECT REPORT
FINAL PROJECT REPORTFINAL PROJECT REPORT
FINAL PROJECT REPORT
 
An Overview of Hadoop
An Overview of HadoopAn Overview of Hadoop
An Overview of Hadoop
 
List the most common arguments and describe the effect of that argumen.docx
List the most common arguments and describe the effect of that argumen.docxList the most common arguments and describe the effect of that argumen.docx
List the most common arguments and describe the effect of that argumen.docx
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascript
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
 
Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...
Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...
Hadoop Summit San Jose 2013: Compression Options in Hadoop - A Tale of Tradeo...
 
BASIC Programming Language
BASIC Programming LanguageBASIC Programming Language
BASIC Programming Language
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Vips 4mar09e
Vips 4mar09eVips 4mar09e
Vips 4mar09e
 

Recently uploaded

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Topics:LZ77 & LZ78

  • 1. Topics:LZ77 & LZ78 Lossless compression Lossless compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. By contrast, lossy compression permits reconstruction only of an approximation of the original data, though usually with improved compression rates (and therefore reduced file sizes). Lossless data compression is used in many applications. For example, it is used in the ZIP file format and in the GNU tool gzip. It is also often used as a component within lossy data compression technologies (e.g. lossless mid/side joint stereo preprocessing by MP3 encoders and other lossy audio encoders). Lossless compression is used in cases where it is important that the original and the decompressed data be identical, or where deviations from the original data would be unfavourable. Typical examples are executable programs, text documents, and source code. Some image file formats, like PNG or GIF, use only lossless compression, while others like TIFF and MNG may use either lossless or lossy methods. Lossless audio formats are most often used for archiving or production purposes, while smaller lossy audio files are typically used on portable players and in other cases where storage space is limited or exact replication of the audio is unnecessary. LZ77 and LZ78 LZ77 and LZ78 are the two lossless data compression algorithms published in papers by Abraham Lempel and Jacob Ziv in 1977[1] and 1978.[2] They are also known as LZ1 and LZ2 respectively.[3] These two algorithms form the basis for many variations including LZW, LZSS, LZMA and others. Besides their academic influence, these algorithms formed the basis of several ubiquitous compression schemes, including GIF and the DEFLATE algorithm used in PNG and ZIP.
  • 2. They are both theoretically dictionary coders. LZ77 maintains a sliding window during compression. This was later shown to be equivalent to the explicit dictionary constructed by LZ78—however, they are only equivalent when the entire data is intended to be decompressed. Since LZ77 encodes and decodes from a sliding window over previously seen characters, decompression must always start at the beginning of the input. Conceptually, LZ78 decompression could allow random access to the input if the entire dictionary were known in advance. However, in practice the dictionary is created during encoding and decoding by creating a new phrase whenever a token is output.[4] The algorithms were named an IEEE Milestone in 2004 1 History  In 1977, Jacov Zivy AbrahamLempel propose the LZ77 algorithm.  In the eighties,abranchof LZ77 knownas LZSS and isimplementedbyHaruyasuYoshizaki inthe program LHARC,discoveringthe possibilitiesof the LZ77 encoding.  Afterthat,a large numberof textcompressorshave beenbasedonthe LZ77 idea(ora variation of it).Some of the mostfamousare: ARJ,RAR,gzipand 7z. 2 FundamentalsofLZ77  LZ77 processesasequence of symbolsusingthe structure:  The dictionaryandthe look-aheadbufferhave afixedsize andcan be consideredasa sliding window,where the inputof a new symbol generatesthe outputof the oldestone,which becomesthe newestsymbolof the dictionary. 3 TheLZ77 encoder 1. Let I the lengthof the dictionaryandJ the lengthof the buffer. 2. Inputthe first J symbolsinthe buffer.
  • 3. 3. While the inputisnotexhausted: 1. Let i the positioninthe dictionaryof the firstj symbolsof the bufferand k the symbol that makesthat j can notbe larger. 2. Outputijk. 3. Inputthe nextj + 1 in the buffer. 4 TheLZ77 decoder 1. While the code-wordsijkare notexhausted: 1. Outputthe j symbolsextractedfromthe positioni inthe dictionary. 2. Outputk. 3. Introduce all the decodedsymbolsintothe buffer. Encodingexample Dict.Buffer Output Comment abab cbababaaaaaa 0 0 a Emptydictionary ababc bababaaaaaa 0 0 b b Notfound ababcb ababaaaaaa 2 2 c ab found a babcbaba baaaaaa 0 3 a bab found ababc bababaaa aaa 0 2 a ba found ababcbab abaaaaaa 2 3 a aaa found 0123 5 Decoding example Input Output Dict.Buffer 0 0 a a a 0 0 b b ab 2 2 c abc ababc 0 3 a baba a babcbaba
  • 4. 0 2 a baa ababc bababaa 2 3 a aaaa ababcbabab abaaaaaa 0123  Notice thatthe parametersI and J control the performance of the algorithm.Theyshouldbe large enoughtoguarantee the matchingof longstrings,but shouldkeepsmall inorderto reduce the numberof bitsof the code-wordsijk.Typical sizesare:log2(I) =12.0 and log2(J) = 4.0. LZW compression  LZW compression is the compression of a file into a smaller file using a table-based lookup algorithm invented by Abraham Lempel, Jacob Ziv, and Terry Welch. Two commonly-used file formats in which LZV compression is used are the GIF image format served from Web sites and the TIFF image format. LZW compression is also suitable for compressing text files.  A particular LZW compression algorithm takes each input sequence of bits of a given length (for example, 12 bits) and creates an entry in a table (sometimes called a "dictionary" or "codebook") for that particular bit pattern, consisting of the pattern itself and a shorter code. As input is read, any pattern that has been read before results in the substitution of the shorter code, effectively compressing the total amount of input to something smaller. Unlike earlier approaches, known as LZ77 and LZ78, the LZW algorithm does include the look-up table of codes as part of the compressed file. The decoding program that uncompresses the file is able to build the table itself by using the algorithm as it processes the encoded input. what are the issues surrounding it? LZW (Lempel-Ziv-Welch) is a popular compression algorithm used by a number of formats, including GIF, TIFF, PostScript, PDF, Unix Compress, and V.42bis. It is based on LZ77 and LZ78, methods developed by Abraham Lempel and Jacob Ziv in the 1970s, and was later refined into LZW by Terry Welch. It effectively compresses repetitive data and does so with minimal computational overhead.
  • 5. Unisys used to hold the patent for LZW, though many companies and developers, including CompuServe, mistakenly believed it to be in the public domain. Unisys had always required licenses from companies that used LZW in their hardware (e.g., modem manufacturers), but for many years it overlooked LZW implementations in software. When it came to light that LZW was used in CompuServe's GIF image format, Unisys began to require that developers pay licensing fees for programs that could display or create GIF files. Although it did not require end users or the creators of freeware and other non-profit software to acquire licenses, Unisys was heavily criticized for its actions. Critics accused Unisys of trying to cash in on a format that, with the explosive growth of the World Wide Web, had become a universal standard. Unisys has denied these charges. The US patentthat UnisysheldexpiredinJune 2003, and patentsinotherparts of the worldhadall expiredbyJuly7,2004. Unisyscurrentlyholdsandhaspatentspendingonimprovementsto the LZW compressionalgorithm