use nihav_core::frame::NASimpleVideoFrame;
use nihav_codec_support::codecs::{MV, ZERO_MV};
use nihav_codec_support::data::GenericCache;
use nihav_core::frame::NASimpleVideoFrame;
use nihav_codec_support::codecs::{MV, ZERO_MV};
use nihav_codec_support::data::GenericCache;
-#[derive(Clone,Copy,Debug,PartialEq)]
+#[derive(Clone,Copy,Debug,PartialEq,Default)]
- match self {
- MBType::Intra4x4 | MBType::Intra8x8 | MBType::Intra16x16(_, _, _) | MBType::PCM => true,
- _ => false,
- }
+ matches!(self, MBType::Intra4x4 | MBType::Intra8x8 | MBType::Intra16x16(_, _, _) | MBType::PCM)
}
pub fn is_4x4(self) -> bool { self.num_parts() == 4 }
pub fn is_l0(self, part: usize) -> bool {
}
pub fn is_4x4(self) -> bool { self.num_parts() == 4 }
pub fn is_l0(self, part: usize) -> bool {
-impl Default for MBType {
- fn default() -> Self { MBType::Intra4x4 }
-}
-
-#[derive(Clone,Copy,Debug,PartialEq)]
+#[derive(Clone,Copy,Debug,PartialEq,Default)]
-#[derive(Clone,Copy,Debug,PartialEq)]
+#[derive(Clone,Copy,Debug,PartialEq,Default)]
}
pub fn is_inter(self) -> bool {
!self.is_intra() && !self.is_skip() && self != CompactMBType::PCM
}
pub fn is_16x16_ref(self) -> bool {
}
pub fn is_inter(self) -> bool {
!self.is_intra() && !self.is_skip() && self != CompactMBType::PCM
}
pub fn is_16x16_ref(self) -> bool {
CompactMBType::Intra4x4 |
CompactMBType::Intra8x8 |
CompactMBType::Intra16x16 |
CompactMBType::PCM |
CompactMBType::P16x16 |
CompactMBType::Intra4x4 |
CompactMBType::Intra8x8 |
CompactMBType::Intra16x16 |
CompactMBType::PCM |
CompactMBType::P16x16 |
-#[derive(Clone,Copy,Debug,PartialEq)]
+#[derive(Clone,Copy,Debug,PartialEq,Default)]
IntraPredMode::Vertical => 0,
IntraPredMode::Horizontal => 1,
IntraPredMode::DC => 2,
IntraPredMode::Vertical => 0,
IntraPredMode::Horizontal => 1,
IntraPredMode::DC => 2,
- pub fn fill_deblock(&mut self, frefs: &FrameRefs, deblock_mode: u8, is_s: bool) {
+ pub fn fill_deblock(&mut self, frefs: &SliceRefs, deblock_mode: u8, is_s: bool) {
self.fill_mv (0, 0, 16, 16, 0, mv);
self.fill_ref(0, 0, 16, 16, 0, ref_idx);
}
self.fill_mv (0, 0, 16, 16, 0, mv);
self.fill_ref(0, 0, 16, 16, 0, ref_idx);
}
- pub fn predict_direct_mb(&mut self, frame_refs: &FrameRefs, temporal_mv: bool, direct_8x8: bool, cur_id: u16) {
+ pub fn predict_direct_mb(&mut self, frame_refs: &SliceRefs, temporal_mv: bool, direct_8x8: bool, cur_id: u16) {
let (col_mb, r1_poc, r1_long) = frame_refs.get_colocated_info(self.mb_x, self.mb_y);
if direct_8x8 {
for blk4 in 0..16 {
let (col_mb, r1_poc, r1_long) = frame_refs.get_colocated_info(self.mb_x, self.mb_y);
if direct_8x8 {
for blk4 in 0..16 {
- pub fn predict_direct_sub(&mut self, frame_refs: &FrameRefs, temporal_mv: bool, direct8x8: bool, cur_id: u16, blk4: usize) {
+ pub fn predict_direct_sub(&mut self, frame_refs: &SliceRefs, temporal_mv: bool, direct8x8: bool, cur_id: u16, blk4: usize) {
let src_blk = if !direct8x8 { blk4 } else { BLK4_TO_D8[blk4] };
let (mbi, r1_poc, r1_long) = frame_refs.get_colocated_info(self.mb_x, self.mb_y);
let (mv0, ref0, mv1, ref1) = self.get_direct_mv(frame_refs, &mbi, r1_poc, r1_long, temporal_mv, cur_id, src_blk);
self.get_cur_blk4(blk4).mv = [mv0, mv1];
self.get_cur_blk8(blk4_to_blk8(blk4)).ref_idx = [ref0, ref1];
}
let src_blk = if !direct8x8 { blk4 } else { BLK4_TO_D8[blk4] };
let (mbi, r1_poc, r1_long) = frame_refs.get_colocated_info(self.mb_x, self.mb_y);
let (mv0, ref0, mv1, ref1) = self.get_direct_mv(frame_refs, &mbi, r1_poc, r1_long, temporal_mv, cur_id, src_blk);
self.get_cur_blk4(blk4).mv = [mv0, mv1];
self.get_cur_blk8(blk4_to_blk8(blk4)).ref_idx = [ref0, ref1];
}
- pub fn get_direct_mv(&self, frame_refs: &FrameRefs, mbi: &FrameMBInfo, r1_poc: u16, r1_long: bool, temporal_mv: bool, cur_id: u16, blk4: usize) -> (MV, PicRef, MV, PicRef) {
+ #[allow(clippy::nonminimal_bool)]
+ pub fn get_direct_mv(&self, frame_refs: &SliceRefs, mbi: &FrameMBInfo, r1_poc: u16, r1_long: bool, temporal_mv: bool, cur_id: u16, blk4: usize) -> (MV, PicRef, MV, PicRef) {
let blk8 = blk4_to_blk8(blk4);
let (col_mv, r0_poc, col_idx) = if mbi.ref_poc[blk8] == [MISSING_POC; 2] {
(ZERO_MV, MISSING_POC, MISSING_REF)
let blk8 = blk4_to_blk8(blk4);
let (col_mv, r0_poc, col_idx) = if mbi.ref_poc[blk8] == [MISSING_POC; 2] {
(ZERO_MV, MISSING_POC, MISSING_REF)