[XviD-devel] Regarding the memory alignment

Dark Sylinc dark_sylinc at yahoo.com.ar
Thu Feb 28 14:56:04 CET 2008


> And why the cache_line value is 64 and why memory
> alignment is required.

I can't explain why cache_line is 64 nor what is it
used for, but I can explain you the alignment part:
3 main reasons:
1) Accessing properly aligned memory is faster
2) XviD is cross-plattform. Some architectures causes
access violations when reading unaligned memory. (not
x86 except SSE, see below )
3) In order to use SSE, we need memory to be 16-byte
aligned. Otherwise we would need to modify every SSE
function to use the movups instruction instead of the
movaps, which is slower. (unaligned memory causes the
PRIVILEGED_INSTRUCTION error if using the movaps
instruction)

*Also other architecture-specific assembly parts may
have their own restrictions regarding memory
alignment. (PPC, IA-64,etc)

In other words, memory needs to be aligned for both
speed and stability.

Hope this helps
Dark Sylinc


      Yahoo! Encuentros.

Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! Encuentros http://yahoo.cupidovirtual.com/servlet/NewRegistration


More information about the XviD-devel mailing list