[MPlayer-dev-eng] decoding of MS-RLE in 4-bit is buggy

Michael Günnewig MichaelGuennewig at gmx.de
Fri Jun 13 20:13:46 CEST 2003


Hallo.

The decoding of Microsoft-RLE in 4-bit doesn't work correctly under
all circumstances. As described at 

  http://www.pcisys.net/~melanson/codecs/msrle.txt

must the code be aligned at a word-boundary when in absolute mode. I
have an AVI file which decodes correctly under Windows. The
problematic segment is the following (in hex):

  00 09 77 70 78 88 80 00 3A 88 00 08 77 07 7F FF 29 FF 00 00

This code results that the variable rle_code will be 9 / 2, which will
be 4. This will decode the next 4 bytes into the corresponding 8
pixels. The 9th pixel will be interpreted by mplayer as an
encoded-code-segment instead of be a pixel with pal-index 9 (and skip
the 0 in the lsb) and an extra-byte for alignment. This results in
very strange decoded frames and warning-messages about violated
boundaries:

  MS RLE: stream ptr just went out of bounds (1)

The fix would be to round up the computation of rle_code and leave the
for-loop in the middle when rounded up, or? But my problem is, that is
won't solve the distorted frames. Any hints?

The problematic AVI file (60 kB size) is available at:
  http://ls6-www.cs.uni-dortmund.de/~guennewi/mplayer-msrle-4bit.avi


  Michael




More information about the MPlayer-dev-eng mailing list