Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 16 bits is more than enough (Read 4940 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: 16 bits is more than enough

Reply #25
Converting a 16 bits signal to 8 bits is not really a "compression".

It... literally is? By a factor of 2, in fact.

So call it a division by a factor of 256 but certainly not compression.

No, that's incorrect. If those 8 bits are still stored in 16 bits (and they're only the 8 least significant bits), then sure. But if the format has been converted from 16 bit to 8 bit (which is implied by "converting a 16 bits signal to 8 bits"), then it is compression, because it takes 50% less space.

Re: 16 bits is more than enough

Reply #26
No, that's incorrect. If those 8 bits are still stored in 16 bits (and they're only the 8 least significant bits), then sure.

It's rounded, truncated.

Quote
But if the format has been converted from 16 bit to 8 bit (which is implied by "converting a 16 bits signal to 8 bits"), then it is compression, because it takes 50% less space.

But it"s the same operation than the one above. Like a cast.



Re: 16 bits is more than enough

Reply #27
To elaborate, "usable values" means usable finite and numeric values, not range and other things, I did not mention range in the first place,

Okay !

Re: 16 bits is more than enough

Reply #28
Quote
But if the format has been converted from 16 bit to 8 bit (which is implied by "converting a 16 bits signal to 8 bits"), then it is compression, because it takes 50% less space.

But it"s the same operation than the one above. Like a cast.

Yes, and that's a very rudimentary form of lossy compression. I don't understand which part of this is controversial.

 

Re: 16 bits is more than enough

Reply #29

Yes, and that's a very rudimentary form of lossy compression. I don't understand which part of this is controversial.

But a mp3 encoder, PNG or GIF encoders,  or gzip, xz, zstd, etc.. Don't work by truncating numbers.


Re: 16 bits is more than enough

Reply #30
Yes, and that's a very rudimentary form of lossy compression. I don't understand which part of this is controversial.

But a mp3 encoder, PNG or GIF encoders,  or gzip, xz, zstd, etc.. Don't work by truncating numbers.

All of those you've listed besides MP3 perform lossless compression, so not comparable.

As for MP3: yes, it does work by truncating (usually referred to as "quantising") numbers. What do you think lossy compression is?

Re: 16 bits is more than enough

Reply #31

As for MP3: yes, it does work by truncating (usually referred to as "quantising") numbers. What do you think lossy compression is?

mp3 encoding has nothing to do with truncating numbers. Perhaps it use some kind of lossless compression (Like xz, zstd) - I have no idea - over after processing sound in its way. It's like converting a raw RGB picture file in PNG with a reduced palette. I don't call that "compression" even if the file is smaller. It's a transformation. In fact we should only use "compression" when it's lossless.




Re: 16 bits is more than enough

Reply #33
https://en.wikipedia.org/wiki/Lossy_compression
I stilll remember the days the text jokes (to early to call them "memes") went like
- "lsy cmprsn" ...
- it isn't lossy when you can recover the original
And then a punchline like Spoiler (click to show/hide)

Re: 16 bits is more than enough

Reply #34
mp3 encoding has nothing to do with truncating numbers.
Truncating numbers is fundamental to most lossy compression, including MP3. In MP3, truncation doesn't happen on individual samples - instead, a (theoretically) lossless transform is used to turn the samples into frequency components, and those components get truncated.

Perhaps it use some kind of lossless compression (Like xz, zstd) - I have no idea - over after processing sound in its way.
MP3 stores the truncated numbers using Huffman coding, which is a form of lossless compression.

It's like converting a raw RGB picture file in PNG with a reduced palette.
No, it's like saving that raw RGB picture to JPEG. In fact, JPEG makes an excellent parallel to MP3 here: in JPEG, samples are transformed into frequency components, then those components are truncated, then the truncated components are compressed with Huffman coding.

Re: 16 bits is more than enough

Reply #35
mp3 encoding has nothing to do with truncating numbers.

Incorrect.

Perhaps it use some kind of lossless compression (Like xz, zstd) - I have no idea - over after processing sound in its way.

Yes, lossless compression (as has been mentioned already - Huffman coding) is used on top of truncation/quantisation. But most of the size reduction by far comes from truncation itself.

I believe you on the "I have no idea" part, though.

