summaryrefslogtreecommitdiffstats
path: root/src/ReedSolomon.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-29 00:05:12 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-29 00:05:12 +0200
commit83d2624cdfc1dd45ab1da02881448c5584ff6050 (patch)
treeeec44e4977e506331ee808cfdc735c6c17160d04 /src/ReedSolomon.h
parent32bdfb274ec20318dd7d45fb62cd6e51323453f7 (diff)
downloaddabmux-83d2624cdfc1dd45ab1da02881448c5584ff6050.tar.gz
dabmux-83d2624cdfc1dd45ab1da02881448c5584ff6050.tar.bz2
dabmux-83d2624cdfc1dd45ab1da02881448c5584ff6050.zip
Modernize ReedSolomon, use vector instead of raw buffer
Diffstat (limited to 'src/ReedSolomon.h')
-rw-r--r--src/ReedSolomon.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/ReedSolomon.h b/src/ReedSolomon.h
index d96a522..abcef62 100644
--- a/src/ReedSolomon.h
+++ b/src/ReedSolomon.h
@@ -1,6 +1,11 @@
/*
Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
of Canada (Communications Research Center Canada)
+
+ Copyright (C) 2016
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://www.opendigitalradio.org
*/
/*
This file is part of ODR-DabMux.
@@ -19,34 +24,33 @@
along with ODR-DabMux. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _REEDSOLOMON
-#define _REEDSOLOMON
+#pragma once
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#include <stdlib.h>
class ReedSolomon
{
public:
- ReedSolomon(int N, int K, bool reverse = false,
+ ReedSolomon(int N, int K,
+ bool reverse = false,
int gfpoly = 0x11d, int firstRoot = 0, int primElem = 1);
- ReedSolomon(const ReedSolomon& clone);
- virtual ~ReedSolomon();
+ ReedSolomon(const ReedSolomon& other) = delete;
+ ReedSolomon operator=(const ReedSolomon& other) = delete;
+ ~ReedSolomon();
void setReverse(bool state);
- int encode(void* data, void* fec, unsigned long size);
- int encode(void* data, unsigned long size);
-
-protected:
- int myN;
- int myK;
+ int encode(void* data, void* fec, size_t size);
+ int encode(void* data, size_t size);
private:
+ int m_N;
+ int m_K;
+
void* rsData;
bool reverse;
};
-
-#endif // _REEDSOLOMON