X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fcodecs%2Fh263%2Fmod.rs;h=4f066a6e551c6f452a835ebd1c44c91a37428be5;hb=15facd16efa3d982dcab59ca8b20cdf577b8e3e0;hp=094307c006effb115c6c3c3ef520978a1a085874;hpb=32007ad9122cd9be6018dfb66628520d6cf322c8;p=nihav.git diff --git a/src/codecs/h263/mod.rs b/src/codecs/h263/mod.rs index 094307c..4f066a6 100644 --- a/src/codecs/h263/mod.rs +++ b/src/codecs/h263/mod.rs @@ -364,9 +364,9 @@ impl MV { } } fn b_sub(pvec: MV, fwdvec: MV, bvec: MV, trb: u16, trd: u16) -> Self { - let bscale = (trb as i16) - (trd as i16); - let x = if bvec.x != 0 { fwdvec.x - pvec.x } else if trd != 0 { bscale * pvec.x / (trd as i16) } else { 0 }; - let y = if bvec.y != 0 { fwdvec.y - pvec.y } else if trd != 0 { bscale * pvec.y / (trd as i16) } else { 0 }; + let bscale = (trb as i32) - (trd as i32); + let x = if bvec.x != 0 { fwdvec.x - pvec.x } else if trd != 0 { (bscale * (pvec.x as i32) / (trd as i32)) as i16 } else { 0 }; + let y = if bvec.y != 0 { fwdvec.y - pvec.y } else if trd != 0 { (bscale * (pvec.y as i32) / (trd as i32)) as i16 } else { 0 }; MV { x: x, y: y } } }