LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 01-01-2007, 11:42 AM   #1
kpachopoulos
Member
 
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 704

Rep: Reputation: 30
lzw example on binary data resources


Hi,
i have found plenty of examples for how LZW works on String input, but none for how it works on binary data. Can anyone post any links?

Thanks
 
Old 01-01-2007, 12:33 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,536

Rep: Reputation: 148Reputation: 148
It's more or less the same, depending on the data internal structure. An implementation working on string also works for any other file content. GIF format is an example of LZW usage for binary data.
 
Old 01-01-2007, 07:53 PM   #3
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,358

Rep: Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106
Algorithms such as LZW neither know nor care what the data to be compressed "means to you." (Computers can't read.)

It is a provable fact, of course, that text is much more compressible than binary data simply because text has much more redundancy (at the bitwise level). A typical file of English text, for instance, uses only a fraction (26+26+20 or so) of the 256 possible values of "a byte," which realistically means that only 6/8'ths of the bandwidth is being used under worst-case conditions. With binary data, the probability is much greater that most of the 256 possible values are being used. That is to say, within any given block of (say) 4096*8 bits, there aren't too many usefully-repeated groups of bits.

File-compression basically works by identifying repeated groups of bits, within a window of data of some length, and replacing them with a single (bitwise) code...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing binary data in MySQL take 2 drspin Programming 5 05-05-2006 03:26 PM
Sockets and Binary data oulevon Programming 3 04-06-2006 04:35 AM
writing binary data via the shell? zero79 Programming 3 03-04-2006 11:35 AM
Python DCOP (KDE) and binary data carl.waldbieser Programming 0 12-22-2005 03:02 PM
recording raw binary data as an MP3 uman Linux - General 1 02-19-2005 09:07 PM


All times are GMT -5. The time now is 01:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration