diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /lib/wsprd/fano.h | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'lib/wsprd/fano.h')
| -rwxr-xr-x | lib/wsprd/fano.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lib/wsprd/fano.h b/lib/wsprd/fano.h index 3290a094..4837cc6f 100755 --- a/lib/wsprd/fano.h +++ b/lib/wsprd/fano.h @@ -1,39 +1,39 @@ -/* - This file is part of wsprd. - - File name: fano.h - - Description: Header file for sequential Fano decoder. - - Copyright 1994, Phil Karn, KA9Q - Minor modifications by Joe Taylor, K1JT -*/ - -#ifndef FANO_H -#define FANO_H - -int fano(unsigned int *metric, unsigned int *cycles, unsigned int *maxnp, - unsigned char *data,unsigned char *symbols, unsigned int nbits, - int mettab[2][256],int delta,unsigned int maxcycles); - -int encode(unsigned char *symbols,unsigned char *data,unsigned int nbytes); - -extern unsigned char Partab[]; - -/* Convolutional encoder macro. Takes the encoder state, generates - * a rate 1/2 symbol pair and stores it in 'sym'. The symbol generated from - * POLY1 goes into the 2-bit of sym, and the symbol generated from POLY2 - * goes into the 1-bit. - */ -#define ENCODE(sym,encstate){\ -unsigned long _tmp;\ -\ -_tmp = (encstate) & POLY1;\ -_tmp ^= _tmp >> 16;\ -(sym) = Partab[(_tmp ^ (_tmp >> 8)) & 0xff] << 1;\ -_tmp = (encstate) & POLY2;\ -_tmp ^= _tmp >> 16;\ -(sym) |= Partab[(_tmp ^ (_tmp >> 8)) & 0xff];\ -} - -#endif +/*
+ This file is part of wsprd.
+
+ File name: fano.h
+
+ Description: Header file for sequential Fano decoder.
+
+ Copyright 1994, Phil Karn, KA9Q
+ Minor modifications by Joe Taylor, K1JT
+*/
+
+#ifndef FANO_H
+#define FANO_H
+
+int fano(unsigned int *metric, unsigned int *cycles, unsigned int *maxnp,
+ unsigned char *data,unsigned char *symbols, unsigned int nbits,
+ int mettab[2][256],int delta,unsigned int maxcycles);
+
+int encode(unsigned char *symbols,unsigned char *data,unsigned int nbytes);
+
+extern unsigned char Partab[];
+
+/* Convolutional encoder macro. Takes the encoder state, generates
+ * a rate 1/2 symbol pair and stores it in 'sym'. The symbol generated from
+ * POLY1 goes into the 2-bit of sym, and the symbol generated from POLY2
+ * goes into the 1-bit.
+ */
+#define ENCODE(sym,encstate){\
+unsigned long _tmp;\
+\
+_tmp = (encstate) & POLY1;\
+_tmp ^= _tmp >> 16;\
+(sym) = Partab[(_tmp ^ (_tmp >> 8)) & 0xff] << 1;\
+_tmp = (encstate) & POLY2;\
+_tmp ^= _tmp >> 16;\
+(sym) |= Partab[(_tmp ^ (_tmp >> 8)) & 0xff];\
+}
+
+#endif
|
