(Until something more AviSynth related can be written this is from the AMDOptimizationGuide)
In general, avoid misaligned data references. All data whose size is a power of two is considered aligned if it is naturally aligned.
For example:
In AviSynth each frame is most of the time aligned to an address divideable by 16. The exception for this rule is when crop() has been used. Furthermore each line is also most of the time aligned to an address divideable by 16 (or 8 for planar chroma).
Whenever some data is written to memory it is put in the cache. It is however possible for the processor to access this data quite fast after it has been written. This is called Store To Load forwarding.
Avoid memory-size mismatches when different instructions operate on the same data. When an instruction stores and another instruction reloads the same data, keep their operands aligned and keep the loads/stores of each operand the same size.
The following code examples result in a store-to-loadforwarding (STLF) stall:
Example (avoid):
Example (preferred):
Example (avoid):
Example (preferred):
$Date: 2006/11/24 18:21:26 $
Original version of this document at http://www.avisynth.org/DataAlignment