X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-codec-support%2Fsrc%2Fcodecs%2Fh263%2Fcode.rs;h=cbeb12042fad4946a79d04ce14f238ec6da0de1c;hb=HEAD;hp=4d24ec36f5e1199bee2c37ffbafc0422b9213b9f;hpb=3498b692607273b8075b69cee827103d441d51f4;p=nihav.git diff --git a/nihav-codec-support/src/codecs/h263/code.rs b/nihav-codec-support/src/codecs/h263/code.rs index 4d24ec3..6ff4247 100644 --- a/nihav-codec-support/src/codecs/h263/code.rs +++ b/nihav-codec-support/src/codecs/h263/code.rs @@ -523,10 +523,10 @@ pub fn h263_filter_row(buf: &mut NAVideoBuffer, mb_y: usize, mb_w: usize, cb let coded0 = cbpi.is_coded(mb_x, 0); let coded1 = cbpi.is_coded(mb_x, 1); let q = cbpi.get_q(mb_w + mb_x); - let str = if q < 32 { FILTER_STRENGTH[q as usize] } else { 0 }; + let strength = if q < 32 { FILTER_STRENGTH[q as usize] } else { 0 }; if mb_y != 0 { - if coded0 && cbpi.is_coded_top(mb_x, 0) { deblock_hor(buf, 0, str, coff); } - if coded1 && cbpi.is_coded_top(mb_x, 1) { deblock_hor(buf, 0, str, coff + 8); } + if coded0 && cbpi.is_coded_top(mb_x, 0) { deblock_hor(buf, 0, strength, coff); } + if coded1 && cbpi.is_coded_top(mb_x, 1) { deblock_hor(buf, 0, strength, coff + 8); } } let coff = off + 8 * stride; if cbpi.is_coded(mb_x, 2) && coded0 { deblock_hor(buf, 0, q, coff); } @@ -542,7 +542,7 @@ pub fn h263_filter_row(buf: &mut NAVideoBuffer, mb_y: usize, mb_w: usize, cb let ccur0 = cbpi.is_coded(mb_x, 0); let ccur1 = cbpi.is_coded(mb_x, 1); let q = cbpi.get_q(mb_w + mb_x); - let str = if q < 32 { FILTER_STRENGTH[q as usize] } else { 0 }; + let strength = if q < 32 { FILTER_STRENGTH[q as usize] } else { 0 }; if mb_y != 0 { let coff = off - 8 * stride; let qtop = cbpi.get_q(mb_x); @@ -550,8 +550,8 @@ pub fn h263_filter_row(buf: &mut NAVideoBuffer, mb_y: usize, mb_w: usize, cb if leftt && ctop0 { deblock_ver(buf, 0, strtop, coff); } if ctop0 && ctop1 { deblock_ver(buf, 0, strtop, coff + 8); } } - if leftc && ccur0 { deblock_ver(buf, 0, str, off); } - if ccur0 && ccur1 { deblock_ver(buf, 0, str, off + 8); } + if leftc && ccur0 { deblock_ver(buf, 0, strength, off); } + if ccur0 && ccur1 { deblock_ver(buf, 0, strength, off + 8); } leftt = ctop1; leftc = ccur1; off += 16; @@ -567,9 +567,9 @@ pub fn h263_filter_row(buf: &mut NAVideoBuffer, mb_y: usize, mb_w: usize, cb let ctv = cbpi.is_coded_top(mb_x, 5); let ccv = cbpi.is_coded(mb_x, 5); let q = cbpi.get_q(mb_w + mb_x); - let str = if q < 32 { FILTER_STRENGTH[q as usize] } else { 0 }; - if ctu && ccu { deblock_hor(buf, 1, str, offu + mb_x * 8); } - if ctv && ccv { deblock_hor(buf, 2, str, offv + mb_x * 8); } + let strength = if q < 32 { FILTER_STRENGTH[q as usize] } else { 0 }; + if ctu && ccu { deblock_hor(buf, 1, strength, offu + mb_x * 8); } + if ctv && ccv { deblock_hor(buf, 2, strength, offv + mb_x * 8); } } let mut leftu = false; let mut leftv = false; @@ -600,7 +600,7 @@ impl BlockDSP for H263BlockDSP { blockdsp::copy_block(&mut dst, src.clone(), 0, xpos, ypos, mv.x >> 1, mv.y >> 1, 16, 16, 0, 1, mode, H263_INTERP_FUNCS); blockdsp::copy_block(&mut dst, src.clone(), 1, xpos >> 1, ypos >> 1, mv.x >> 2, mv.y >> 2, 8, 8, 0, 1, cmode, H263_INTERP_FUNCS); - blockdsp::copy_block(&mut dst, src.clone(), 2, xpos >> 1, ypos >> 1, mv.x >> 2, mv.y >> 2, 8, 8, 0, 1, cmode, H263_INTERP_FUNCS); + blockdsp::copy_block(&mut dst, src, 2, xpos >> 1, ypos >> 1, mv.x >> 2, mv.y >> 2, 8, 8, 0, 1, cmode, H263_INTERP_FUNCS); } fn copy_blocks8x8(&self, dst: &mut NAVideoBuffer, src: NAVideoBufferRef, xpos: usize, ypos: usize, mvs: &[MV; 4]) { let mut dst = NASimpleVideoFrame::from_video_buf(dst).unwrap(); @@ -629,7 +629,7 @@ impl BlockDSP for H263BlockDSP { blockdsp::copy_block(&mut dst, src.clone(), 0, xpos, ypos, mv.x >> 1, mv.y >> 1, 16, 16, 0, 1, mode, H263_INTERP_AVG_FUNCS); blockdsp::copy_block(&mut dst, src.clone(), 1, xpos >> 1, ypos >> 1, mv.x >> 2, mv.y >> 2, 8, 8, 0, 1, cmode, H263_INTERP_AVG_FUNCS); - blockdsp::copy_block(&mut dst, src.clone(), 2, xpos >> 1, ypos >> 1, mv.x >> 2, mv.y >> 2, 8, 8, 0, 1, cmode, H263_INTERP_AVG_FUNCS); + blockdsp::copy_block(&mut dst, src, 2, xpos >> 1, ypos >> 1, mv.x >> 2, mv.y >> 2, 8, 8, 0, 1, cmode, H263_INTERP_AVG_FUNCS); } fn avg_blocks8x8(&self, dst: &mut NAVideoBuffer, src: NAVideoBufferRef, xpos: usize, ypos: usize, mvs: &[MV; 4]) { let mut dst = NASimpleVideoFrame::from_video_buf(dst).unwrap();