generic depth unpacker, see #1
remove mode debugging