tegra_swizzle is an unofficial CPU implementation for Tegra X1 surface swizzling. The library provides functions for converting between the Tegra X1's optimized memory layout and standard row-major ordering.
See the ffi module in the docs for documentation.