libosmocore
1.9.2
Osmocom core library
|
Go to the documentation of this file.
25 #ifndef __always_inline
26 #define __always_inline inline __attribute__((always_inline))
29 #define NEON_BUTTERFLY(M0,M1,M2,M3,M4) \
31 M3 = vqaddq_s16(M0, M2); \
32 M4 = vqsubq_s16(M1, M2); \
33 M0 = vqsubq_s16(M0, M2); \
34 M1 = vqaddq_s16(M1, M2); \
35 M2 = vmaxq_s16(M3, M4); \
36 M3 = vreinterpretq_s16_u16(vcgtq_s16(M3, M4)); \
37 M4 = vmaxq_s16(M0, M1); \
38 M1 = vreinterpretq_s16_u16(vcgtq_s16(M0, M1)); \
41 #define NEON_DEINTERLEAVE_K5(M0,M1,M2,M3) \
44 tmp = vuzpq_s16(M0, M1); \
49 #define NEON_DEINTERLEAVE_K7(M0,M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15) \
52 tmp = vuzpq_s16(M0, M1); \
53 M8 = tmp.val[0]; M9 = tmp.val[1]; \
54 tmp = vuzpq_s16(M2, M3); \
55 M10 = tmp.val[0]; M11 = tmp.val[1]; \
56 tmp = vuzpq_s16(M4, M5); \
57 M12 = tmp.val[0]; M13 = tmp.val[1]; \
58 tmp = vuzpq_s16(M6, M7); \
59 M14 = tmp.val[0]; M15 = tmp.val[1]; \
62 #define NEON_BRANCH_METRIC_N2(M0,M1,M2,M3,M4,M6,M7) \
64 M0 = vmulq_s16(M4, M0); \
65 M1 = vmulq_s16(M4, M1); \
66 M2 = vmulq_s16(M4, M2); \
67 M3 = vmulq_s16(M4, M3); \
68 M6 = vcombine_s16(vpadd_s16(vget_low_s16(M0), vget_high_s16(M0)), vpadd_s16(vget_low_s16(M1), vget_high_s16(M1))); \
69 M7 = vcombine_s16(vpadd_s16(vget_low_s16(M2), vget_high_s16(M2)), vpadd_s16(vget_low_s16(M3), vget_high_s16(M3))); \
72 #define NEON_BRANCH_METRIC_N4(M0,M1,M2,M3,M4,M5) \
74 M0 = vmulq_s16(M4, M0); \
75 M1 = vmulq_s16(M4, M1); \
76 M2 = vmulq_s16(M4, M2); \
77 M3 = vmulq_s16(M4, M3); \
78 int16x4_t t1 = vpadd_s16(vpadd_s16(vget_low_s16(M0), vget_high_s16(M0)), vpadd_s16(vget_low_s16(M1), vget_high_s16(M1))); \
79 int16x4_t t2 = vpadd_s16(vpadd_s16(vget_low_s16(M2), vget_high_s16(M2)), vpadd_s16(vget_low_s16(M3), vget_high_s16(M3))); \
80 M5 = vcombine_s16(t1, t2); \
83 #define NEON_NORMALIZE_K5(M0,M1,M2,M3) \
85 M2 = vminq_s16(M0, M1); \
86 int16x4_t t = vpmin_s16(vget_low_s16(M2), vget_high_s16(M2)); \
87 t = vpmin_s16(t, t); \
88 t = vpmin_s16(t, t); \
89 M2 = vdupq_lane_s16(t, 0); \
90 M0 = vqsubq_s16(M0, M2); \
91 M1 = vqsubq_s16(M1, M2); \
94 #define NEON_NORMALIZE_K7(M0,M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11) \
96 M8 = vminq_s16(M0, M1); \
97 M9 = vminq_s16(M2, M3); \
98 M10 = vminq_s16(M4, M5); \
99 M11 = vminq_s16(M6, M7); \
100 M8 = vminq_s16(M8, M9); \
101 M10 = vminq_s16(M10, M11); \
102 M8 = vminq_s16(M8, M10); \
103 int16x4_t t = vpmin_s16(vget_low_s16(M8), vget_high_s16(M8)); \
104 t = vpmin_s16(t, t); \
105 t = vpmin_s16(t, t); \
106 M8 = vdupq_lane_s16(t, 0); \
107 M0 = vqsubq_s16(M0, M8); \
108 M1 = vqsubq_s16(M1, M8); \
109 M2 = vqsubq_s16(M2, M8); \
110 M3 = vqsubq_s16(M3, M8); \
111 M4 = vqsubq_s16(M4, M8); \
112 M5 = vqsubq_s16(M5, M8); \
113 M6 = vqsubq_s16(M6, M8); \
114 M7 = vqsubq_s16(M7, M8); \
120 int16_t *__restrict out = __builtin_assume_aligned(outa, 8);
121 int16_t *__restrict sums = __builtin_assume_aligned(sumsa, 8);
122 int16x8_t m0, m1, m2, m3, m4, m5, m6;
126 input = vld1_s16(val);
127 m2 = vcombine_s16(input, input);
130 m0 = vld1q_s16(&out[0]);
131 m1 = vld1q_s16(&out[8]);
133 m0 = vmulq_s16(m2, m0);
134 m1 = vmulq_s16(m2, m1);
135 m2 = vcombine_s16(vpadd_s16(vget_low_s16(m0), vget_high_s16(m0)),
136 vpadd_s16(vget_low_s16(m1), vget_high_s16(m1)));
139 m0 = vld1q_s16(&sums[0]);
140 m1 = vld1q_s16(&sums[8]);
150 vst1q_s16(&sums[0], m2);
151 vst1q_s16(&sums[8], m6);
152 vst1q_s16(&
paths[0], m5);
153 vst1q_s16(&
paths[8], m4);
159 int16_t *__restrict out = __builtin_assume_aligned(outa, 8);
160 int16_t *__restrict sums = __builtin_assume_aligned(sumsa, 8);
161 int16x8_t m0, m1, m2, m3, m4, m5, m6;
165 input = vld1_s16(val);
166 m4 = vcombine_s16(input, input);
169 m0 = vld1q_s16(&out[0]);
170 m1 = vld1q_s16(&out[8]);
171 m2 = vld1q_s16(&out[16]);
172 m3 = vld1q_s16(&out[24]);
177 m0 = vld1q_s16(&sums[0]);
178 m1 = vld1q_s16(&sums[8]);
188 vst1q_s16(&sums[0], m2);
189 vst1q_s16(&sums[8], m6);
190 vst1q_s16(&
paths[0], m5);
191 vst1q_s16(&
paths[8], m4);
197 int16_t *__restrict out = __builtin_assume_aligned(outa, 8);
198 int16_t *__restrict sums = __builtin_assume_aligned(sumsa, 8);
199 int16x8_t m0, m1, m2, m3, m4, m5, m6, m7;
200 int16x8_t m8, m9, m10, m11, m12, m13, m14, m15;
204 m0 = vld1q_s16(&sums[0]);
205 m1 = vld1q_s16(&sums[8]);
206 m2 = vld1q_s16(&sums[16]);
207 m3 = vld1q_s16(&sums[24]);
208 m4 = vld1q_s16(&sums[32]);
209 m5 = vld1q_s16(&sums[40]);
210 m6 = vld1q_s16(&sums[48]);
211 m7 = vld1q_s16(&sums[56]);
214 NEON_DEINTERLEAVE_K7(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)
217 input = vld1_s16(val);
218 m7 = vcombine_s16(input, input);
221 m0 = vld1q_s16(&out[0]);
222 m1 = vld1q_s16(&out[8]);
223 m2 = vld1q_s16(&out[16]);
224 m3 = vld1q_s16(&out[24]);
228 m0 = vld1q_s16(&out[32]);
229 m1 = vld1q_s16(&out[40]);
230 m2 = vld1q_s16(&out[48]);
231 m3 = vld1q_s16(&out[56]);
239 vst1q_s16(&
paths[0], m0);
240 vst1q_s16(&
paths[8], m2);
241 vst1q_s16(&
paths[32], m9);
242 vst1q_s16(&
paths[40], m11);
248 vst1q_s16(&
paths[16], m0);
249 vst1q_s16(&
paths[24], m9);
250 vst1q_s16(&
paths[48], m13);
251 vst1q_s16(&
paths[56], m15);
254 NEON_NORMALIZE_K7(m4, m1, m5, m3, m6, m2, m7, m11, m0, m8, m9, m10)
256 vst1q_s16(&sums[0], m4);
257 vst1q_s16(&sums[8], m5);
258 vst1q_s16(&sums[16], m6);
259 vst1q_s16(&sums[24], m7);
260 vst1q_s16(&sums[32], m1);
261 vst1q_s16(&sums[40], m3);
262 vst1q_s16(&sums[48], m2);
263 vst1q_s16(&sums[56], m11);
269 int16_t *__restrict out = __builtin_assume_aligned(outa, 8);
270 int16_t *__restrict sums = __builtin_assume_aligned(sumsa, 8);
271 int16x8_t m0, m1, m2, m3, m4, m5, m6, m7;
272 int16x8_t m8, m9, m10, m11, m12, m13, m14, m15;
276 m0 = vld1q_s16(&sums[0]);
277 m1 = vld1q_s16(&sums[8]);
278 m2 = vld1q_s16(&sums[16]);
279 m3 = vld1q_s16(&sums[24]);
280 m4 = vld1q_s16(&sums[32]);
281 m5 = vld1q_s16(&sums[40]);
282 m6 = vld1q_s16(&sums[48]);
283 m7 = vld1q_s16(&sums[56]);
286 NEON_DEINTERLEAVE_K7(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)
289 input = vld1_s16(val);
290 m7 = vcombine_s16(input, input);
293 m0 = vld1q_s16(&out[0]);
294 m1 = vld1q_s16(&out[8]);
295 m2 = vld1q_s16(&out[16]);
296 m3 = vld1q_s16(&out[24]);
300 m0 = vld1q_s16(&out[32]);
301 m1 = vld1q_s16(&out[40]);
302 m2 = vld1q_s16(&out[48]);
303 m3 = vld1q_s16(&out[56]);
307 m0 = vld1q_s16(&out[64]);
308 m1 = vld1q_s16(&out[72]);
309 m2 = vld1q_s16(&out[80]);
310 m3 = vld1q_s16(&out[88]);
314 m0 = vld1q_s16(&out[96]);
315 m1 = vld1q_s16(&out[104]);
316 m2 = vld1q_s16(&out[112]);
317 m3 = vld1q_s16(&out[120]);
325 vst1q_s16(&
paths[0], m0);
326 vst1q_s16(&
paths[8], m2);
327 vst1q_s16(&
paths[32], m9);
328 vst1q_s16(&
paths[40], m11);
334 vst1q_s16(&
paths[16], m0);
335 vst1q_s16(&
paths[24], m9);
336 vst1q_s16(&
paths[48], m13);
337 vst1q_s16(&
paths[56], m15);
340 NEON_NORMALIZE_K7(m4, m1, m5, m3, m6, m2, m7, m11, m0, m8, m9, m10)
342 vst1q_s16(&sums[0], m4);
343 vst1q_s16(&sums[8], m5);
344 vst1q_s16(&sums[16], m6);
345 vst1q_s16(&sums[24], m7);
346 vst1q_s16(&sums[32], m1);
347 vst1q_s16(&sums[40], m3);
348 vst1q_s16(&sums[48], m2);
349 vst1q_s16(&sums[56], m11);
uint8_t * state_history
state history [len][n_states]
Definition: conv.h:113
static __attribute__((constructor(101)))
Definition: context.c:42
int i_idx
Next input bit index.
Definition: conv.h:78
int num_states
Definition: conv_acc.c:164
static void acs_butterfly(int state, int num_states, int16_t metric, int16_t *sum, int16_t *new_sum, int16_t *path)
Definition: conv_acc_generic.c:32
uint64_t bitvec_read_field(struct bitvec *bv, unsigned int *read_index, unsigned int len)
read part of the vector
Definition: bitvec.c:476
int p_idx
puncture index
Definition: conv.h:109
uint8_t * data
pointer to data array
Definition: bitvec.h:44
int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits)
get multiple bits (num_bits) from beginning of vector (MSB side)
Definition: bitvec.c:249
int n
Definition: conv_acc.c:180
struct log_target * osmo_stderr_target
the default logging target, logging to stderr
Definition: application.c:81
void log_add_target(struct log_target *target)
Register a new log target with the logging core.
Definition: logging.c:794
int p_idx
Current puncture index.
Definition: conv.h:79
int bitvec_get_bytes(struct bitvec *bv, uint8_t *bytes, unsigned int count)
get multiple bytes from current pos Assumes MSB first encoding.
Definition: bitvec.c:325
int bitvec_get_bit_high(struct bitvec *bv)
get the next bit (low/high) inside a bitvec
Definition: bitvec.c:182
int osmo_ubit2pbit(pbit_t *out, const ubit_t *in, unsigned int num_bits)
convert unpacked bits to packed bits, return length in bytes
Definition: bits.c:41
enum osmo_conv_term term
Termination type.
Definition: conv.h:53
unsigned int * ae_next
next accumulated error (tmp in scan)
Definition: conv.h:112
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum, enum bit_value bit)
set a bit at given position in a bit vector
Definition: bitvec.c:143
static void _osmo_backtrace(int use_printf, int subsys, int level)
Definition: backtrace.c:32
int osmo_t4_encode(struct bitvec *bv)
encode bit vector in-place using T4 encoding Assumes MSB first encoding.
Definition: bitcomp.c:312
static void _traceback(struct vdecoder *dec, unsigned state, uint8_t *out, int len)
Definition: conv_acc.c:454
static int depuncture(const int8_t *in, const int *punc, int8_t *out, int len)
Definition: conv_acc.c:627
int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits)
convert packed bits to unpacked bits, return length in bytes
Definition: bits.c:142
uint8_t state
Current state.
Definition: conv.h:80
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr)
check if the bit is 0 or 1 for a given position inside a bitvec
Definition: bitvec.c:77
static size_t len(const char *str)
unsigned int bitvec_pack(const struct bitvec *bv, uint8_t *buffer)
Export a bit vector to a buffer.
Definition: bitvec.c:429
@ ZERO
A zero (0) bit.
Definition: bitvec.h:34
int osmo_init_logging2(void *ctx, const struct log_info *log_info)
Definition: application.c:116
write Write running configuration to or terminal n Write configuration to the copy running config startup Copy configuration n Copy running config to n Copy running config to startup write Write running configuration to or terminal n Write to terminal n
#define OSMO_ASSERT(exp)
Helper macro to terminate when an assertion fails.
Definition: utils.h:113
int bitvec_set_bit(struct bitvec *bv, enum bit_value bit)
set the next bit inside a bitvec
Definition: bitvec.c:169
char subsys[16]
logging sub-system
Definition: gsmtap.h:11
int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val)
find first bit set in bit vector
Definition: bitvec.c:305
static int vdec_init(struct vdecoder *dec, const struct osmo_conv_code *code)
Definition: conv_acc.c:550
void bitvec_free(struct bitvec *bv)
Free a bit vector (release its memory)
Definition: bitvec.c:417
void osmo_conv_encode_init(struct osmo_conv_encoder *encoder, const struct osmo_conv_code *code)
Initialize a convolutional encoder.
Definition: conv.c:83
int len
Definition: conv_acc.c:182
void osmo_conv_decode_reset(struct osmo_conv_decoder *decoder, int start_state)
Definition: conv.c:270
#define NEON_BUTTERFLY(M0, M1, M2, M3, M4)
Definition: conv_acc_neon_impl.h:29
int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count)
set multiple bits (based on array of bitvals) at current pos
Definition: bitvec.c:198
void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, unsigned int num_nibbles)
Shift unaligned input to octet-aligned output.
Definition: bits.c:96
#define NEON_DEINTERLEAVE_K5(M0, M1, M2, M3)
Definition: conv_acc_neon_impl.h:41
int len
Max o_idx (excl.
Definition: conv.h:106
unsigned int data_len
length of data array in bytes
Definition: bitvec.h:43
bit_value
A single GSM bit.
Definition: bitvec.h:33
convolutional encoder state
Definition: conv.h:76
#define BIT2NRZ(REG, N)
Definition: conv_acc.c:29
Logging configuration, passed to log_init.
Definition: logging.h:258
int osmo_conv_decode_get_output(struct osmo_conv_decoder *decoder, ubit_t *output, int has_flush, int end_state)
Definition: conv.c:578
int osmo_ctx_init(const char *id)
Definition: context.c:26
struct log_target * log_target_create_stderr(void)
Create the STDERR log target.
Definition: logging.c:1094
static unsigned bitswap6(unsigned v)
Definition: conv_acc.c:237
__always_inline void _neon_metrics_k5_n4(const int16_t *val, const int16_t *outa, int16_t *sumsa, int16_t *paths, int norm)
Definition: conv_acc_neon_impl.h:156
int osmo_conv_decode_acc(const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output)
Definition: conv_acc.c:731
const uint8_t * next_term_state
Flush termination state
Definition: conv.h:59
int intrvl
Definition: conv_acc.c:184
static unsigned bitswap2(unsigned v)
Definition: conv_acc.c:214
int o_idx
output index
Definition: conv.h:108
int recursive
Definition: conv_acc.c:183
static void gen_branch_metrics_n4(int num_states, const int8_t *seq, const int16_t *out, int16_t *metrics)
Definition: conv_acc_generic.c:90
int osmo_conv_encode(const struct osmo_conv_code *code, const ubit_t *input, ubit_t *output)
All-in-one convolutional encoding function.
Definition: conv.c:207
const struct osmo_conv_code * code
for which code?
Definition: conv.h:102
static int gen_state_info(uint8_t *val, unsigned reg, int16_t *output, const struct osmo_conv_code *code)
Definition: conv_acc.c:287
#define NEON_BRANCH_METRIC_N4(M0, M1, M2, M3, M4, M5)
Definition: conv_acc_neon_impl.h:72
void osmo_revbytebits_buf(uint8_t *buf, int len)
reverse bit-order of each byte in a buffer
Definition: bits.c:305
int osmo_daemonize(void)
Turn the current process into a background daemon.
Definition: application.c:139
unsigned int * ae
accumulated error
Definition: conv.h:111
void bitvec_shiftl(struct bitvec *bv, unsigned n)
Shifts bitvec to the left, n MSB bits lost.
Definition: bitvec.c:645
struct vtrellis trellis
Definition: conv_acc.c:185
static void forward_traverse(struct vdecoder *dec, const int8_t *seq)
Definition: conv_acc.c:649
int8_t sbit_t
soft bit with value (-127...127), as commonly used in communications receivers such as [viterbi] deco...
Definition: bits.h:21
int log_targets_reopen(void)
close and re-open all log files (for log file rotation)
Definition: logging.c:1413
void osmo_init_ignore_signals(void)
Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO.
Definition: application.c:89
uint8_t level
logging level
Definition: gsmtap.h:8
#define NEON_ALIGN
Definition: conv_acc_neon.c:33
static uint16_t osmo_load16be(const void *p)
load unaligned 16-bit integer (big-endian encoding)
Definition: bit16gen.h:108
#define NUM_STATES(K)
Definition: conv_acc.c:30
int16_t ** paths
Definition: conv_acc.c:186
const uint8_t(* next_output)[2]
Next output array.
Definition: conv.h:55
#define __always_inline
Definition: conv_acc_neon_impl.h:26
structure representing a logging target
Definition: logging.h:300
__attribute__((visibility("hidden")))
Definition: conv_acc_neon.c:42
void(* metric_func)(const int8_t *, const int16_t *, int16_t *, int16_t *, int)
Definition: conv_acc.c:188
per-thread talloc contexts.
Definition: talloc.h:10
int16_t * outputs
Definition: conv_acc.c:166
static int traceback(struct vdecoder *dec, uint8_t *out, int term, int len)
Definition: conv_acc.c:484
#define NEON_BRANCH_METRIC_N2(M0, M1, M2, M3, M4, M6, M7)
Definition: conv_acc_neon_impl.h:62
static unsigned bitswap4(unsigned v)
Definition: conv_acc.c:225
convolutional decoder state
Definition: conv.h:101
void osmo_conv_encode_load_state(struct osmo_conv_encoder *encoder, const ubit_t *input)
Definition: conv.c:92
__attribute__((visibility("hidden")))
Definition: conv_acc.c:46
void osmo_panic(const char *fmt,...) __attribute__((noreturn))
Terminate the current program with a panic.
Definition: panic.c:71
static int init_complete
Definition: conv_acc.c:44
@ CONV_TERM_TAIL_BITING
Tail biting.
Definition: conv.h:39
int osmo_conv_get_output_length(const struct osmo_conv_code *code, int len)
Definition: conv.c:51
static const uint8_t flip_table[256]
Definition: bits.c:235
static __always_inline void _neon_metrics_k7_n2(const int16_t *val, const int16_t *outa, int16_t *sumsa, int16_t *paths, int norm)
Definition: conv_acc_neon_impl.h:194
uint32_t osmo_bit_reversal(uint32_t x, enum osmo_br_mode k)
generalized bit reversal function
Definition: bits.c:264
static unsigned bitswap3(unsigned v)
Definition: conv_acc.c:219
static int gen_recursive_state_info(uint8_t *val, unsigned reg, int16_t *output, const struct osmo_conv_code *code)
Definition: conv_acc.c:344
int osmo_conv_encode_flush(struct osmo_conv_encoder *encoder, ubit_t *output)
Definition: conv.c:162
static int t4_rle(struct bitvec *bv, unsigned len, bool b)
Make-up codes for a given length.
Definition: bitcomp.c:226
static int conv_code_recursive(const struct osmo_conv_code *code)
Definition: conv_acc.c:193
unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, unsigned int array_len, bool dry_run, unsigned int num_bits)
Add given array to bitvec.
Definition: bitvec.c:687
int osmo_conv_decode_scan(struct osmo_conv_decoder *decoder, const sbit_t *input, int n)
Definition: conv.c:321
uint32_t osmo_revbytebits_32(uint32_t x)
reverse the bit-order in each byte of a dword
Definition: bits.c:281
RFC 1521 base64 encoding/decoding.
int16_t * sums
Definition: conv_acc.c:165
int osmo_init_logging(const struct log_info *log_info)
Initialize the osmocom logging framework.
Definition: application.c:111
int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh)
set multiple bits (based on numeric value) at current pos.
Definition: bitvec.c:218
#define NEON_NORMALIZE_K5(M0, M1, M2, M3)
Definition: conv_acc_neon_impl.h:83
void osmo_conv_decode_rewind(struct osmo_conv_decoder *decoder)
Definition: conv.c:291
__always_inline void _neon_metrics_k5_n2(const int16_t *val, const int16_t *outa, int16_t *sumsa, int16_t *paths, int norm)
Definition: conv_acc_neon_impl.h:117
uint8_t pbit_t
packed bits (8 bits in a byte).
Definition: bits.h:30
static unsigned gen_output(struct vstate *state, int val, const struct osmo_conv_code *code)
Definition: conv_acc.c:270
static unsigned gen_recursive_output(struct vstate *state, uint8_t *val, unsigned reg, const struct osmo_conv_code *code, int pos)
Definition: conv_acc.c:312
static const unsigned t4_term[2][64]
Definition: bitcomp.c:39
uint32_t osmo_revbytebits_8(uint8_t x)
reverse the bit order in a byte
Definition: bits.c:294
uint32_t pid
process ID
Definition: gsmtap.h:7
void osmo_sbit2ubit(ubit_t *out, const sbit_t *in, unsigned int num_bits)
convert soft bits to unpacked bits
Definition: bits.c:129
if(vty->type==VTY_SHELL_SERV)
static int conv_decode(struct vdecoder *dec, const int8_t *seq, const int *punc, uint8_t *out, int len, int term)
Definition: conv_acc.c:667
struct abis_rsl_common_hdr c
int osmo_conv_decode(const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output)
All-in-one convolutional decoding function.
Definition: conv.c:642
int gsm48_generate_mid_from_tmsi *(uint8_t *buf, uint32_t tmsi) OSMO_DEPRECATED_OUTSIDE("Instead u l))
static void osmo_conv_init(void)
Definition: conv_acc.c:686
int osmo_conv_decode_flush(struct osmo_conv_decoder *decoder, const sbit_t *input)
Definition: conv.c:418
int bitvec_write_field(struct bitvec *bv, unsigned int *write_index, uint64_t val, unsigned int len)
write into the vector
Definition: bitvec.c:508
static void _traceback_rec(struct vdecoder *dec, unsigned state, uint8_t *out, int len)
Definition: conv_acc.c:467
structure describing a bit vector
Definition: bitvec.h:41
void bitvec_to_string_r(const struct bitvec *bv, char *str)
prints bit vector to provided string It's caller's responsibility to ensure that we won't shoot him i...
Definition: bitvec.c:541
static const unsigned t4_make_up[2][15]
Definition: bitcomp.c:184
int osmo_base64_decode(unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen)
Decode a base64-formatted buffer.
Definition: base64.c:121
void * global
global per-thread talloc context.
Definition: talloc.h:12
static const unsigned char base64_enc_map[64]
Definition: base64.c:25
static unsigned leading_bits(uint8_t x, bool b)
Definition: bitvec.c:555
int osmo_base64_encode(unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen)
Encode a buffer into base64 format.
Definition: base64.c:54
static const unsigned char base64_dec_map[128]
Definition: base64.c:35
void bitvec_shiftl(struct bitvec *bv, unsigned int n)
static void gen_branch_metrics_n2(int num_states, const int8_t *seq, const int16_t *out, int16_t *metrics)
Definition: conv_acc_generic.c:65
@ ONE
A one (1) bit.
Definition: bitvec.h:35
const uint8_t(* next_state)[2]
Next state array
Definition: conv.h:56
const struct osmo_conv_code * code
for which code?
Definition: conv.h:77
void osmo_generate_backtrace(void)
Generate and print a call back-trace.
Definition: backtrace.c:63
@ CONV_TERM_FLUSH
Flush encoder state.
Definition: conv.h:37
int K
Constraint length.
Definition: conv.h:50
void osmo_conv_decode_init(struct osmo_conv_decoder *decoder, const struct osmo_conv_code *code, int len, int start_state)
Definition: conv.c:241
__attribute__((visibility("hidden")))
Definition: conv_acc_generic.c:130
int osmo_conv_get_input_length(const struct osmo_conv_code *code, int len)
Definition: conv.c:45
const int * puncture
Punctured bits indexes.
Definition: conv.h:61
static unsigned int bytenum_from_bitnum(unsigned int bitnum)
Definition: bitvec.c:48
int bitvec_set_bytes(struct bitvec *bv, const uint8_t *bytes, unsigned int count)
set multiple bytes at current pos Assumes MSB first encoding.
Definition: bitvec.c:361
uint8_t ubit_t
unpacked bit (0 or 1): 1 bit per byte
Definition: bits.h:24
#define ARRAY_SIZE(x)
Determine number of elements in an array of static size.
Definition: utils.h:19
static uint8_t bitval2mask(enum bit_value bit, uint8_t bitnum)
Definition: bitvec.c:56
int N
Inverse of code rate.
Definition: conv.h:49
static void gen_path_metrics(int num_states, int16_t *sums, int16_t *metrics, int16_t *paths, int norm)
Definition: conv_acc_generic.c:104
struct bitvec * bitvec_alloc(unsigned int size, void *bvctx)
Allocate a bit vector.
Definition: bitvec.c:398
const uint8_t * next_term_output
Flush termination output.
Definition: conv.h:58
static int generate_trellis(struct vdecoder *dec, const struct osmo_conv_code *code)
Definition: conv_acc.c:401
static void osmo_store16be(uint16_t x, void *p)
store unaligned 16-bit integer (big-endian encoding)
Definition: bit16gen.h:121
osmo_br_mode
bit-reversal mode for osmo_bit_reversal()
Definition: bits.h:93
int k
Definition: conv_acc.c:181
uint8_t * vals
Definition: conv_acc.c:167
static void free_trellis(struct vtrellis *trellis)
Definition: conv_acc.c:385
void bitvec_zero(struct bitvec *bv)
force bit vector to all 0 and current bit to the beginnig of the vector
Definition: bitvec.c:577
static const unsigned t4_term_length[2][64]
Definition: bitcomp.c:174
@ H
A CSN.1 "H" bit.
Definition: bitvec.h:37
static void vdec_deinit(struct vdecoder *dec)
Definition: conv_acc.c:533
int osmo_hexparse(const char *str, uint8_t *b, unsigned int max_len)
Parse a string containing hexadecimal digits.
Definition: utils.c:240
unsigned bitvec_rl(const struct bitvec *bv, bool b)
Return number (bits) of uninterrupted bit run in vector starting from the MSB.
Definition: bitvec.c:588
int osmo_conv_decode_get_best_end_state(struct osmo_conv_decoder *decoder)
Definition: conv.c:519
int log_init(const struct log_info *inf, void *talloc_ctx)
Initialize the Osmocom logging core.
Definition: logging.c:1443
enum bit_value bitvec_get_bit_pos_high(const struct bitvec *bv, unsigned int bitnr)
check if the bit is L or H for a given position inside a bitvec
Definition: bitvec.c:99
#define LOGP(ss, level, fmt, args...)
Log a new message through the Osmocom logging framework.
Definition: logging.h:49
int osmo_conv_encode_raw(struct osmo_conv_encoder *encoder, const ubit_t *input, ubit_t *output, int n)
Definition: conv.c:133
int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit)
pad all remaining bits up to a given bit number
Definition: bitvec.c:294
char bit_value_to_char(enum bit_value v)
convert enum to corresponding character
Definition: bitvec.c:526
static unsigned vstate_lshift(unsigned reg, int k, int val)
Definition: conv_acc.c:199
unsigned int cur_bit
cursor to the next unused bit
Definition: bitvec.h:42
int len
Definition: conv.h:51
void osmo_ubit2sbit(sbit_t *out, const ubit_t *in, unsigned int num_bits)
convert unpacked bits to soft bits
Definition: bits.c:117
static unsigned bitswap(unsigned v, unsigned n)
Definition: conv_acc.c:243
Definition: conv_acc.c:179
void osmo_log_backtrace(int subsys, int level)
Generate and log a call back-trace.
Definition: backtrace.c:75
#define NEON_DEINTERLEAVE_K7(M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15)
Definition: conv_acc_neon_impl.h:49
void * select
volatile select-dispatch context.
Definition: talloc.h:19
static int _conv_encode_do_output(struct osmo_conv_encoder *encoder, uint8_t out, ubit_t *output)
Definition: conv.c:105
static void gen_branch_metrics_n3(int num_states, const int8_t *seq, const int16_t *out, int16_t *metrics)
Definition: conv_acc_generic.c:77
int n_states
number of states
Definition: conv.h:104
int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count)
set multiple bits (based on numeric value) at current pos.
Definition: bitvec.c:242
int osmo_pbit2ubit_ext(ubit_t *out, unsigned int out_ofs, const pbit_t *in, unsigned int in_ofs, unsigned int num_bits, int lsb_mode)
convert packed bits to unpacked bits (extended options)
Definition: bits.c:212
int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits)
get multiple bits (based on numeric value) from current pos
Definition: bitvec.c:262
unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, unsigned int max_bits)
Return number (bits) of uninterrupted bit run in vector starting from the current bit.
Definition: bitvec.c:607
int osmo_ubit2pbit_ext(pbit_t *out, unsigned int out_ofs, const ubit_t *in, unsigned int in_ofs, unsigned int num_bits, int lsb_mode)
convert unpacked bits to packed bits (extended options)
Definition: bits.c:187
static void sighup_hdlr(int signal)
Definition: application.c:83
#define MAX_AE
Definition: conv.c:233
static __always_inline void _neon_metrics_k7_n4(const int16_t *val, const int16_t *outa, int16_t *sumsa, int16_t *paths, int norm)
Definition: conv_acc_neon_impl.h:266
static unsigned bitswap5(unsigned v)
Definition: conv_acc.c:231
void log_set_all_filter(struct log_target *target, int)
Enable the LOG_FLT_ALL log filter.
Definition: logging.c:842
void osmo_conv_decode_deinit(struct osmo_conv_decoder *decoder)
Definition: conv.c:311
structure describing a given convolutional code
Definition: conv.h:48
int bitvec_fill(struct bitvec *bv, unsigned int num_bits, enum bit_value fill)
fill num_bits with \fill starting from the current position
Definition: bitvec.c:282
#define INIT_POINTERS(simd)
Definition: conv_acc.c:32
#define NEON_NORMALIZE_K7(M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11)
Definition: conv_acc_neon_impl.h:94
int bitvec_unhex(struct bitvec *bv, const char *src)
read hexadecimap string into a bit vector
Definition: bitvec.c:456
Definition: conv_acc.c:163
unsigned int bitvec_unpack(struct bitvec *bv, const uint8_t *buffer)
Copy buffer of unpacked bits into bit vector.
Definition: bitvec.c:442
__thread struct osmo_talloc_contexts * osmo_ctx
Definition: context.c:24
unsigned int bitvec_get_nth_set_bit(const struct bitvec *bv, unsigned int n)
get the Nth set bit inside the bit vector
Definition: bitvec.c:122
static const unsigned t4_make_up_length[2][15]
Definition: bitcomp.c:179
@ L
A CSN.1 "L" bit.
Definition: bitvec.h:36
void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, unsigned int num_nibbles)
Shift unaligned input to octet-aligned output.
Definition: bits.c:69