Thanks for the comparison, it's easier to see the accuracy difference between ColorSpace and avsresize.
zlib is known to employ "shortcuts" for performance reasons (
link).
As you can see from the code I use higher precision floats, be it for gamut transformation matrices, YUV<->RGB coefficients or D65 illuminant (0.312713, 0.329016) in my case.
Currently I'm on the development of the fast-mode, looking forward to reach at least 100fps for gamut conversion. As for the gamma conversion process currently ColorSpace() is 60% faster than avsresize