```python
def encode_list(list1):
    """
    Performs run-length encoding on a list.

    Args:
        list1: The input list to be encoded.

    Returns:
        A list of lists, where each inner list contains an element
        and its consecutive count.
    """
    if not list1:
        return []

    encoded_list = []
    current_element = list1[0]
    count = 1

    for next_element in list1[1:]:
        if next_element == current_element:
            count += 1
        else:
            encoded_list.append([current_element, count])
            current_element = next_element
            count = 1
    
    encoded_list.append([current_element, count])
    
    return encoded_list
```