Quote:
Originally Posted by

**reddragon**

does that have anything to do with "upsampling"?

Data compression and upsampling are definitively two different things. Upsampling can be used to simplify the analog part of the DAC, at the expense of making the digital a bit more complicated. A bit of a different story.

One way to achieve lossless compression is through Huffman coding (among other more elaborate and powerful techniques.) Consider a pretty stream of 1's and 0's:

001011100000000011010001000000110000

Let's take this stream for a date. Get acquainted by breaking the stream into pairs of 1's and 0's:

00-10-11-10-00-00-00-00-11-01-00-01-00-00-00-11-00-00

After first impressions, the first thing that comes to our attention is that this beautiful stream of bits is actually hollow and superficial. Too many 0's there. Lets replace the pairs of 1's and 0's by sequences of different sizes according to the following rule:

00 => 1

11 => 01

01 => 001

10 => 000

Note that less bits will be assigned to the pairs of bits that happen more often. Fondle this stream by substituting pairs of 1's and 0's using the above rule:

1-000-01-000-1-1-1-1-01-001-1-001-1-1-1-01-1-1

So, we went from:

001011100000000011010001000000110000 (36 bits)

to

10000100011110100110011110111 (29 bits)

Our 1's and 0's stream dropped 7 bits of clothes, and is now bit naked.

We scored. Lets be nice and help the bit stream cover up. We go from left to right. Found 3 consecutive zeros? Substitute with 10. Found 2 consecutive zeros and 1 one? Substitute with 01. Found 1 zero and 1 one? Substitute with 01. Found no zeros and 1 one? Substitute with 00.

I think this is right in a weird kind of way.