Version: 2008
  • On CBS MoneyWatch: Report: Tiger to Pay Wife $60 Million
Advanced Search
advertisement
advertisement
mySimon mySimon mySimon Outdoor Gear mySimon Swimwear mySimon Home and Garden

Forum display:

Home audio & video: Can someone explain Lossless

by Rollbar - 1/24/08 11:20 AM
advertisement
Post 16 of 28

Lossless and lossy compression

by larrymcg - 1/25/08 10:30 PM In reply to: Can someone explain Lossless by Rollbar

"Lossless" comes up in the context of data compression algorithms. A lossless compression algorithm allows the original data to be reconstructed exactly. A lossy algorithm allows something close the the original data to be reconstructed.

There are several compression algorithms that we run into all the time. MP3 is a lossy algorithm used to compress sound. It tries to do it in a way that the reconstructed (or uncompressed) data sounds about the same as the original. There is a tradeoff -- as the compression is increased the resulting data (and thus file size) is reduced but the difference between the original data and the uncompressed data is greater.

Another lossy algorithm we see a lot is JPEG and GIF for photos. These algorithms try to compress the data so that the reconstructed data (i.e., photo) looks "the same" as the original. Tradeoffs similar to those of MP3 apply.

Contrary to one of the other posters, there are plenty of lossless compression algorithms. One we see all the time is a ZIP file. A ZIP file is a lot smaller than the original but the reconstructed data is EXACTLY the same as the original data. Otherwise you couldn't use it to successfully compress a computer program.

--Larry

Post 17 of 28

GIF is lossless

by genotypewriter - 1/26/08 6:22 AM In reply to: Lossless and lossy compression by larrymcg

Just because GIF gives poor quality, people think it's a lossy compression format. If it was truly lossy, then everytime you save the file you should lose a bit more of data. With GIF this should not happen. GIF uses a colour palette and any "loss" is only at the initial conversion to GIF.

Post 18 of 28

aka

by froasier - 1/27/08 8:18 AM In reply to: GIF is lossless by genotypewriter

GIF is lossless for images that already have 256 or fewer colors. Otherwise it is lossy.

Post 19 of 28

More on GIF and Lossy (did we need more?)

by larrymcg - 1/27/08 8:48 AM In reply to: aka by froasier

genotypewriter is being careful to talk about the compression algorithm, not the entire process of converting a photo to a GIF. The compression algorithm is lossless. However, the conversion process involves two steps: First it processes the photo w.r.t. the palette, which can result in loss of information. Then it compresses the result of the first step.

In my original post I called GIF lossy because when you start with a photo from a digital camera, and convert it to a GIF, you generally don't get back something that looks like the original. Most people would decide, based on the visual evidence, that GIF is lossy.

I looked into Wikipedia and they call GIF lossless too. But those articles are titled Lossless Compression and Lossy Compression. In that context the GIF compression algorithm is lossless.

Have we beat this to death yet?

--Larry

Post 20 of 28

Thanks

by genotypewriter - 2/2/08 5:23 PM In reply to: More on GIF and Lossy (did we need more?) by larrymcg

Yes, any form of digital encoding leads to a loss of quality that's there. That's why some people like vinyl over audio CDs when audio CDs are also uncompressed. This does not mean the audio CD or GIF is lossless... it's just the way they encode.

Post 21 of 28

Lossless

by thanksbutnothanks - 1/26/08 7:55 AM In reply to: Can someone explain Lossless by Rollbar

Lossless compression is a type of compression algorithm that allows data to be compressed and then decompressed without losing any of the original data. The reason we compress data is to take a large file and convert it into a smaller file. Once it is compressed into a smaller file we can fit more of these compressed files onto a disc or a drive. We can also tranfer these compressed files over a network or the internet much faster.

Some types of compression alter the original data in such a way that some of the original data is lost. These are called 'lossy' compression formats. JPEG photos, MP3 audio files, and MPEG video files are some examples of lossy compression formats. Most lossy files can be opened in their compressed state. They normally don't have to be decompressed before being used. You can play MP3's with your favorite media player. JPEG photos will open in almost any photo editor or viewer.

Lossless compression formats such as Free Lossless Audio Codec (FLAC) and ZIP files usually have to be decompressed using a decompression utility before being opened for use. FLAC Frontend and WinZip can be used to decompress these files. Once they have been decompressed they should be exact copies of the original files.