It's like converting a raw RGB picture file in PNG with a reduced palette.

PNG uses a lossless compression scheme, but if you reduce the colour palette (thereby losing information) in order to achieve an even smaller file size, then that is still a form of lossy compression.

I don't call that "compression" even if the file is smaller. It's a transformation. In fact we should only use "compression" when it's lossless.

Ok, at this point the only thing I can do is to implore you to stop thinking incorrectly and start thinking correctly. Or to put it another way, to just stop being wrong. Because you're wrong.

If it will help, feel free to read the Wikipedia article on data compression. I will quote here just the first four sentences:
Quote
In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compression reduces bits by identifying and eliminating statistical redundancy. No information is lost in lossless compression. Lossy compression reduces bits by removing unnecessary or less important information.

Re: 16 bits is more than enough

Reply #36
Ok, at this point the only thing I can do is to implore you to stop thinking incorrectly and start thinking correctly. Or to put it another way, to just stop being wrong. Because you're wrong.

I'm not ! But I give up.

If you thing mp3 or jpeg simply works mainly by rounding or truncating samples so how come the result is a file size ratio of 1:10 or more? It's much more complicated !

Here my wiki link too  ;D
https://en.wikipedia.org/wiki/MP3

And I repeat myself, but something like sample=(unit8_t)sample or sample=sample&0xff are not "compression" in any way. Maybe a reduction?!  :D

Anyway, 16 bits is more than enough and that all that matters !



Re: 16 bits is more than enough

Reply #37
If you thing mp3 or jpeg simply works mainly by rounding or truncating samples so how come the result is a file size ratio of 1:10 or more? It's much more complicated !
You're getting caught up in semantics. Yes, JPEG/MP3 are much more complicated than simple truncation, but truncation is an essential part of lossy compression. The key word is "part". There are many more steps besides truncation, but truncation is still one of the steps.

Re: 16 bits is more than enough

Reply #38
Ok, at this point the only thing I can do is to implore you to stop thinking incorrectly and start thinking correctly. Or to put it another way, to just stop being wrong. Because you're wrong.

I'm not !

Incorrect.

But I give up.

Also, for some reason, unfortunately, incorrect - because quite contrary to giving up, you continued:

If you thing mp3 or jpeg simply works mainly by rounding or truncating samples so how come the result is a file size ratio of 1:10 or more? It's much more complicated !

I see you've decided to go the route of having the word "simply" do the heavy lifting instead of actually engaging your brain and thinking through what both I and everyone else has been telling you.

Yes, most of the space savings in both MP3 and JPEG actually do come from truncation/quantisation itself, but it is also true that some pre-processing is done on the raw data before the aforementioned truncation, and it is true that entropy coding is used on top of truncation to achieve even greater compression.

And I repeat myself, but something like sample=(unit8_t)sample or sample=sample&0xff are not "compression" in any way.

Yes, it is compression, because the output takes up less space than the input, and that is literally the defining characteristic of what "compression" is. For the love of God, please either understand this ridiculously simple concept, or listen to yourself and actually "give up".

Re: 16 bits is more than enough

Reply #39
If you thing mp3 or jpeg simply works mainly by rounding or truncating samples so how come the result is a file size ratio of 1:10 or more? It's much more complicated !
Because the quantification is not applied to each sample individually - and why should it, a single "sample" is just a ... sample. You don't listen to individual samples.
Signal compression works by transforming the signal into a series of components.
Lossless compression is about transformations that can fit the entire signal into less space.
Lossy compression is about (2) finding out how which and how many terms of the transformed series of components to include (discarding the rest - that is the quantification/truncation part) and (1) find a transformation that facilitates the second step.
Lossy compression also has a size/"quality" trade-off element, whereas lossless compression if found at one extreme of that consideration. Implementations trade off against computational effort as well.

Have a brief look at https://en.wikipedia.org/wiki/Discrete_cosine_transform , and then at https://en.wikipedia.org/wiki/Modified_discrete_cosine_transform .


Re: 16 bits is more than enough

Reply #41
Because the quantification is not applied to each sample individually - and why should it, a single "sample" is just a ... sample. You don't listen to individual samples.

Exactly.  See "Reply #19 – 2022-08-12 22:47:30" it all started here.

Converting a 16 bits signal to 8 bits is not really a "compression".

