10#ifndef INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
11#define INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
35 unsigned int endstate,
36 unsigned int tailsize,
37 unsigned char* decisions)
41 int d_numstates = (1 << 6);
42 int d_decision_t_size = d_numstates / 8;
44 int d_framebits = nbits;
51 endstate = (endstate % d_numstates) << d_ADDSHIFT;
58 d += tailsize * d_decision_t_size;
60 int dif = tailsize - (d_k - 1);
63 while (nbits-- > d_framebits - (d_k - 1)) {
65 dec.t = &d[nbits * d_decision_t_size];
66 k = (dec.w[(endstate >> d_ADDSHIFT) / 32] >> ((endstate >> d_ADDSHIFT) % 32)) & 1;
68 endstate = (endstate >> 1) | (k << (d_k - 2 + d_ADDSHIFT));
71 data[((nbits + dif) % d_framebits)] = k;
77 while (nbits-- != 0) {
80 dec.t = &d[nbits * d_decision_t_size];
82 k = (dec.w[(endstate >> d_ADDSHIFT) / 32] >> ((endstate >> d_ADDSHIFT) % 32)) & 1;
84 endstate = (endstate >> 1) | (k << (d_k - 2 + d_ADDSHIFT));
85 data[((nbits + dif) % d_framebits)] = k;
91 return retval >> d_ADDSHIFT;
101#include <xmmintrin.h>
105 unsigned int framebits)
107 if (framebits < 12) {
112 int d_numstates = (1 << 6);
114 static unsigned char* D;
115 static unsigned char* Y;
116 static unsigned char* X;
117 static unsigned int excess = 6;
118 static unsigned char* Branchtab;
120 int d_polys[2] = { 79, 109 };
129 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
134 for (state = 0; state < d_numstates / 2; state++) {
135 for (
i = 0;
i < rate;
i++) {
136 Branchtab[
i * d_numstates / 2 + state] =
137 parity((2 * state) & d_polys[
i]) ? 255 : 0;
145 memset(X, 31, d_numstates);
148 memset(D, 0, (d_numstates / 8) * (framebits + 6));
151 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
153 unsigned int min = X[0];
154 int i = 0, state = 0;
155 for (
i = 0;
i < (d_numstates); ++
i) {
174 unsigned int framebits)
176 if (framebits < 12) {
181 int d_numstates = (1 << 6);
183 static unsigned char* D;
184 static unsigned char* Y;
185 static unsigned char* X;
186 static unsigned int excess = 6;
187 static unsigned char* Branchtab;
189 int d_polys[2] = { 79, 109 };
198 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
203 for (state = 0; state < d_numstates / 2; state++) {
204 for (
i = 0;
i < rate;
i++) {
205 Branchtab[
i * d_numstates / 2 + state] =
206 parity((2 * state) & d_polys[
i]) ? 255 : 0;
214 memset(X, 31, d_numstates);
217 memset(D, 0, (d_numstates / 8) * (framebits + 6));
220 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
222 unsigned int min = X[0];
223 int i = 0, state = 0;
224 for (
i = 0;
i < (d_numstates); ++
i) {
241#include <immintrin.h>
244static inline void volk_8u_conv_k7_r2puppet_8u_avx2(
unsigned char* dec,
246 unsigned int framebits)
248 if (framebits < 12) {
253 int d_numstates = (1 << 6);
255 static unsigned char* D;
256 static unsigned char* Y;
257 static unsigned char* X;
258 static unsigned int excess = 6;
259 static unsigned char* Branchtab;
261 int d_polys[2] = { 79, 109 };
270 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
275 for (state = 0; state < d_numstates / 2; state++) {
276 for (
i = 0;
i < rate;
i++) {
277 Branchtab[
i * d_numstates / 2 + state] =
278 parity((2 * state) & d_polys[
i]) ? 255 : 0;
286 memset(X, 31, d_numstates);
289 memset(D, 0, (d_numstates / 8) * (framebits + 6));
291 volk_8u_x4_conv_k7_r2_8u_avx2(
292 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
294 unsigned int min = X[0];
295 int i = 0, state = 0;
296 for (
i = 0;
i < (d_numstates); ++
i) {
316 unsigned int framebits)
318 if (framebits < 12) {
323 int d_numstates = (1 << 6);
325 static unsigned char* Y;
326 static unsigned char* X;
327 static unsigned char* D;
328 static unsigned int excess = 6;
329 static unsigned char* Branchtab;
331 int d_polys[2] = { 79, 109 };
340 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
346 for (state = 0; state < d_numstates / 2; state++) {
347 for (
i = 0;
i < rate;
i++) {
348 Branchtab[
i * d_numstates / 2 + state] =
349 parity((2 * state) & d_polys[
i]) ? 255 : 0;
357 memset(X, 31, d_numstates);
360 memset(D, 0, (d_numstates / 8) * (framebits + 6));
363 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
365 unsigned int min = X[0];
366 int i = 0, state = 0;
367 for (
i = 0;
i < (d_numstates); ++
i) {
382#include <riscv_vector.h>
384static inline void volk_8u_conv_k7_r2puppet_8u_rvv(
unsigned char* dec,
386 unsigned int framebits)
391 int d_numstates = (1 << 6);
392 static unsigned char* D;
393 static unsigned char* Y;
394 static unsigned char* X;
395 static unsigned int excess = 6;
396 static unsigned char* Branchtab;
404 Branchtab = Y + d_numstates;
405 D = (
unsigned char*)
volk_malloc((d_numstates / 8) * (framebits + 6),
409 for (
size_t state = 0; state < d_numstates / 2; state++) {
410 Branchtab[state] =
parity(state & 39) * 255;
411 Branchtab[state + d_numstates / 2] =
parity(state & 54) * 255;
415 memset(X, 31, d_numstates);
416 memset(D, 0, (d_numstates / 8) * (framebits + 6));
418 volk_8u_x4_conv_k7_r2_8u_rvv(
419 Y, X, syms, D, framebits / 2 - excess, excess, Branchtab);
421 unsigned int min = X[0];
422 int i = 0, state = 0;
423 for (
i = 0;
i < d_numstates; ++
i) {
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 int parity(int x)
Definition volk_8u_conv_k7_r2puppet_8u.h:23
static void volk_8u_conv_k7_r2puppet_8u_neonspiral(unsigned char *dec, unsigned char *syms, unsigned int framebits)
Definition volk_8u_conv_k7_r2puppet_8u.h:172
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:33
static void volk_8u_conv_k7_r2puppet_8u_spiral(unsigned char *dec, unsigned char *syms, unsigned int framebits)
Definition volk_8u_conv_k7_r2puppet_8u.h:103
static void volk_8u_conv_k7_r2puppet_8u_generic(unsigned char *dec, unsigned char *syms, unsigned int framebits)
Definition volk_8u_conv_k7_r2puppet_8u.h:314
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:212
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:310
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:443
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