X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-realmedia%2Fsrc%2Fcodecs%2Frv60dsp.rs;h=be88a3e1b9fbfcf6d67f4f23783c500612b06957;hb=2eefcf7983adde9c24942ae6fe9a2ed2164bbca3;hp=829d32591ef0a03dc3d9b17c141640899c879826;hpb=70d30944dffff71a2b6fed6f8143c4ef2aecea3c;p=nihav.git diff --git a/nihav-realmedia/src/codecs/rv60dsp.rs b/nihav-realmedia/src/codecs/rv60dsp.rs index 829d325..be88a3e 100644 --- a/nihav-realmedia/src/codecs/rv60dsp.rs +++ b/nihav-realmedia/src/codecs/rv60dsp.rs @@ -110,10 +110,12 @@ fn chroma_mc(dst: &mut [u8], mut didx: usize, dstride: usize, src: &[u8], mut si return; } if (x > 0) && (y > 0) { - let a = ((4 - x) * (4 - y)) as u16; - let b = (( x) * (4 - y)) as u16; - let c = ((4 - x) * ( y)) as u16; - let d = (( x) * ( y)) as u16; + // 3,3 case is the same as 3,2 for some reason + let ymod = if (x == 3) && (y == 3) { 2 } else { y }; + let a = ((4 - x) * (4 - ymod)) as u16; + let b = (( x) * (4 - ymod)) as u16; + let c = ((4 - x) * ( ymod)) as u16; + let d = (( x) * ( ymod)) as u16; for _ in 0..h { for x in 0..w { dst[didx + x] = ((a * (src[sidx + x] as u16)