Post 22 of 28

what?

by froasier - 1/27/08 8:12 AM In reply to: Lossless by thanksbutnothanks

you don't have to decompress FLAC files before playing them. the whole point of lossless audio codecs is playability--that's what differentiates them from general compression methods like zip (that and optimization for audio files, but still).

Post 23 of 28

Perspective

by roshanmani - 1/27/08 10:05 PM In reply to: Lossless by thanksbutnothanks

If the question is viewed in the perspective of audio, I've used standard rip tools that convert CD Audio into lossless formats (MP3 and WMA) that can be stored and played on a computer system. Besides the fact that these formats take a LOT of disk-space, the audio quality is as good as the original CD Audio (i.e., I haven't noticed any audible differences). I use these lossless formats only to rip and store my audio collection, from a portability perspective. So I carry my harddisk, instead of about 300 CD's.

So, are these lossless formats indeed lossless, in the perspective that the algorithms just convert from one format to another?

Post 24 of 28

Lossless v lossy

by aflockhart - 1/28/08 2:30 AM In reply to: Perspective by roshanmani

Imagine your file laid out as a long stream of letters. (In fact, when you encode a file and turn it into a sequence of bytes, that's quite close to what it is.)

A LOSSLESS compression scheme would look for patterns in this long string that can be expressed in a shorter form. So instead of "xaaaaaaaabcdddebcdbcdebcd" (length 25) it might use "x8abcdddebcdbcdebcd" (19). It might also look for patterns that turn up regularly in the string and store these in a 'lookup table' so the above might become "x8aZddeZZeZ:Z=bcd" (17). And so on, with other smarter ways to shorten the string. The storage required is getting less, but you can ALWAYS decode the short string to get back to the exact original version.

A LOSSY compression scheme is based on making an judgement/decision on what can actually be perceived in the original file. In an audio file, it might choose to lose some high frequencies that are beyond the hearing range of most people.

The equivalent in our string of characters would be to decide that - for example- "most people can't detect a single letter e in a string, so if we find one we can delete it"

Our original string then becomes "xaaaaaaaabcdddbcdbcdbcd" (23) - but we can't get back from this to the original because we have thrown away the information about where the "e"s were found.

We can take this new string and compress it further using the lossless method "x8aZddZZZ:z=bcd" (15). If we repeat the process to compress the compressed string again, we can get down to "x8aZdd3Z:z=bcd" (14).

But when we reverse the process we can only get back to the 23 letter short version of the string.

Does this matter ? Depends if you can detect the fact that there is missing data. And that depends on both the nature of the data being compressed and the way it will be accessed.

For audio: can EVERY component that you are going to use to play and listen to the file - player, amplifier, loudspeakers, your ears and your brain - reproduce or detect the difference between the lossy file and the original ? If so, then it matters. But if any component in the chain can't reproduce or detect any difference, then it doesn't matter because they are going to sound the same.

Post 25 of 28

Thanks all...

by Rollbar - 1/28/08 7:58 AM In reply to: Lossless v lossy by aflockhart

I appreciate all the help. I think I get the basics enough to have an idea what's going on.

aflockheart examples were really helpful too

Gary

Post 26 of 28

(NT) Yeah..I think aflockhart's reply is a keeper!

by ahtoi - 1/28/08 8:10 AM In reply to: Thanks all... by Rollbar

Post 27 of 28

Gary, didn't you get more detailed explanations than you

by NM_Bill - 1/28/08 10:29 AM In reply to: Thanks all... by Rollbar

probably needed?

Post 28 of 28

LOL.... I was taking the view

by Rollbar - 1/28/08 10:42 AM In reply to: Gary, didn't you get more detailed explanations than you by NM_Bill

that this must have been a topic a number of folks wanted to opine on and my question opened the door.

I got what I wanted, an idea of what the difference is in Lossy and Lossless.

The rest is for the techs to sort out I think.... lot of techs here in this forum though. :-)

Forum legend:
Locked Locked thread
Moderator Moderator
CNET staff CNET staff
Samsung staff Samsung staff
Norton Authorized Support team Norton Authorized Support team
AVG staff AVG staff
Windows Outreach team Windows Outreach team
Dell staff Dell staff
Intel staff Intel staff
Powered by Jive Software