complete of common decode and encode