X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-realmedia%2Fsrc%2Fcodecs%2Frv20.rs;h=f25df6beeb00f23790be5fbc953d8d0a3d77dc2e;hb=886cde4847280b96e10d240c2f2d76abec121dc8;hp=0c27181f35d903432d8e1f6769e349d06df0d400;hpb=71b656a25d0d9e5f83cba618def96873b1c72058;p=nihav.git diff --git a/nihav-realmedia/src/codecs/rv20.rs b/nihav-realmedia/src/codecs/rv20.rs index 0c27181..f25df6b 100644 --- a/nihav-realmedia/src/codecs/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -140,7 +140,7 @@ impl BlockDSP for RV20BlockDSP { 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(); @@ -169,7 +169,7 @@ impl BlockDSP for RV20BlockDSP { 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(); @@ -667,6 +667,12 @@ impl NADecoder for RealVideo20Decoder { } } +impl NAOptionHandler for RealVideo20Decoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + struct MBB { blocks: usize, bits: u8 } const H263_MBB: &[MBB; 7] = &[ MBB{ blocks: 47, bits: 6 }, @@ -687,15 +693,16 @@ mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; use nihav_codec_support::test::dec_video::*; - use crate::realmedia_register_all_codecs; + use crate::realmedia_register_all_decoders; use crate::realmedia_register_all_demuxers; #[test] fn test_rv20() { let mut dmx_reg = RegisteredDemuxers::new(); realmedia_register_all_demuxers(&mut dmx_reg); let mut dec_reg = RegisteredDecoders::new(); - realmedia_register_all_codecs(&mut dec_reg); + realmedia_register_all_decoders(&mut dec_reg); + // sample from a private collection test_decoding("realmedia", "realvideo2", "assets/RV/rv20_svt_atrc_640x352_realproducer_plus_8.51.rm", Some(1000), &dmx_reg, &dec_reg, ExpectedTestResult::MD5Frames(vec![ @@ -713,12 +720,12 @@ mod test { [0x319d142d, 0x607a7c28, 0x526a2794, 0xa6e7864f], [0x319d142d, 0x607a7c28, 0x526a2794, 0xa6e7864f], [0xa2008d4c, 0xf4684b3a, 0xecd0526c, 0xf0742a77], - [0xed26067a, 0x861f385e, 0x3562e478, 0x586d0cb6], + [0x5eef6cfd, 0x4eb49f19, 0x4d760b7a, 0x741ccd0c], [0x0e0529df, 0xf1cc3f03, 0x03986b0d, 0xd2033c08], - [0x9343a151, 0xc7622835, 0x9edb29c2, 0xd96928fa], + [0xdb9aa091, 0xf2c6345c, 0xde9deae8, 0x71f51a67], [0x22c978cf, 0x6887a9ba, 0xe74c9316, 0x8cbdd29b], - [0x3ff51b06, 0x1460e151, 0xd8536d37, 0x31121464], - [0x2912d269, 0x01f00c4b, 0x22f714f8, 0xf81abe8b], - [0x875be308, 0x390d5b71, 0xe4108ce3, 0x1f39fed4]])); + [0x7c83c784, 0x15b20881, 0x74798f24, 0x2096573c], + [0x84a68aed, 0x4cfcefb1, 0x78d1b66b, 0x21b1860a], + [0x78ed094a, 0x8df72434, 0x58bcd64d, 0x8d725dfd]])); } }