Maximum likelihood decoding