- Use macros for reading 2 byte or 4 byte big endian data. block_size is assumed to be < 64K so WRITE_DWORD_BE_A will write two leading zeros. - Scalar pass by value parameters don't need to be const. - Remove some unnecessary locals.