### 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 8044 times)
0 Members and 1 Guest are viewing this topic.

## Re: 16 bits is more than enough

##### Reply #25 – 2022-08-13 18:13:06
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 – 2022-08-13 19:21:58
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 – 2022-08-13 19:26:07
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 – 2022-08-13 23:28:32
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 – 2022-08-14 00:46:45

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 – 2022-08-14 03:22:39
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 – 2022-08-14 20:03:14

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 – 2022-08-14 21:04:09
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 – 2022-08-14 22:46:14
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 – 2022-08-14 23:35:55
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 – 2022-08-15 03:03:55
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 !

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?!

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

## Re: 16 bits is more than enough

##### Reply #37 – 2022-08-15 04:34:29
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 – 2022-08-15 06:21:06
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 – 2022-08-15 07:34: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 !
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 #40 – 2022-08-15 07:52:18
https://youtu.be/Kv1Hiv3ox8I

## Re: 16 bits is more than enough

##### Reply #41 – 2022-08-15 16:11:01
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 – 2022-08-15 16:38:44
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?
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 – 2022-08-15 17:05:54
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 – 2022-08-15 20:19:04
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

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 – 2022-08-15 20:30:31
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 – 2022-08-15 20:33:02
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 #48 – 2022-08-16 11:51:52
We have to re-educate each new generation (10-12 years) eh?

16 bits are already enough... and if there are golden ears who pass ABX versus 24 bits, there is then no way for them to clear noise-shaped dithered 16 bits.

https://xiph.org/video/vid2.shtml --  select the bit depth chapter.

## Re: 16 bits is more than enough

##### Reply #49 – 2022-08-16 12:22:49
We have to re-educate each new generation (10-12 years) eh?