Revision 5b8ebb3f
libavcodec/interplayvideo.c | ||
---|---|---|
87 | 87 |
static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y) |
88 | 88 |
{ |
89 | 89 |
int current_offset = s->pixel_ptr - s->current_frame.data[0]; |
90 |
int motion_offset = current_offset + delta_y * s->current_frame.linesize[0] + delta_x * (1 + s->is_16bpp); |
|
90 |
int motion_offset = current_offset + delta_y * s->current_frame.linesize[0] |
|
91 |
+ delta_x * (1 + s->is_16bpp); |
|
91 | 92 |
if (motion_offset < 0) { |
92 | 93 |
av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); |
93 | 94 |
return -1; |
... | ... | |
96 | 97 |
motion_offset, s->upper_motion_limit_offset); |
97 | 98 |
return -1; |
98 | 99 |
} |
99 |
s->dsp.put_pixels_tab[!s->is_16bpp][0](s->pixel_ptr, src->data[0] + motion_offset, s->current_frame.linesize[0], 8); |
|
100 |
s->dsp.put_pixels_tab[!s->is_16bpp][0](s->pixel_ptr, src->data[0] + motion_offset, |
|
101 |
s->current_frame.linesize[0], 8); |
|
100 | 102 |
return 0; |
101 | 103 |
} |
102 | 104 |
|
... | ... | |
577 | 579 |
frame++; |
578 | 580 |
|
579 | 581 |
if (!s->is_16bpp) { |
580 |
/* this is PAL8, so make the palette available */ |
|
581 |
memcpy(s->current_frame.data[1], s->avctx->palctrl->palette, PALETTE_COUNT * 4); |
|
582 |
/* this is PAL8, so make the palette available */
|
|
583 |
memcpy(s->current_frame.data[1], s->avctx->palctrl->palette, PALETTE_COUNT * 4);
|
|
582 | 584 |
|
583 |
s->stride = s->current_frame.linesize[0]; |
|
584 |
s->stream_ptr = s->buf + 14; /* data starts 14 bytes in */ |
|
585 |
s->stream_end = s->buf + s->size; |
|
585 |
s->stride = s->current_frame.linesize[0];
|
|
586 |
s->stream_ptr = s->buf + 14; /* data starts 14 bytes in */
|
|
587 |
s->stream_end = s->buf + s->size;
|
|
586 | 588 |
} else { |
587 | 589 |
s->stride = s->current_frame.linesize[0] >> 1; |
588 | 590 |
} |
589 | 591 |
s->line_inc = s->stride - 8; |
590 | 592 |
s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride |
591 |
+ (s->avctx->width - 8) * (1 + s->is_16bpp); |
|
593 |
+ (s->avctx->width - 8) * (1 + s->is_16bpp);
|
|
592 | 594 |
|
593 | 595 |
init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8); |
594 | 596 |
for (y = 0; y < s->avctx->height; y += 8) { |
... | ... | |
599 | 601 |
x, y, opcode, s->stream_ptr); |
600 | 602 |
|
601 | 603 |
if (!s->is_16bpp) { |
602 |
s->pixel_ptr = s->current_frame.data[0] + x |
|
603 |
+ y*s->current_frame.linesize[0]; |
|
604 |
ret = ipvideo_decode_block[opcode](s); |
|
604 |
s->pixel_ptr = s->current_frame.data[0] + x
|
|
605 |
+ y*s->current_frame.linesize[0];
|
|
606 |
ret = ipvideo_decode_block[opcode](s);
|
|
605 | 607 |
} else { |
606 |
s->pixel_ptr = s->current_frame.data[0] + x*2 |
|
607 |
+ y*s->current_frame.linesize[0]; |
|
608 |
s->pixel_ptr = s->current_frame.data[0] + x*2
|
|
609 |
+ y*s->current_frame.linesize[0];
|
|
608 | 610 |
} |
609 | 611 |
if (ret != 0) { |
610 | 612 |
av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n", |
Also available in: Unified diff