XSUB is the subtitle format used in DivX 6 files.
Each packet consists of a header and after that RLE-encoded data.
The header starts with timing information in the format (27 bytes, no terminating zero):

width of encoded image
height of encoded image
x coordinate of top left subtitle corner
y coordinate of top left subtitle corner
x coordinate of bottom right subtitle corner
y coordinate of bottom right subtitle corner
length of the RLE data
four color entries (red, green, blue, eight bits per component, unsigned)

Width, height and coordinates probably all must be a multiple of 2.
It is unclear what the behavior is if the coordinates are not consistent with width and height, the encoder does not produce such files.

After this follows the RLE-encoded data.

This is processed 4 bits at a time, big-endian bitstream order (lowest byte address first, within that byte highest bits first).

Encoding is n bits run-length followed by 2 bits color (index into four color palette in header), where n can be 2, 6, 10, or 14 (yes, it is a very weird and probably suboptimal encoding).