Commit 4c9ede2e authored by Michael Niedermayer's avatar Michael Niedermayer

interlaced mpeg2 fix ... replacing linesize>>1 by uvlinesize brainlessly wasnt a good idea

Originally committed as revision 771 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent cc504d3c
......@@ -992,7 +992,7 @@ static inline void mpeg_motion(MpegEncContext *s,
int motion_x, int motion_y, int h)
{
UINT8 *ptr;
int dxy, offset, mx, my, src_x, src_y, height, linesize;
int dxy, offset, mx, my, src_x, src_y, height, linesize, uvlinesize;
int emu=0;
if(s->quarter_sample)
......@@ -1013,6 +1013,7 @@ if(s->quarter_sample)
if (src_y == height)
dxy &= ~2;
linesize = s->linesize << field_based;
uvlinesize = s->uvlinesize << field_based;
ptr = ref_picture[0] + (src_y * linesize) + (src_x) + src_offset;
dest_y += dest_offset;
......@@ -1053,21 +1054,20 @@ if(s->quarter_sample)
src_y = clip(src_y, -8, height >> 1);
if (src_y == (height >> 1))
dxy &= ~2;
offset = (src_y * s->uvlinesize) + src_x + (src_offset >> 1);
offset = (src_y * uvlinesize) + src_x + (src_offset >> 1);
ptr = ref_picture[1] + offset;
if(emu){
emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, (h>>1)+1, src_x, src_y, s->width>>1, height>>1);
emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, (h>>1)+1, src_x, src_y, s->width>>1, height>>1);
ptr= s->edge_emu_buffer;
}
pix_op[dxy](dest_cb + (dest_offset >> 1), ptr, s->uvlinesize, h >> 1);
pix_op[dxy](dest_cb + (dest_offset >> 1), ptr, uvlinesize, h >> 1);
ptr = ref_picture[2] + offset;
if(emu){
emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, (h>>1)+1, src_x, src_y, s->width>>1, height>>1);
emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, (h>>1)+1, src_x, src_y, s->width>>1, height>>1);
ptr= s->edge_emu_buffer;
}
pix_op[dxy](dest_cr + (dest_offset >> 1), ptr, s->uvlinesize, h >> 1);
pix_op[dxy](dest_cr + (dest_offset >> 1), ptr, uvlinesize, h >> 1);
}
static inline void qpel_motion(MpegEncContext *s,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment