diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-22 16:13:27 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-22 16:29:07 +0100 |
commit | 26065b4193006401f78a4afdf4e19cbd1db6c593 (patch) | |
tree | 9432ec6ca9ec33879e7e1098f9d70da3cce15f67 /lib/edioutput/Interleaver.h | |
parent | 6eca391865df488db1d71c0bbf44bf5f471ad862 (diff) | |
download | dabmux-26065b4193006401f78a4afdf4e19cbd1db6c593.tar.gz dabmux-26065b4193006401f78a4afdf4e19cbd1db6c593.tar.bz2 dabmux-26065b4193006401f78a4afdf4e19cbd1db6c593.zip |
Common fc2902b and 4ad00b8: Update EDI output interleaver and spreading
Diffstat (limited to 'lib/edioutput/Interleaver.h')
-rw-r--r-- | lib/edioutput/Interleaver.h | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/lib/edioutput/Interleaver.h b/lib/edioutput/Interleaver.h deleted file mode 100644 index 3029d5d..0000000 --- a/lib/edioutput/Interleaver.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright (C) 2017 - Matthias P. Braendli, matthias.braendli@mpb.li - - http://www.opendigitalradio.org - - EDI output, - Interleaving of PFT fragments to increase robustness against - burst packet loss. - - This is possible because EDI has to assume that fragments may reach - the receiver out of order. - - */ -/* - This file is part of the ODR-mmbTools. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include "config.h" -#include <vector> -#include <deque> -#include <stdexcept> -#include <cstdint> -#include "Log.h" -#include "PFT.h" - -namespace edi { - -class Interleaver { - public: - using fragment_vec = std::vector<PFTFragment>; - - /* Configure the interleaver to use latency_frames number of AF - * packets for interleaving. Total delay through the interleaver - * will be latency_frames * 24ms - */ - void SetLatency(size_t latency_frames); - - /* Move the fragments for an AF Packet into the interleaver and - * return interleaved fragments to be transmitted. - */ - fragment_vec Interleave(fragment_vec &fragments); - - private: - size_t m_latency = 0; - size_t m_fragment_count = 0; - size_t m_interleave_offset = 0; - size_t m_stride = 0; - - /* Buffer that accumulates enough fragments to interleave */ - std::deque<fragment_vec> m_buffer; - - /* Buffer that contains fragments that have been interleaved, - * to avoid that the interleaver output is too bursty - */ - std::deque<PFTFragment> m_interleaved_fragments; -}; - -} - |