# HG changeset patch # User bcoudurier # Date 1243058129 0 # Node ID 9447a746f2cbe905209f552bad8c24a6e5a67cc3 # Parent cc0380d2bbc378a2c478fc2cded384f5989ca04d fix qtrle encoding when previous frame linesize differs, fix #998 diff -r cc0380d2bbc3 -r 9447a746f2cb qtrleenc.c --- a/qtrleenc.c Sat May 23 01:22:43 2009 +0000 +++ b/qtrleenc.c Sat May 23 05:55:29 2009 +0000 @@ -126,8 +126,10 @@ int temp_cost; int j; - uint8_t *this_line = p-> data[0] + line*p->linesize[0] + (width - 1)*s->pixel_size; - uint8_t *prev_line = s->previous_frame.data[0] + line*p->linesize[0] + (width - 1)*s->pixel_size; + uint8_t *this_line = p-> data[0] + line*p-> linesize[0] + + (width - 1)*s->pixel_size; + uint8_t *prev_line = s->previous_frame.data[0] + line*s->previous_frame.linesize[0] + + (width - 1)*s->pixel_size; s->length_table[width] = 0; skipcount = 0; @@ -239,16 +241,17 @@ uint8_t *orig_buf = buf; if (!s->frame.key_frame) { + unsigned line_size = s->avctx->width * s->pixel_size; for (start_line = 0; start_line < s->avctx->height; start_line++) if (memcmp(p->data[0] + start_line*p->linesize[0], - s->previous_frame.data[0] + start_line*p->linesize[0], - p->linesize[0])) + s->previous_frame.data[0] + start_line*s->previous_frame.linesize[0], + line_size)) break; for (end_line=s->avctx->height; end_line > start_line; end_line--) if (memcmp(p->data[0] + (end_line - 1)*p->linesize[0], - s->previous_frame.data[0] + (end_line - 1)*p->linesize[0], - p->linesize[0])) + s->previous_frame.data[0] + (end_line - 1)*s->previous_frame.linesize[0], + line_size)) break; }