From 10f2fcca8dd1be2719bccefa16fd9dac9a76c749 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 1 Dec 2008 10:28:04 +0530 Subject: [gsmdecode] import {interleave,conv}.[ch] from gsm-tvoid * change convolutional decode to cope with TCH * add tch.c file with reordering/decoding for TCH/F --- gsmstack/conv.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gsmstack/conv.h (limited to 'gsmstack/conv.h') diff --git a/gsmstack/conv.h b/gsmstack/conv.h new file mode 100644 index 0000000..4bd96a1 --- /dev/null +++ b/gsmstack/conv.h @@ -0,0 +1,24 @@ +/* This file was taken from gsm-tvoid */ +#ifndef _GSM_CONV_H +#define _GSM_CONV_H + +#define DATA_BLOCK_SIZE 184 +#define PARITY_SIZE 40 +#define FLUSH_BITS_SIZE 4 +#define PARITY_OUTPUT_SIZE (DATA_BLOCK_SIZE + PARITY_SIZE + FLUSH_BITS_SIZE) + +#define CONV_INPUT_SIZE_TCH_F 189 +#define CONV_INPUT_SIZE_CCH PARITY_OUTPUT_SIZE +#define CONV_MAX_INPUT_SIZE PARITY_OUTPUT_SIZE +#define CONV_SIZE (2 * CONV_MAX_INPUT_SIZE) + +#define BLOCKS 4 +#define iBLOCK_SIZE (CONV_SIZE / BLOCKS) +#define eBLOCK_SIZE (iBLOCK_SIZE + 2) + +int conv_decode(unsigned char *output, unsigned char *data, + unsigned int input_size); +int parity_check(unsigned char *data); +int compress_bits(unsigned char *dbuf, int dlen, unsigned char *src, int len); + +#endif /* _GSM_CONV_H */ -- cgit v1.2.3