Skip to content

Commit

Permalink
DualFrameRawCombiner: fix ctr overflow handling
Browse files Browse the repository at this point in the history
  • Loading branch information
anuejn committed Mar 11, 2024
1 parent 3733167 commit 7f5f88c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/nodes_cpu/dual_frame_raw_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ impl ProcessingNode for DualFrameRawDecoder {
}
let ((frame_a, frame_b), used_old) = pulled_frames_used_old.unwrap();
let swap = frame_a.storage.as_slice(|frame_a| {
frame_b.storage.as_slice(|frame_b| {
let ctr_a = frame_a[0];
let ctr_b = frame_b[0];
(ctr_a > ctr_b) || ((ctr_a == 0) && (ctr_b >= 14))
})
let ty_a = frame_a[2];
ty_a != 85
});
let (frame_a, frame_b) = if swap { (frame_b, frame_a) } else { (frame_a, frame_b) };

Expand All @@ -129,7 +126,7 @@ impl ProcessingNode for DualFrameRawDecoder {
let ctr_a = frame_a[0];
let ctr_b = frame_b[0];
let ctr_is_ok = (ctr_a.max(ctr_b) - ctr_a.min(ctr_b)) == 1;
let ctr_is_ok = ctr_is_ok || (ctr_b == 0);
let ctr_is_ok = ctr_is_ok || (ctr_b == 0 && ctr_a == 255) || (ctr_a == 0 && ctr_b == 255);
(wrsel_matches && ctr_is_ok && (frame_a[1] != last_wrsel), debug_info, frame_a[1])
})
});
Expand Down

0 comments on commit 7f5f88c

Please sign in to comment.