From b396a7eff34173fd4a9e48d8e4cfa5bab7fa603f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 12 Feb 2017 19:02:45 +0100 Subject: Add initial copy-pasted code --- src/fec/rs-common.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/fec/rs-common.h (limited to 'src/fec/rs-common.h') diff --git a/src/fec/rs-common.h b/src/fec/rs-common.h new file mode 100644 index 0000000..e64eb39 --- /dev/null +++ b/src/fec/rs-common.h @@ -0,0 +1,26 @@ +/* Stuff common to all the general-purpose Reed-Solomon codecs + * Copyright 2004 Phil Karn, KA9Q + * May be used under the terms of the GNU Lesser General Public License (LGPL) + */ + +/* Reed-Solomon codec control block */ +struct rs { + int mm; /* Bits per symbol */ + int nn; /* Symbols per block (= (1<= rs->nn) { + x -= rs->nn; + x = (x >> rs->mm) + (x & rs->nn); + } + return x; +} -- cgit v1.2.3