Arithmetic encoding