1 #ifndef INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
2 #define INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
13 static inline int parity(
int x,
unsigned char* Partab)
22 unsigned int endstate,
23 unsigned int tailsize,
24 unsigned char* decisions)
28 int d_numstates = (1 << 6);
29 int d_decision_t_size = d_numstates/8;
31 int d_framebits = nbits;
38 endstate = (endstate%d_numstates) << d_ADDSHIFT;
45 d += tailsize * d_decision_t_size ;
47 int dif = tailsize - (d_k - 1);
50 while(nbits-- > d_framebits - (d_k - 1)) {
52 dec.
t = &d[nbits * d_decision_t_size];
53 k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1;
55 endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT));
58 data[((nbits+dif)%d_framebits)] = k;
67 dec.t = &d[nbits * d_decision_t_size];
69 k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1;
71 endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT));
72 data[((nbits+dif)%d_framebits)] = k;
77 return retval >> d_ADDSHIFT;
83 #include <pmmintrin.h>
84 #include <emmintrin.h>
85 #include <xmmintrin.h>
93 static inline void volk_8u_conv_k7_r2puppet_8u_spiral(
unsigned char* syms,
unsigned char* dec,
unsigned int framebits) {
97 int d_numstates = (1 << 6);
99 static unsigned char* D;
100 static unsigned char* Y;
101 static unsigned char* X;
102 static unsigned int excess = 6;
103 static unsigned char* Branchtab;
104 static unsigned char Partab[256];
106 int d_polys[2] = {79, 109};
130 for(state=0;state < d_numstates/2;state++){
131 for(i=0; i<rate; i++){
132 Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^
parity((2*state) & abs(d_polys[i]), Partab) ? 255 : 0;
140 memset(X, 31, d_numstates);
142 volk_8u_x4_conv_k7_r2_8u_spiral(Y, X, syms, D, framebits/2 - excess, excess, Branchtab);
144 unsigned int min = X[0];
145 int i = 0, state = 0;
146 for(i = 0; i < (d_numstates); ++i) {
167 static inline void volk_8u_conv_k7_r2puppet_8u_generic(
unsigned char* syms,
unsigned char* dec,
unsigned int framebits) {
172 int d_numstates = (1 << 6);
174 static unsigned char* Y;
175 static unsigned char* X;
176 static unsigned char* D;
177 static unsigned int excess = 6;
178 static unsigned char* Branchtab;
179 static unsigned char Partab[256];
181 int d_polys[2] = {79, 109};
206 for(state=0;state < d_numstates/2;state++){
207 for(i=0; i<rate; i++){
208 Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^
parity((2*state) & abs(d_polys[i]), Partab) ? 255 : 0;
219 memset(X, 31, d_numstates);
221 volk_8u_x4_conv_k7_r2_8u_generic(Y, X, syms, D, framebits/2 - excess, excess, Branchtab);
223 unsigned int min = X[0];
224 int i = 0, state = 0;
225 for(i = 0; i < (d_numstates); ++i) {
unsigned char * t
Definition: volk_8u_conv_k7_r2puppet_8u.h:9
float min(float a, float b)
Definition: volk_8u_conv_k7_r2puppet_8u.h:7
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:20
VOLK_API size_t volk_get_alignment(void)
Get the machine alignment in bytes.
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
static int parity(int x, unsigned char *Partab)
Definition: volk_8u_conv_k7_r2puppet_8u.h:13
unsigned int * w
Definition: volk_8u_conv_k7_r2puppet_8u.h:10