max encoding