From: Kostya Shishkov Date: Tue, 21 Jan 2020 14:38:22 +0000 (+0100) Subject: duck/vpcommon: hopefully fix vp_copy_block() X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=547a80745e273481eb48cae13a968905f1774ac7;p=nihav.git duck/vpcommon: hopefully fix vp_copy_block() --- diff --git a/nihav-duck/src/codecs/vpcommon.rs b/nihav-duck/src/codecs/vpcommon.rs index bd7d1cf..d4fdea5 100644 --- a/nihav-duck/src/codecs/vpcommon.rs +++ b/nihav-duck/src/codecs/vpcommon.rs @@ -383,20 +383,20 @@ pub fn vp_copy_block(dst: &mut NASimpleVideoFrame, src: NAVideoBufferRef let mut tmp_buf = NASimpleVideoFrame::from_video_buf(&mut mc_buf).unwrap(); copy_block(&mut tmp_buf, src, comp, 0, 0, src_x as i16, src_y as i16, bsize, bsize, 0, 0, 0, interp); - if (sy & 7) != 0 { - let foff = (8 - (sy & 7)) as usize; - let off = (pre + foff) * tmp_buf.stride[comp]; - vp31_loop_filter(tmp_buf.data, off, tmp_buf.stride[comp], 1, bsize, loop_str); - } - if (sx & 7) != 0 { + if ((sx & 7) != 0) || (mode != 0) { let foff = (8 - (sx & 7)) as usize; let off = pre + foff; vp31_loop_filter(tmp_buf.data, off, 1, tmp_buf.stride[comp], bsize, loop_str); } + if ((sy & 7) != 0) || (mode != 0) { + let foff = (8 - (sy & 7)) as usize; + let off = (pre + foff) * tmp_buf.stride[comp]; + vp31_loop_filter(tmp_buf.data, off, tmp_buf.stride[comp], 1, bsize, loop_str); + } } let dxoff = (pre as i16) - (dx as i16); let dyoff = (pre as i16) - (dy as i16); - copy_block(dst, mc_buf, comp, dx, dy, dxoff, dyoff, 8, 8, preborder, postborder, 0/* mode*/, interp); + copy_block(dst, mc_buf, comp, dx, dy, dxoff, dyoff, 8, 8, preborder, postborder, mode, interp); } fn vp3_interp00(dst: &mut [u8], dstride: usize, src: &[u8], sstride: usize, bw: usize, bh: usize)