ported working remappin from xilinx-dvi

+ test application for remapping