[FFmpeg-devel] [PATCH] latmenc: remove dead code.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 9 17:17:43 CEST 2012

On Mon, Apr 09, 2012 at 02:26:00PM +0100, Kieran Kunhya wrote:
> > It works slightly (i.e. with some very, very special files).
> > It works better and with most samples after the other patches I sent.
> > I still will not work with any and all files, and I believe the ALS
> > code is completely and utterly broken, however I have no way to test it
> > since I don't think anything can play the resulting files anyway
> > (and I am not sure what is meant by ALS here? If it really means the ALS
> > decoder, then I think a lot of things are going wrong, since ALS in
> > loas/latm will be routed to the AAC decoder, not the ALS decoder...)
> I only ever tested it heavily with output from libavcodec's aac
> encoder. It should
> be the job of the MPEG-4 audio extradata handling code to present the data
> in the correct form. It should not be the job of the LATM encoder to
> start modifying
> the bitstream.

I don't see what that has to do with anything?
I don't know what the ALS special case is supposed to do, but it seems
to randomly mix up bit- and byte addresses (e.g. it indexes extradata
with the ctx_off bit address).
I realize that this might cause crashes so we'll have to fix that at
least, but it's a bit hard with code that in that case
1) Never did anything sensible
2) No matter how you "fix" it doesn't produce anything playable with
3) Does not even document what it _intends_ to do.

But even giving up on the ALS case issues abound: the number of
bits between the position the header parser returns and the pce
data can be variable, the code assumes it is always 3 (and
even that only after fixing it, otherwise it assumes the pce is
at the start of extradata, which is just nonsense).

Now after all that is fixed, there is the issue of bitstream
modifications, and all I did was hack the userdata stuff to work.
The only reason I did that is that testing the muxer is kind of
hard when not a single of our FATE samples actually works with it.

More information about the ffmpeg-devel mailing list