Log in

View Full Version : MPEG1 layer II Mode and Mode extension bits


epitaxial
5th October 2011, 22:26
Can someone please explain the purpose and use of the mode and mode extension bits as used in MPEG1 Layer II audio coding?

Many thanks.

Guest
5th October 2011, 23:00
It's in the MPEG1 audio spec:

mode - Indicates the mode according to the following table. In Layer I and II the joint_stereo mode is intensity_stereo, in Layer III it is intensity_stereo and/or ms_stereo.

'00' stereo
'01' joint_stereo (intensity_stereo and/or ms_stereo)
'10' dual_channel
'11' single_channel

mode_extension - these bits are used in joint_stereo mode. In Layer I and II they indicate which subbands are in intensity_stereo. All other subbands are coded in stereo.

'00' subbands 4-31 in intensity_stereo, bound==4
'01' subbands 8-31 in intensity_stereo, bound==8
'10' subbands 12-31 in intensity_stereo, bound==12
'11' subbands 16-31 in intensity_stereo, bound==16

In Layer III they indicate which type of joint stereo coding method is applied. The frequency ranges over which the intensity_stereo and ms_stereo modes are applied are implicit in the algorithm. For more information see 2.4.3.4.

value intensity_stereo ms_stereo
'00' off off
'01' on off
'10' off on
'11' on on

epitaxial
6th October 2011, 18:52
Thanks for the reply. My question (not clearly stated) is less about what the standards say and more about how the coder uses these fields.

I have a bit stream where the mode changes at some point from stereo to joint-stereo and I am curious as to whether this is correct (standards wise) and if so what decision did the coder make to affect this change.

Seems to me that the mode-ext is ignored when the mode is stereo and per the standard -

"The mode-extension bits set the ‘bound’ as shown in 2.4.2.3 and thus indicate which subbands are coded in joint-stereo mode."

In joint stereo the ext bits are used.

Greg

LoRd_MuldeR
6th October 2011, 21:31
Thanks for the reply. My question (not clearly stated) is less about what the standards say and more about how the coder uses these fields.

I have a bit stream where the mode changes at some point from stereo to joint-stereo and I am curious as to whether this is correct (standards wise) and if so what decision did the coder make to affect this change.

Well, I think it's up to the individual encoder to chose the channel mode.

The standard only defines the bitstream syntax, but it doesn't define exact rules on how to convert an arbitrary input audio to such a bitstream.

It's the encoder's job to convert the individual input audio into a valid compressed bitstream. And every encoder uses it's own algorithms, heuristics, psy models and so on.

A "dumb" encoder would probably use a fixed channel mode, while a more sophisticated one will analyze the audio first and then pick the "optimal" mode.

The LAME encoder, e.g., offers "joint stereo" and "forced joint stereo" modes. The former selects the mode on a frame basis, the latter uses MS joint stereo on all frames.

Seems to me that the mode-ext is ignored when the mode is stereo and per the standard

Indeed, looks like these bits apply to Joint Stereo mode only.