[Ffmpeg-devel] [PATCH] Chinese AVS video decoder

Måns Rullgård mru
Tue Jul 4 21:35:40 CEST 2006


Rich Felker <dalias at aerifal.cx> writes:

> On Sun, Jul 02, 2006 at 12:36:26AM +0100, M?ns Rullg?rd wrote:
>> Some comments based on discussions on IRC and other observations.
>> 
>> > +typedef struct {
>> > +    int16_t x;
>> > +    int16_t y;
>> > +    int16_t dist;
>> > +    int16_t ref;
>> > +} vector_t;
>> 
>> If this is marked with __attribute__((align(8))) gcc will be able to
>> read/write the entire thing with one instruction on 64-bit machines.
>
> Maybe you think this is ugly, but what about the standard way, making
> it a union and also including an int64_t member?

Did you intend to also access it using the int64_t member after
writing to the int16_t parts?  That invokes undefined behavior.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list