Quote

Have a brief look at https://en.wikipedia.org/wiki/Discrete_cosine_transform , and then at https://en.wikipedia.org/wiki/Modified_discrete_cosine_transform .

And it doesn't work with simple (uint8_t)sample16. Nowhere !



Re: 16 bits is more than enough

Reply #42
Converting a 16 bits signal to 8 bits is not really a "compression".
Yes it is.

Quote
Have a brief look at https://en.wikipedia.org/wiki/Discrete_cosine_transform , and then at https://en.wikipedia.org/wiki/Modified_discrete_cosine_transform .

And it doesn't work with simple (uint8_t)sample16. Nowhere !

And?
You were already told:
truncation doesn't happen on individual samples - instead, a (theoretically) lossless transform is used to turn the samples into frequency components, and those components get truncated.

Re: 16 bits is more than enough

Reply #43
Because the quantification is not applied to each sample individually - and why should it, a single "sample" is just a ... sample. You don't listen to individual samples.

Exactly.  See "Reply #19 – 2022-08-12 22:47:30" it all started here.

Converting a 16 bits signal to 8 bits is not really a "compression".

All right. It is a dumb lossy compression.
"dumb" either as in "stupid" - if you want to maintain fidelity, there are more efficient ways;
or
"dumb" as in "dumb phone" as a contrast to "smart phone": a primitive thing that might still be in use because it solves a specific problem.

The reason why I wrote that you "don't" perform lossy compression on each individual sample, is the "stupid" part of it, but sure it is not the only possible application: if you have a 96k/24 signal that you want to fit on a CD there is nothing stupid in using the "dumb" LPCM format that actually will do. So in that case you do. It gives you a lossy representation of the 96/24, of course.

Re: 16 bits is more than enough

Reply #44
f you have a 96k/24 signal that you want to fit on a CD there is nothing stupid in using the "dumb" LPCM format that actually will do. So in that case you do. It gives you a lossy representation of the 96/24, of course.

Yes, in that case you kind of right... 

But since that post I think one should use the word "compression" only if it lossless  ;D

Reduction, depletion, anything else than compression for mp3, jpeg & co. Because it's clearly not except for the file size. That's my next crusade !


Re: 16 bits is more than enough

Reply #45
Oh, but then take Rocinante over to the video department.

Video is nearly always compressed - lossily. But it is not uncommon among the video folks to say "lossless" for what we call "transparent", meaning it is lossy but nobody will ever see the difference.

Re: 16 bits is more than enough

Reply #46
Talking about compression, anyone have try nncp from the genius Fabrice Bellard ?

https://bellard.org/nncp/

I can't, on x86, make say: "Your CPU does not support AVX2+FMA - exiting"
on ARM: libnc.so: file not recognized.. pfff

It's text oriented but I wonder what's the effect on a wav file.





Re: 16 bits is more than enough

Reply #49
We have to re-educate each new generation (10-12 years) eh?

16 bits are already enough...

I am not sure if the grand misconceptions are "at the 17th bit". Rather I suppose that what makes the quacks rich would rather be
* Sampling rates in the six-figures - current record (?) 768k, to capture the degradation when running a 352.8 DXD through an analog tape.   Sure this is always 24 bit, but 24 bits isn't enough to impress anyone, so ... that other number must increase. (Of course the "third" number - channel count - would make an audible difference!)
* DSD. Just an impressive bit-rate and file size, but quite a useless format for audio that has been processed.
* The MQA scam. Tidal has put their CDDA FLAC streaming at mid-tier, but it touts above-CDDA to be from the "Master". Yeah they still tout bit rate, but that is now a secondary marketing spin. And MQA isn't the master, it is a lossy damn lie.
* Old fashioned gear alchemy. $10 worth of components in $100 wrapping (= painting the components black, and putting them in a low-run custom-made shiny enclosure) to sell for $1000.


(What I am waiting for is an artist to offer their 352.8/24 DXD with the explanation "I know you cannot hear the difference, but this is the file I produced on my workstation and sent off. If you kinda want what left the artist's hand, then this is it."
Optionally "For an extra charge, I can downconvert it for you and add a signed PDF saying 'This file created from DXD on the orders of [your name]'." More honest than selling the bitrate itself.)