#define PACK_TWO_PIXELS(l,r) ((r<<16) | l)
#define PACK_NEED_ALIGNMENT(ptr) (((int)(ptr))&3)
#define WRITE_TWO_PIXELS(addr, pixels) do { \
((INT16*)(addr))[0] = (pixels); \
((INT16*)(addr))[1] = (pixels)>>16; \
} while(0)
#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(INT32*)(addr)) = pixels
有人可以解释 WRITE_TWO_PIXELS 和 WRITE_TWO_ALIGNED_PIXELS 之间的区别吗?如果像素是分配uint32_t和addr & 3 == 0的堆栈,它们不应该是等价的吗?
谢谢。