1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/msrledec: implement vertical offset in 4-bit RLE

The delta escape (2) is supposed to work the same in 4-bit RLE as in
8-bit RLE.  This is documented in the MSDN Bitmap Compression page:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183383(v=vs.85).aspx

The unchecked modification of line is safe, since the loop condition
(line >= 0) will check it before any pixel data is written.

Fixes ticket #5153 (output now matches ImageMagick for the provided sample).

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
This commit is contained in:
Daniel Verkamp 2016-11-29 10:54:56 +01:00 committed by Paul B Mahol
parent 1e7f9b0ec6
commit e856ac2373

View File

@ -63,7 +63,7 @@ static int msrle_decode_pal4(AVCodecContext *avctx, AVFrame *pic,
stream_byte = bytestream2_get_byte(gb);
pixel_ptr += stream_byte;
stream_byte = bytestream2_get_byte(gb);
avpriv_request_sample(avctx, "Unused stream byte %X", stream_byte);
line -= stream_byte;
} else {
// copy pixels from encoded stream
odd_pixel = stream_byte & 1;