reorder bswap functions into bit-depth, special-casing inside the functions.