X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-duck%2Fsrc%2Fcodecs%2Ftruemotion2.rs;h=09c9844ce45257151be5aae2cec27db9910b707c;hb=47933c6d7ef4dc3ca6d549199081c67cea324c36;hp=8be4561b952cc4ebb782fd490101e29e29a3b1c1;hpb=ce742854b2912b880fb3d3e330042b049dac8504;p=nihav.git diff --git a/nihav-duck/src/codecs/truemotion2.rs b/nihav-duck/src/codecs/truemotion2.rs index 8be4561..09c9844 100644 --- a/nihav-duck/src/codecs/truemotion2.rs +++ b/nihav-duck/src/codecs/truemotion2.rs @@ -336,6 +336,7 @@ struct TM2Decoder { impl TM2Decoder { fn new() -> Self { Self::default() } + #[allow(clippy::manual_memcpy)] fn decode_blocks(&mut self) -> DecoderResult { let ydst = &mut self.cur_frame.ydata; let udst = &mut self.cur_frame.udata; @@ -434,7 +435,7 @@ impl TM2Decoder { for _ in 0..4 { for x in 0..4 { let dy = self.streams[TM2StreamType::Update as usize].get_token()?; - ydst[yoff + x] = ((ysrc[yoff + x] as i32) + dy) as u8; + ydst[yoff + x] = (i32::from(ysrc[yoff + x]) + dy) as u8; } yoff += ystride; } @@ -581,6 +582,12 @@ impl NADecoder for TM2Decoder { } } +impl NAOptionHandler for TM2Decoder { + 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(TM2Decoder::new()) }