Re: [MP3 ENCODER] MP3 bitstream

2001-12-05 Thread Gabriel Bouvigne

 1. The ISO 11172-3 standard says that the number of samples in layer 3
 should be 1152. When I encode a single channel file lame sets the
framesize
 as 576. Is this an error or does the standard specify the size for dual
 channel audio?

It seems that you are encoding MPEG-2 frames. Those frames have only 1
granule, so they are only 576 samples. The sample rate of MPEG-2 is half the
MPEG-1 sample rate.

Regards,


Gabriel Bouvigne
www.mp3-tech.org
___
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder



Re: [MP3 ENCODER] MP3 bitstream

2001-12-04 Thread Rob Leslie

Manoj Palki wrote:
 1. The ISO 11172-3 standard says that the number of samples in layer 3
 should be 1152. When I encode a single channel file lame sets the framesize
 as 576. Is this an error or does the standard specify the size for dual
 channel audio?

I will assume that by framesize you mean samples per frame and not bytes per
frame. The number of samples per frame depends on the layer and the sampling
frequency.

Here are the number of samples per frame (per channel) for MPEG-1, MPEG-2 LSF,
and MPEG 2.5:

Sample Rate  |  48000   24000   12000
 |  44100   22050   11025
 |  32000   160008000
-+---
Layer I  |384 384 384
Layer II |   115211521152
Layer III|   1152 576 576

 2. The framelength as specified in the standard is determined by the formula
 '144*bitrate/samplerate' . But the distance between two frame headers in the
 lame encoded bitstream is half of the value given by the formula. 

Are you calculating with the correct sample rate? The ID bit in the frame
header is needed to distinguish MPEG-1 and MPEG-2 LSF. Also, the last bit of
the syncword is used to indicate MPEG 2.5. For Layer III MPEG-2 LSF and MPEG
2.5, you should use the constant 72 instead of 144.

 3. I am a little confused by the difference between a frame and an audio
 frame. Does the information between two headers correspond to exactly 1152
 samples or can this contain data about less/more samples.

The audio data which logically belongs to a single frame always produces the
number of samples indicated above. In Layer I and Layer II, this audio data is
always contained between two frame headers.

In Layer III, the audio data belonging to a single frame may begin _before_
the frame's header, and extend until the beginning of the next frame's audio
data, wherever that is, but not further than the next frame's header. In some
cases it is possible for the audio data of a Layer III frame to precede the
frame header by several frame lengths, but no more than 512 bytes (MPEG-1) or
256 bytes (MPEG-2 LSF and MPEG 2.5), not counting the size of preceding frame
headers and side information. The size (in bytes) of the audio data for a
Layer III frame may therefore vary from frame to frame, but the resulting
number of PCM samples is always the same.

-- 
Rob Leslie
[EMAIL PROTECTED]
___
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder