10 #ifndef INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
11 #define INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
14 #include <volk/volk.h>
23 static inline int parity(
int x,
unsigned char* Partab)
32 unsigned int endstate,
33 unsigned int tailsize,
34 unsigned char* decisions)
38 int d_numstates = (1 << 6);
39 int d_decision_t_size = d_numstates / 8;
41 int d_framebits = nbits;
48 endstate = (endstate % d_numstates) << d_ADDSHIFT;
55 d += tailsize * d_decision_t_size;
57 int dif = tailsize - (d_k - 1);
60 while (nbits-- > d_framebits - (d_k - 1)) {
62 dec.
t = &d[nbits * d_decision_t_size];
63 k = (dec.w[(endstate >> d_ADDSHIFT) / 32] >> ((endstate >> d_ADDSHIFT) % 32)) & 1;
65 endstate = (endstate >> 1) | (k << (d_k - 2 + d_ADDSHIFT));
68 data[((nbits + dif) % d_framebits)] = k;
74 while (nbits-- != 0) {
77 dec.t = &d[nbits * d_decision_t_size];
79 k = (dec.w[(endstate >> d_ADDSHIFT) / 32] >> ((endstate >> d_ADDSHIFT) % 32)) & 1;
81 endstate = (endstate >> 1) | (k << (d_k - 2 + d_ADDSHIFT));
82 data[((nbits + dif) % d_framebits)] = k;
88 return retval >> d_ADDSHIFT;
94 #include <emmintrin.h>
96 #include <pmmintrin.h>
98 #include <xmmintrin.h>
102 unsigned int framebits)
107 int d_numstates = (1 << 6);
109 static unsigned char* D;
110 static unsigned char* Y;
111 static unsigned char* X;
112 static unsigned int excess = 6;
113 static unsigned char* Branchtab;
114 static unsigned char Partab[256];
116 int d_polys[2] = { 79, 109 };
125 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
131 for (
i = 0;
i < 256;
i++) {
142 for (state = 0; state < d_numstates / 2; state++) {
143 for (
i = 0;
i < rate;
i++) {
144 Branchtab[
i * d_numstates / 2 + state] =
145 parity((2 * state) & d_polys[
i], Partab) ? 255 : 0;
153 memset(X, 31, d_numstates);
156 memset(D, 0, (d_numstates / 8) * (framebits + 6));
159 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
161 unsigned int min = X[0];
162 int i = 0, state = 0;
163 for (
i = 0;
i < (d_numstates); ++
i) {
184 unsigned int framebits)
189 int d_numstates = (1 << 6);
191 static unsigned char* D;
192 static unsigned char* Y;
193 static unsigned char* X;
194 static unsigned int excess = 6;
195 static unsigned char* Branchtab;
196 static unsigned char Partab[256];
198 int d_polys[2] = { 79, 109 };
207 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
213 for (
i = 0;
i < 256;
i++) {
224 for (state = 0; state < d_numstates / 2; state++) {
225 for (
i = 0;
i < rate;
i++) {
226 Branchtab[
i * d_numstates / 2 + state] =
227 parity((2 * state) & d_polys[
i], Partab) ? 255 : 0;
235 memset(X, 31, d_numstates);
238 memset(D, 0, (d_numstates / 8) * (framebits + 6));
241 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
243 unsigned int min = X[0];
244 int i = 0, state = 0;
245 for (
i = 0;
i < (d_numstates); ++
i) {
348 unsigned int framebits)
353 int d_numstates = (1 << 6);
355 static unsigned char* Y;
356 static unsigned char* X;
357 static unsigned char* D;
358 static unsigned int excess = 6;
359 static unsigned char* Branchtab;
360 static unsigned char Partab[256];
362 int d_polys[2] = { 79, 109 };
371 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
378 for (
i = 0;
i < 256;
i++) {
389 for (state = 0; state < d_numstates / 2; state++) {
390 for (
i = 0;
i < rate;
i++) {
391 Branchtab[
i * d_numstates / 2 + state] =
392 parity((2 * state) & d_polys[
i], Partab) ? 255 : 0;
400 memset(X, 31, d_numstates);
403 memset(D, 0, (d_numstates / 8) * (framebits + 6));
406 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
408 unsigned int min = X[0];
409 int i = 0, state = 0;
410 for (
i = 0;
i < (d_numstates); ++
i) {
data
Definition: plot_best_vs_generic.py:23
Definition: volk_8u_conv_k7_r2puppet_8u.h:17
unsigned int * w
Definition: volk_8u_conv_k7_r2puppet_8u.h:20
unsigned char * t
Definition: volk_8u_conv_k7_r2puppet_8u.h:19
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
static void volk_8u_conv_k7_r2puppet_8u_neonspiral(unsigned char *syms, unsigned char *dec, unsigned int framebits)
Definition: volk_8u_conv_k7_r2puppet_8u.h:182
static void volk_8u_conv_k7_r2puppet_8u_generic(unsigned char *syms, unsigned char *dec, unsigned int framebits)
Definition: volk_8u_conv_k7_r2puppet_8u.h:346
static void volk_8u_conv_k7_r2puppet_8u_spiral(unsigned char *syms, unsigned char *dec, unsigned int framebits)
Definition: volk_8u_conv_k7_r2puppet_8u.h:100
static int chainback_viterbi(unsigned char *data, unsigned int nbits, unsigned int endstate, unsigned int tailsize, unsigned char *decisions)
Definition: volk_8u_conv_k7_r2puppet_8u.h:30
static int parity(int x, unsigned char *Partab)
Definition: volk_8u_conv_k7_r2puppet_8u.h:23
static void volk_8u_x4_conv_k7_r2_8u_spiral(unsigned char *Y, unsigned char *X, unsigned char *syms, unsigned char *dec, unsigned int framebits, unsigned int excess, unsigned char *Branchtab)
Definition: volk_8u_x4_conv_k7_r2_8u.h:330
static void volk_8u_x4_conv_k7_r2_8u_neonspiral(unsigned char *Y, unsigned char *X, unsigned char *syms, unsigned char *dec, unsigned int framebits, unsigned int excess, unsigned char *Branchtab)
Definition: volk_8u_x4_conv_k7_r2_8u.h:626
static void volk_8u_x4_conv_k7_r2_8u_generic(unsigned char *Y, unsigned char *X, unsigned char *syms, unsigned char *dec, unsigned int framebits, unsigned int excess, unsigned char *Branchtab)
Definition: volk_8u_x4_conv_k7_r2_8u.h:920
for i
Definition: volk_config_fixed.tmpl.h:13
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
Definition: volk_malloc.c:38