X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-indeo%2Fsrc%2Fcodecs%2Fintel263.rs;h=acedfb4419783f32104f4fae6acd6bc6852661fd;hb=fbf1f900e6e6da46026938f90f1eaba2034aa79a;hp=a1a0ace6c1c5f94f7f22e395eca6d68973aa303e;hpb=10a6216fe0c337e18eb7e5fce0d65b3c7f80d7af;p=nihav.git diff --git a/nihav-indeo/src/codecs/intel263.rs b/nihav-indeo/src/codecs/intel263.rs index a1a0ace..acedfb4 100644 --- a/nihav-indeo/src/codecs/intel263.rs +++ b/nihav-indeo/src/codecs/intel263.rs @@ -157,13 +157,13 @@ fn deblock_hor(buf: &mut NAVideoBuffer, comp: usize, strength: u8, off: usiz let dptr = buf.get_data_mut().unwrap(); let buf = dptr.as_mut_slice(); for x in 0..8 { - let a = buf[off - 2 * stride + x] as i16; - let b = buf[off - 1 * stride + x] as i16; - let c = buf[off + 0 * stride + x] as i16; - let d = buf[off + 1 * stride + x] as i16; + let a = i16::from(buf[off - 2 * stride + x]); + let b = i16::from(buf[off - 1 * stride + x]); + let c = i16::from(buf[off + 0 * stride + x]); + let d = i16::from(buf[off + 1 * stride + x]); let diff = (3 * (a - d) + 8 * (c - b)) / 16; if (diff != 0) && (diff > -24) && (diff < 24) { - let d1a = (diff.abs() - 2 * (diff.abs() - (strength as i16)).max(0)).max(0); + let d1a = (diff.abs() - 2 * (diff.abs() - i16::from(strength)).max(0)).max(0); let d1 = if diff < 0 { -d1a } else { d1a }; buf[off - 1 * stride + x] = (b + d1).max(0).min(255) as u8; @@ -177,13 +177,13 @@ fn deblock_ver(buf: &mut NAVideoBuffer, comp: usize, strength: u8, off: usiz let dptr = buf.get_data_mut().unwrap(); let buf = dptr.as_mut_slice(); for y in 0..8 { - let a = buf[off - 2 + y * stride] as i16; - let b = buf[off - 1 + y * stride] as i16; - let c = buf[off + 0 + y * stride] as i16; - let d = buf[off + 1 + y * stride] as i16; + let a = i16::from(buf[off - 2 + y * stride]); + let b = i16::from(buf[off - 1 + y * stride]); + let c = i16::from(buf[off + 0 + y * stride]); + let d = i16::from(buf[off + 1 + y * stride]); let diff = (3 * (a - d) + 8 * (c - b)) / 16; if (diff != 0) && (diff > -24) && (diff < 24) { - let d1a = (diff.abs() - 2 * (diff.abs() - (strength as i16)).max(0)).max(0); + let d1a = (diff.abs() - 2 * (diff.abs() - i16::from(strength)).max(0)).max(0); let d1 = if diff < 0 { -d1a } else { d1a }; buf[off - 1 + y * stride] = (b + d1).max(0).min(255) as u8; @@ -448,6 +448,7 @@ fn decode_b_info(br: &mut BitReader, is_pb: bool, is_ipb: bool, is_intra: bool) impl<'a> BlockDecoder for Intel263BR<'a> { #[allow(unused_variables)] +#[allow(clippy::unreadable_literal)] fn decode_pichdr(&mut self) -> DecoderResult { let br = &mut self.br; let syncw = br.read(22)?; @@ -732,6 +733,12 @@ impl NADecoder for Intel263Decoder { } } +impl NAOptionHandler for Intel263Decoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + pub fn get_decoder() -> Box { Box::new(Intel263Decoder::new())