[XviD-devel] Endian Problem found

Edouard Gomez ed.gomez at free.fr
Tue Dec 23 13:33:54 CET 2003


Christoph Nägeli (chn at kbw.ch) wrote:
> With this code, the test runcs successfully. Has anyone an idea how to
> change it that it works if the  'len' isn't a multiple of 2?  And what
> if the mem is really a  uint8_t* or uint32_t* (the code above wouldn't
> work for that)?

I think the  easiest solution is simply to have a  big endian and little
endian reference values. Otherwise we'll  have to swap data according to
its type (using hton like functions)  as some tests do use uint8_t data,
others int16_t and so on, sometimes it's even a mix of both (uint8_t for
ref1/2 and int16_t for current)

As the  Makefile uses  the configure values,  you can define  Big endian
crc32 references enclosing them with:
#ifdef ARCH_IS_BIG_ENDIAN
...
#else
...
#endif

-- 
Edouard Gomez


More information about the XviD-devel mailing list