mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.8 KiB
C
82 lines
2.8 KiB
C
4 years ago
|
/**
|
||
11 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
11 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
11 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
11 years ago
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: bit.h
|
||
|
*
|
||
|
* Description: Bit-level utilities.
|
||
|
*
|
||
|
* Reference:
|
||
|
*****************************************************************************/
|
||
11 years ago
|
|
||
4 years ago
|
#ifndef SRSRAN_BIT_H
|
||
|
#define SRSRAN_BIT_H
|
||
11 years ago
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
11 years ago
|
|
||
7 years ago
|
typedef struct {
|
||
5 years ago
|
uint32_t nof_bits;
|
||
|
uint16_t* interleaver;
|
||
|
uint16_t* byte_idx;
|
||
|
uint8_t* bit_mask;
|
||
|
uint8_t n_128;
|
||
4 years ago
|
} srsran_bit_interleaver_t;
|
||
7 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_interleaver_init(srsran_bit_interleaver_t* q, uint16_t* interleaver, uint32_t nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_interleaver_free(srsran_bit_interleaver_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void
|
||
|
srsran_bit_interleaver_run(srsran_bit_interleaver_t* q, uint8_t* input, uint8_t* output, uint16_t w_offset);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_interleave(uint8_t* input, uint8_t* output, uint16_t* interleaver, uint32_t nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void
|
||
|
srsran_bit_copy(uint8_t* dst, uint32_t dst_offset, uint8_t* src, uint32_t src_offset, uint32_t nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_interleave_i(uint8_t* input, uint8_t* output, uint32_t* interleaver, uint32_t nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_interleave_i_w_offset(uint8_t* input,
|
||
5 years ago
|
uint8_t* output,
|
||
|
uint32_t* interleaver,
|
||
|
uint32_t nof_bits,
|
||
|
uint32_t w_offset);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_interleave_w_offset(uint8_t* input,
|
||
5 years ago
|
uint8_t* output,
|
||
|
uint16_t* interleaver,
|
||
|
uint32_t nof_bits,
|
||
|
uint32_t w_offset);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_unpack_vector(const uint8_t* packed, uint8_t* unpacked, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_pack_vector(uint8_t* unpacked, uint8_t* packed, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API uint32_t srsran_bit_pack(uint8_t** bits, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API uint64_t srsran_bit_pack_l(uint8_t** bits, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_unpack_l(uint64_t value, uint8_t** bits, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_unpack(uint32_t value, uint8_t** bits, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_bit_fprint(FILE* stream, uint8_t* bits, int nof_bits);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API uint32_t srsran_bit_diff(const uint8_t* x, const uint8_t* y, int nbits);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API uint32_t srsran_bit_count(uint32_t n);
|
||
11 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_BIT_H
|