[MPlayer-dev-eng] decoding of MS-RLE in 4-bit is buggy
Michael Günnewig
MichaelGuennewig at gmx.de
Tue Jun 17 23:08:52 CEST 2003
Roberto Togni <r_togni at libero.it> writes:
> On 2003.06.13 20:13 Michael Günnewig wrote:
>> 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.
...
> There are at least two problems:
> - the extra_byte flag needs to be computed on stream_byte, not on
> rle_code (it must be done on byte count, not on nibble count). To be
> exact, ytou have an extra byte if (stream_byte/2 + stream_byte%2) is
> odd
...
> But it doesn't work!
Okay, I have it.
rle_code = ((stream_byte + 1) & (~1)) / 2; // same as yours
extra_byte = (stream_byte / 2) & 0x01 || (stream_byte % 2);
extra_byte is wrong comparing to spec (see above), but Windows decodes
it correct -- very strange. Will generate some very stupid
test-patterns and look at the results of Windows decoder. I'm very
interested in the results.
Michael Günnewig
More information about the MPlayer-dev-eng
mailing list