[FFmpeg-devel] [PATCH] DVB LATM parser

Paul Kendall paul
Fri Jul 4 02:51:35 CEST 2008


On Friday 04 July 2008 01:52:37 Robert Swain wrote:
> 2008/7/3 Paul Kendall <paul at kcbbs.gen.nz>:
> > Hi attached is a patch that provides a AAC LATM parser CODEC_ID_AAC_LATM
> > I have been working on. The libfaad decoder is also patched to provide
> > another codec the decoding for this codec id. There are minor patches to
> > mpeg.c & mpegts.c to send stream id 0x11 to this codec id.
> >
> > With this patch I can get audio working perfectly for NZ DVB-T using the
> > stock unpatched libfaad2 library.
> >
> > I would welcome comments and suggestions so this can be included in the
> > ffmpeg codebase.
>
> I know you're probably aware of some of these comments and I'll let
> someone more experienced/knowledgeable comment but I have a few
> comments of my own which they and you may wish to consider:
>
> - I don't think it should be implemented as a codec but rather as a
> bitstream parser or demuxer as appropriate. I need to reread the spec
> for LATM but at the moment I'm not sure if generic LATM can handle
> multiple audio streams. I understand the DVB implementation only uses
> one. If it can use more then ideally they should be presentable in the
> output of `ffmpeg -i infile` like other streams. This may decide
> whether a bitstream parser or demuxer is better.

I have written it as a parser. It is also specifically for DVB, so it only 
handles 1 stream. If I extend it later to handle multiple streams I will 
certainly look at writing it as a demuxer.

>
> - I suspect some of the functions (GASpecificConfig,
> AudioSpecificConfig, etc) should be shared. Some may exist in our own
> AAC decoder (not yet in SVN, only in SoC SVN so you can't be held
> accountable for not coding with this in mind :)) and others in
> libavcodec/aac_parser.c, libavcodec/mpeg4audio.c or so. It would
> probably be better to add the LATM functionality to what we have than
> to duplicate these functions with slight alterations for LATM.

The parser is purely LATM and really doesn't know anything about AAC, so it 
can be used for other embedded audio types. All you would have to do is to 
add another descriptor.

What's the GSoC project url? I will take a look at it and see if I can share 
some of the structures.

>
> - Is using get_bits and put_bits the best approach for this? It seems
> a little weird to me to parse the stream, rewrite it, then parse it
> again but maybe this is best.
>
The parser completely removes the LATM wrapping, so just the raw audio stream 
is sent to the decoder, so no duplicate parsing involved.

> Regards,
> Rob

Cheers,
Paul




More information about the ffmpeg-devel mailing list