this is working cnc-ddraw for Dune 2000:
https://github.com/CnCNet
this is instruction on Russian but you can use page google translator:
https://rutracker.net/forum/viewtopic.php?p=78507608#78507608
the algorithm xbrz-freescale looks like is the best.