comparison interplayvideo.c @ 10714:5c36c4772cf8 libavcodec

Use frame linesize in Interplay Video block copying function
author kostya
date Sun, 27 Dec 2009 08:38:07 +0000
parents b703476cd4df
children 4f455f478398
comparison
equal deleted inserted replaced
10713:b703476cd4df 10714:5c36c4772cf8
85 } 85 }
86 86
87 static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y) 87 static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
88 { 88 {
89 int current_offset = s->pixel_ptr - s->current_frame.data[0]; 89 int current_offset = s->pixel_ptr - s->current_frame.data[0];
90 int motion_offset = current_offset + delta_y * s->stride + delta_x; 90 int motion_offset = current_offset + delta_y * s->current_frame.linesize[0] + delta_x;
91 if (motion_offset < 0) { 91 if (motion_offset < 0) {
92 av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); 92 av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset);
93 return -1; 93 return -1;
94 } else if (motion_offset > s->upper_motion_limit_offset) { 94 } else if (motion_offset > s->upper_motion_limit_offset) {
95 av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", 95 av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n",
96 motion_offset, s->upper_motion_limit_offset); 96 motion_offset, s->upper_motion_limit_offset);
97 return -1; 97 return -1;
98 } 98 }
99 s->dsp.put_pixels_tab[1][0](s->pixel_ptr, src->data[0] + motion_offset, s->stride, 8); 99 s->dsp.put_pixels_tab[1][0](s->pixel_ptr, src->data[0] + motion_offset, s->current_frame.linesize[0], 8);
100 return 0; 100 return 0;
101 } 101 }
102 102
103 static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s) 103 static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s)
104 { 104 {