[FFmpeg-devel] [PATCH] code to parse mpeg4audio extradata
Baptiste Coudurier
baptiste.coudurier
Mon Mar 31 00:41:08 CEST 2008
Hi,
Michael Niedermayer wrote:
> On Wed, Mar 19, 2008 at 04:54:03PM +0100, Baptiste Coudurier wrote:
>> Hi,
>>
>> Here is a patch that adds parsing of mpeg4audio extradata, and retrieve
>> needed infos for decoders (only mp3on4 atm, but will be needed for aac),
>> and will be used by mov demuxer ideally to correctly compute sample rate
>> and channels.
>> Also extract common mpeg4audio code from aac_parser.c.
>
> [...]
>
>> Index: libavcodec/mpegaudiodec.c
>> ===================================================================
>> --- libavcodec/mpegaudiodec.c (revision 12503)
>> +++ libavcodec/mpegaudiodec.c (working copy)
>> @@ -2486,9 +2486,11 @@
>> #endif /* CONFIG_MP3ADU_DECODER */
>>
>> #ifdef CONFIG_MP3ON4_DECODER
>> +
>> +#include "mpeg4audio.h"
>> +
>> /* Next 3 arrays are indexed by channel config number (passed via codecdata) */
>> -static int mp3Frames[16] = {0,1,1,2,3,3,4,5,2}; /* number of mp3 decoder instances */
>> -static int mp3Channels[16] = {0,1,2,3,4,5,6,8,4}; /* total output channels */
>> +static const uint8_t mp3_frames[8] = {0,1,1,2,3,3,4,5}; /* number of mp3 decoder instances */
>
> seperate commit and why does the 2 at the end disapear?
>
Yes, of course. I'll post an updated patch for mp3on4 decoder anyway.
It disappears because this last configuration is not mentioned anymore
in published specs. It was in old draft, and I expect/hope nobody ever
used it.
> [...]
>
> This either needs a function ptr as a argument for parsing codec
specific stuff
> or return some ptr / bitindex to where that is stored. Later is more flexible
> for example with a binary decoder which expects a pointer to this stuff.
>
I like the idea of bitindex. Updated patch attached.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A. http://www.smartjog.com
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpeg4audio.patch
Type: text/x-diff
Size: 5332 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080331/b333093c/attachment.patch>
More information about the ffmpeg-devel
mailing list