+
+pub(crate) fn parse_packet(frame: &[f32] /* length 192 */) -> Option<PacketFrame> {
+ let deinterleaved = frame_initial_decode(frame);
+ let packet = match fec::decode(&deinterleaved, 206, p_3) {
+ Some(packet) => packet,
+ None => return None,
+ };
+ let final_frame = (packet[25] & 0x80) > 0;
+ let number = (packet[25] >> 2) & 0x01f;
+ let counter = if final_frame {
+ PacketFrameCounter::FinalFrame {
+ payload_len: number as usize,
+ }
+ } else {
+ PacketFrameCounter::Frame {
+ index: number as usize,
+ }
+ };
+ Some(PacketFrame {
+ payload: packet[0..25].try_into().unwrap(),
+ counter,
+ })
+}