new feature: the script can choose the best encoding between 7bit and 16bit automatically