From 846959ef46de05231d21759b907a734d750d50c8 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 30 Nov 2019 11:37:36 +0100 Subject: [PATCH] indeo2: swap chroma planes --- nihav-indeo/src/codecs/indeo2.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nihav-indeo/src/codecs/indeo2.rs b/nihav-indeo/src/codecs/indeo2.rs index 58131c8..089cd35 100644 --- a/nihav-indeo/src/codecs/indeo2.rs +++ b/nihav-indeo/src/codecs/indeo2.rs @@ -335,7 +335,8 @@ impl NADecoder for Indeo2Decoder { let mut buf = bufinfo.get_vbuf().unwrap(); for plane in 0..3 { let tabidx = (if plane == 0 { luma_tab } else { chroma_tab }) as usize; - self.decode_plane_intra(&mut br, &mut buf, plane, tabidx)?; + let planeno = if plane == 0 { 0 } else { plane ^ 3 }; + self.decode_plane_intra(&mut br, &mut buf, planeno, tabidx)?; } self.frmmgr.add_frame(buf); let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), bufinfo); @@ -349,7 +350,8 @@ impl NADecoder for Indeo2Decoder { for plane in 0..3 { let tabidx = (if plane == 0 { luma_tab } else { chroma_tab }) as usize; - self.decode_plane_inter(&mut br, &mut buf, plane, tabidx)?; + let planeno = if plane == 0 { 0 } else { plane ^ 3 }; + self.decode_plane_inter(&mut br, &mut buf, planeno, tabidx)?; } let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), NABufferType::Video(buf)); frm.set_keyframe(false); -- 2.39.5