[XviD-devel] new .asm file (dev-api-3 only)
skal
xvid-devel@xvid.org
26 Sep 2002 11:48:06 +0200
'lo Gruel
On Thu, 2002-09-26 at 11:36, Christoph Lampert wrote:
> Hi,
>
> I just saw in you ASM code:
>
> %define IMAGE_Y 0 ; Warning! these offsets reflect the IMAGE structfields.
> %define IMAGE_U 4
> %define IMAGE_V 8
>
> Somehow I have the impression that this will lead us into trouble one day,
> when nobody remembers anymore what was done... Image-structure might get a
> small modification (alpha channel?), or what if pointers become 64bit on
> x86-64?
>
> Can't this be solved somehow different?
>
this is a recurrent issue. Usually, one put the comment
on the declaration, not the code. For instance, image.h
should read:
struct IMAGE {
#pragma pack(1) // <- just to be sure the compiler behaves.
uint8_t *Y, *U, V; // WARNING! If you change this,
// change edge_mmx.asm code too !!!
};
But it's error prone, too.
The one and only safe method is to pass the
Y,U,V as arguments, i think.
Btw, talking about arguments of image_setedges(),
I've noticed 'edged_height' is unused too, just like
'interlace'.
bye,
Skal