Help - Search - Members - Calendar
Full Version: Bits Per Sample - Where is it located?
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
ea1776
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?
SebastianG
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
ea1776
QUOTE(SebastianG @ Apr 27 2007, 12:34) *

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


wink.gif 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...
Mike Giacomelli
QUOTE(ea1776 @ Apr 27 2007, 11:18) *

QUOTE(SebastianG @ Apr 27 2007, 12:34) *

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


wink.gif 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.

QUOTE(ea1776 @ Apr 27 2007, 11:18) *

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.
ea1776
QUOTE(Mike Giacomelli @ Apr 27 2007, 13:50) *

QUOTE(ea1776 @ Apr 27 2007, 11:18) *

QUOTE(SebastianG @ Apr 27 2007, 12:34) *

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


wink.gif 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.

QUOTE(ea1776 @ Apr 27 2007, 11:18) *

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!
Sebastian Mares
1) Use whatever your soundcard supports. No need to use 64 bits when your soundcard supports only 24 bits.

2) Nowhere.
Sunhillow
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
Mike Giacomelli
QUOTE(ea1776 @ Apr 27 2007, 12:04) *


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.

QUOTE(ea1776 @ Apr 27 2007, 12:04) *

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.

QUOTE(ea1776 @ Apr 27 2007, 12:04) *

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.
ea1776
QUOTE(Mike Giacomelli @ Apr 27 2007, 16:42) *

QUOTE(ea1776 @ Apr 27 2007, 12:04) *


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!


QUOTE(Sunhillow @ Apr 27 2007, 14:52) *

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?
Mike Giacomelli
QUOTE(ea1776 @ May 2 2007, 09:59) *

QUOTE(Mike Giacomelli @ Apr 27 2007, 16:42) *

QUOTE(ea1776 @ Apr 27 2007, 12:04) *


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.

QUOTE(ea1776 @ May 2 2007, 09:59) *

QUOTE(Sunhillow @ Apr 27 2007, 14:52) *

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
PiezoTransducer
Sorry, couldn't resist
IPB Image
ea1776
QUOTE(PiezoTransducer @ May 2 2007, 13:47) *

Sorry, couldn't resist
IPB Image


Very funny. dry.gif
ea1776
Thanks for helpin' out the noob Mike. smile.gif Much appreciated.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.