0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
];
-#[derive(Clone,Copy,PartialEq,Debug)]
+#[derive(Clone,Copy,PartialEq,Debug,Default)]
enum CUType {
+ #[default]
Intra,
InterMV,
Skip,
InterNoMV,
}
-impl Default for CUType {
- fn default() -> Self { CUType::Intra }
-}
-
const RV60_CU_TYPES: [CUType; 4] = [ CUType::Intra, CUType::InterMV, CUType::Skip, CUType::InterNoMV ];
-#[derive(Clone,Copy,PartialEq,Debug)]
+#[derive(Clone,Copy,PartialEq,Debug,Default)]
enum PUType {
+ #[default]
Full,
N2Hor,
N2Ver,
}
}
-impl Default for PUType {
- fn default() -> Self { PUType::Full }
-}
-
#[derive(Clone,Copy,Debug)]
enum IntraMode {
Index(u8),
Plane64,
}
-#[derive(Clone,Copy,PartialEq,Debug)]
+#[derive(Clone,Copy,PartialEq,Debug,Default)]
enum TransformType {
+ #[default]
None,
T4X4,
T8X8,
T16X16,
}
-impl Default for TransformType {
- fn default() -> Self { TransformType::None }
-}
-
#[derive(Clone,Copy,PartialEq,Debug)]
enum MVRef {
None,
fn get_left_strength(&self, pos: usize) -> u8 {
self.left_str[pos] & 3
}
- fn set_top_strength(&mut self, pos: usize, str: u8) {
- self.top_str[pos] |= str;
+ fn set_top_strength(&mut self, pos: usize, strength: u8) {
+ self.top_str[pos] |= strength;
}
- fn set_left_strength(&mut self, pos: usize, str: u8) {
- self.left_str[pos] |= str;
+ fn set_left_strength(&mut self, pos: usize, strength: u8) {
+ self.left_str[pos] |= strength;
}
}
Ok(())
} else {
-println!("???");
Err(DecoderError::InvalidData)
}
}
if hdr.deblock {
self.dblk.reinit(hdr.awidth, hdr.aheight);
}
- let mut off = hsize + ((br.tell() >> 3) as usize);
+ let mut off = hsize + (br.tell() >> 3);
let mut dframe = NASimpleVideoFrame::from_video_buf(&mut buf).unwrap();
for (cu_y, size) in slices.into_iter().enumerate() {
self.decode_cu_line(&mut dframe, &hdr, &src[off..][..size], cu_y)?;
for opt_def in DECODER_OPTIONS.iter() {
if opt_def.check(option).is_ok() {
match (option.name, &option.value) {
- (FRAME_SKIP_OPTION, NAValue::String(ref str)) => {
- if let Ok(smode) = FrameSkipMode::from_str(str) {
+ (FRAME_SKIP_OPTION, NAValue::String(ref strval)) => {
+ if let Ok(smode) = FrameSkipMode::from_str(strval) {
self.skip_mode = smode;
}
},