aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsdecoder.hpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-02 17:43:32 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-07 21:20:24 +0200
commit4809f3c042a99a639542b1e6cd22657871113260 (patch)
treedc0ec0f256eaceb79d63daa09591d4a6ef08cb73 /src/rsdecoder.hpp
parent5542c8ecff635f9abc05b6b2ff255db02c2c9c46 (diff)
downloadetisnoop-4809f3c042a99a639542b1e6cd22657871113260.tar.gz
etisnoop-4809f3c042a99a639542b1e6cd22657871113260.tar.bz2
etisnoop-4809f3c042a99a639542b1e6cd22657871113260.zip
Move all sources to src/
Diffstat (limited to 'src/rsdecoder.hpp')
-rw-r--r--src/rsdecoder.hpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/rsdecoder.hpp b/src/rsdecoder.hpp
new file mode 100644
index 0000000..ca97c91
--- /dev/null
+++ b/src/rsdecoder.hpp
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2015 Stefan Pöschel
+
+ Copyright (C) 2015 Matthias P. Braendli (http://www.opendigitalradio.org)
+
+ 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/>.
+ */
+
+#include <stdint.h>
+#include <vector>
+
+extern "C" {
+#include <fec.h>
+}
+
+class RSDecoder {
+ private:
+ void *rs_handle;
+ uint8_t rs_packet[120];
+ int corr_pos[10];
+ public:
+ RSDecoder();
+ ~RSDecoder();
+
+ /* Correct errors using reed-solomon decoder.
+ * Returns number of errors corrected, or -1 if some errors could not
+ * be corrected
+ */
+ int DecodeSuperframe(std::vector<uint8_t> &sf, int subch_index);
+};
+
+