https://github.com/ultravideo/kvazaar/tree/master/src
http://ultravideo.cs.tut.fi/#encoder
The code looks clean, builds on all platforms.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1015