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: Bits Per Sample - Where is it located? (Read 9439 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Bits Per Sample - Where is it located?

In MP3, the bits per sample can be 8-bit or 16-bit (right? ) 

Where is this piece of information located in an MP3 file?

Bits Per Sample - Where is it located?

Reply #1
1) no
2) nowhere

The easy explanation: MP3 works totally different and doesn't care about what the bits/sample resolution of your source was.

Cheers!
SG

Bits Per Sample - Where is it located?

Reply #2
1) no
2) nowhere

The easy explanation: MP3 works totally different and doesn't care about what the bits/sample resolution of your source was.

Cheers!
SG


  Ok, what's the non-easy explanation?  How can MP3 "not care".  Doesn't the ADC care?  Surely a resolution exists...  Surely it's embedded in the mp3 somewhere...

Bits Per Sample - Where is it located?

Reply #3

1) no
2) nowhere

The easy explanation: MP3 works totally different and doesn't care about what the bits/sample resolution of your source was.

Cheers!
SG


  Ok, what's the non-easy explanation?  How can MP3 "not care".



It uses floating point, not integer numbers, and the output samples are merely floating point approximations of the original input samples.  The output resolution is literally as high as the numerical precision of your computer, encoder and decoder will allow.  Of course, this resolution is mostly just resolving quantization noise and the like.

Doesn't the ADC care?  Surely a resolution exists...  Surely it's embedded in the mp3 somewhere...


The integer resolution exists until its fed into the MP3 encoder, which operates on fp numbers.  The decoder then converts these back to integer at whatever resolution you tell it to (8, 16, 24, 32, 64, etc).  Obviously theres little point in going that high, but there no reason you can't convert those 64 bit fp numbers into whatever precision you like.

Bits Per Sample - Where is it located?

Reply #4


1) no
2) nowhere

The easy explanation: MP3 works totally different and doesn't care about what the bits/sample resolution of your source was.

Cheers!
SG


  Ok, what's the non-easy explanation?  How can MP3 "not care".



It uses floating point, not integer numbers, and the output samples are merely floating point approximations of the original input samples.  The output resolution is literally as high as the numerical precision of your computer, encoder and decoder will allow.  Of course, this resolution is mostly just resolving quantization noise and the like.

Doesn't the ADC care?  Surely a resolution exists...  Surely it's embedded in the mp3 somewhere...


The integer resolution exists until its fed into the MP3 encoder, which operates on fp numbers.  The decoder then converts these back to integer at whatever resolution you tell it to (8, 16, 24, 32, 64, etc).  Obviously theres little point in going that high, but there no reason you can't convert those 64 bit fp numbers into whatever precision you like.



Thanks a lot for the reply. 

1.  So is the recommendation for decoding to just decode at the highest possible resolution permitted by your decoder (or is there some standard for the fp<-->integer conversion)?

2.  Where is the fp number stored in the MP3 file?

3.  Does anyone know of a good resource for reading about bits per sample on any/all other codecs?

Thanks!


Bits Per Sample - Where is it located?

Reply #6
there are no "bits per sample" in MP3 and other psychacoustic lossy encoders.
In MP3 each of the 32 subbands (not all of them are in use!) allocates its individual amount of bits in each frame

Bits Per Sample - Where is it located?

Reply #7
1.  So is the recommendation for decoding to just decode at the highest possible resolution permitted by your decoder (or is there some standard for the fp<-->integer conversion)?


It doesn't matter.

2.  Where is the fp number stored in the MP3 file?


The first couple hundred bytes are the header.  The last couple hundred bytes are the file tag, the couple MB in between are your fp numbers.

3.  Does anyone know of a good resource for reading about bits per sample on any/all other codecs?


All lossy formats work like this.

Bits Per Sample - Where is it located?

Reply #8


2.  Where is the fp number stored in the MP3 file?


The first couple hundred bytes are the header.  The last couple hundred bytes are the file tag, the couple MB in between are your fp numbers.



And the fp numbers are always 64 bits each?  Are they typically this big for other lossy formats?

Thanks again!


there are no "bits per sample" in MP3 and other psychacoustic lossy encoders.
In MP3 each of the 32 subbands (not all of them are in use!) allocates its individual amount of bits in each frame


Thanks for the reply.

What is an MP3 subband?

Bits Per Sample - Where is it located?

Reply #9



2.  Where is the fp number stored in the MP3 file?


The first couple hundred bytes are the header.  The last couple hundred bytes are the file tag, the couple MB in between are your fp numbers.



And the fp numbers are always 64 bits each?  Are they typically this big for other lossy formats?



The precision is up to the decoder.  Internally, I believe mp3 applies some kind of quantization and then huffman coding.  The decoder then decodes this and requantizes back to whatever precision it likes.  Typically this will be done using 32 bit fixed or floating point.


there are no "bits per sample" in MP3 and other psychacoustic lossy encoders.
In MP3 each of the 32 subbands (not all of them are in use!) allocates its individual amount of bits in each frame


Thanks for the reply.

What is an MP3 subband?


http://en.wikipedia.org/wiki/Subband_encoding

Bits Per Sample - Where is it located?

Reply #10
Sorry, couldn't resist


 

Bits Per Sample - Where is it located?

Reply #12
Thanks for helpin' out the noob Mike.      Much appreciated.