1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge commit '89f11f498b9c15bc71494a11a7ec560f4adf630d'

* commit '89f11f498b9c15bc71494a11a7ec560f4adf630d':
  qtrle: fix the topmost line for 1bit

Conflicts:
	tests/ref/fate/qtrle-1bit

See: 1af91978db

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-06 15:56:24 +01:00
commit 769eba75ee
2 changed files with 5 additions and 4 deletions

View File

@ -1856,7 +1856,6 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
/* XXX this shouldn't be needed, but some tests break without this line
* those decoders are buggy and need to be fixed.
* the following tests fail:
* qtrle-1bit
*/
memset(buf->base[0], 128, ret);

View File

@ -56,7 +56,7 @@ typedef struct QtrleContext {
static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
{
int rle_code;
int pixel_ptr = 0;
int pixel_ptr;
int row_inc = s->frame.linesize[0];
unsigned char pi0, pi1; /* 2 8-pixel values */
unsigned char *rgb = s->frame.data[0];
@ -70,8 +70,10 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
* See: https://ffmpeg.org/trac/ffmpeg/ticket/226
* In the following decoding loop, row_ptr will be the position of the
* _next_ row. */
lines_to_change++;
row_ptr -= row_inc;
pixel_ptr = row_ptr;
lines_to_change++;
while (lines_to_change) {
skip = bytestream2_get_byte(&s->g);
rle_code = (signed char)bytestream2_get_byte(&s->g);
@ -79,8 +81,8 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
break;
if(skip & 0x80) {
lines_to_change--;
pixel_ptr = row_ptr + 2 * (skip & 0x7f);
row_ptr += row_inc;
pixel_ptr = row_ptr + 2 * (skip & 0x7f);
} else
pixel_ptr += 2 * skip;
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */