this should be part of adpcm.c