The current VNC code base is not very flexible for doing more CODEC agnostic things like lossless refresh or dynamically changing CODEC based on available bandwidth, CPU and characteristics of the input framebuffer. So before we can start any of those projects, we first need to refactor things into something more sane.
I severely underestimated how much cleanup was necessary. I think most of it is done now, but there is still much left to do and test that nothing has been broken.
Finally done and the work has been announced on the tigervnc-devel mailing list.
Nothing has been committed though. We'll do that on bug 5026.
The work is available on github, in case I somehow lose it: