[FFmpeg-devel] MPEG Audio encoding

John Sigler linux.kernel
Fri Jan 25 14:34:32 CET 2008

Michael Niedermayer wrote:

> On Fri, Jan 25, 2008 at 10:51:13AM +0100, John Sigler wrote:
>> [ This message was originally posted to ffmpeg-user ]
> you want to send a patch? if not its the wrong list ...

Are you saying that asking whether a feature is implemented in
libavcodec is off-topic here? I would think that, before writing
a patch implementing a specific feature, one would need to make
sure that this feature had not already been implemented, no?

>> I have a few questions concerning the MPEG Audio encoder in ffmpeg.
>> ( mpegaudioenc.c )
>> (I've been reading the corresponding Wikipedia articles.)
>> http://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_I
>> http://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_II
>> AFAICT mpegaudioenc.c implements MPEG-2 Layer II (i.e. MP2).
>> Is there support for MPEG Audio Layer I in libavcodec?
> why do you want "mp1" ?

I didn't say I wanted mp1, I am asking whether the current code
implements layer I. (I don't think so, but I could be wrong.)

> [...]

In the snipped part, I forgot to ask whether the current code
implements both MPEG-1 layer II and MPEG-2 layer II. (I think
so, but I could be wrong.)

>> On a related subject, the Wikipedia article states:
>> The format is based on successive digital frames of 1152 sampling
>> intervals with four possible formats:
>>      * mono format
>>      * stereo format
>>      * joint stereo format (stereo irrelevance)
>>      * dual channel (uncorrelated) format
>> http://en.wikipedia.org/wiki/Joint_stereo
>> And mpegaudio.h defines
>> #define MPA_STEREO  0
>> #define MPA_JSTEREO 1
>> #define MPA_DUAL    2
>> #define MPA_MONO    3
>> But joint stereo and dual mono do not seem (??) to be supported by
>> the encoder. Is that correct?
> could be, if so send a patch implementing them!

I'm trying to determine the state of the current (MP2) code. I spent
several hours reading it, to get a preliminary general understanding
of it. I was hoping that a helpful developer would accept to share
some clues to help speed up the learning process. (That developer
does not have to be you if you do not feel like wasting your time
on me.)

>> Were joint stereo and dual mono actually defined for Layer II,
>> or did they only show up later in Layer III?
> greping the draft ...
> "Joint Stereo coding can be added as an additional feature to any of
> the layers."

Thanks for the information.

> I suggest you read it yourself next time instead of asking. You will
> have to read it anyway to implement it and send a patch.

I concede that my last question was trivial, and that I should
have anticipated that it would elicit an RTFM from a belligerent
respondent. I grabbed 13818-3, and will try to educate myself.

In the mean time, could someone in a better disposition comment
on the current implementation? Specifically, does the encoder
support joint stereo (M/S stereo coding AFAIU) and dual mono
(whatever that is)?


More information about the ffmpeg-devel mailing list