1 #ifndef INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
2 #define INCLUDED_volk_8u_conv_k7_r2puppet_8u_H
14 static inline int parity(
int x,
unsigned char* Partab)
23 unsigned int endstate,
24 unsigned int tailsize,
25 unsigned char* decisions)
29 int d_numstates = (1 << 6);
30 int d_decision_t_size = d_numstates/8;
32 int d_framebits = nbits;
39 endstate = (endstate%d_numstates) << d_ADDSHIFT;
46 d += tailsize * d_decision_t_size ;
48 int dif = tailsize - (d_k - 1);
51 while(nbits-- > d_framebits - (d_k - 1)) {
53 dec.
t = &d[nbits * d_decision_t_size];
54 k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1;
56 endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT));
59 data[((nbits+dif)%d_framebits)] = k;
68 dec.t = &d[nbits * d_decision_t_size];
70 k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1;
72 endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT));
73 data[((nbits+dif)%d_framebits)] = k;
78 return retval >> d_ADDSHIFT;
84 #include <pmmintrin.h>
85 #include <emmintrin.h>
86 #include <xmmintrin.h>
94 static inline void volk_8u_conv_k7_r2puppet_8u_spiral(
unsigned char* syms,
unsigned char* dec,
unsigned int framebits) {
98 int d_numstates = (1 << 6);
100 static unsigned char* D;
101 static unsigned char* Y;
102 static unsigned char* X;
103 static unsigned int excess = 6;
104 static unsigned char* Branchtab;
105 static unsigned char Partab[256];
107 int d_polys[2] = {79, 109};
131 for(state=0;state < d_numstates/2;state++){
132 for(i=0; i<rate; i++){
133 Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^
parity((2*state) & abs(d_polys[i]), Partab) ? 255 : 0;
141 memset(X, 31, d_numstates);
143 volk_8u_x4_conv_k7_r2_8u_spiral(Y, X, syms, D, framebits/2 - excess, excess, Branchtab);
145 unsigned int min = X[0];
146 int i = 0, state = 0;
147 for(i = 0; i < (d_numstates); ++i) {
168 static inline void volk_8u_conv_k7_r2puppet_8u_generic(
unsigned char* syms,
unsigned char* dec,
unsigned int framebits) {
173 int d_numstates = (1 << 6);
175 static unsigned char* Y;
176 static unsigned char* X;
177 static unsigned char* D;
178 static unsigned int excess = 6;
179 static unsigned char* Branchtab;
180 static unsigned char Partab[256];
182 int d_polys[2] = {79, 109};
207 for(state=0;state < d_numstates/2;state++){
208 for(i=0; i<rate; i++){
209 Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^
parity((2*state) & abs(d_polys[i]), Partab) ? 255 : 0;
220 memset(X, 31, d_numstates);
222 volk_8u_x4_conv_k7_r2_8u_generic(Y, X, syms, D, framebits/2 - excess, excess, Branchtab);
224 unsigned int min = X[0];
225 int i = 0, state = 0;
226 for(i = 0; i < (d_numstates); ++i) {
unsigned char * t
Definition: volk_8u_conv_k7_r2puppet_8u.h:10
float min(float a, float b)
Definition: volk_8u_conv_k7_r2puppet_8u.h:8
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:21
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:14
unsigned int * w
Definition: volk_8u_conv_k7_r2puppet_8u.h:11