[FFmpeg-soc] [soc]: r5570 - in amr: amrnbdata.h amrnbdec.c
Colin McQuillan
m.niloc at googlemail.com
Sun Jan 10 11:11:30 CET 2010
2010/1/9 Ronald S. Bultje <rsbultje at gmail.com>:
> Hi,
>
> On Fri, Jan 8, 2010 at 10:19 PM, Vitor Sessak <vitor1001 at gmail.com> wrote:
>> I think that this is only guaranteed to work if you declare the AMRNBFrame
>> struct as packed, since the spec allows the compiler to add some padding
>> space inside structs otherwise.
>
> I'm not sure that's true (at least in practice), since practically
> AMRNBFrame is a uint16_t[]. I'd say this is OK in principle (although
> I have to go through it a little to see if this is actually easier).
>
> Ronald
I could use an extra byte for the field index (217 extra bytes of ROM
total). Then I would have the option of using offsetof.
According to the following article, old versions of the Think C
compiler would add padding to something like AMRNBSubframe (i.e.
struct { uint16_t a,b,c,d[10]; } ):
http://www.goingware.com/tips/getting-started/alignment.html
--
Colin McQuillan
More information about the FFmpeg-soc
mailing list