| 73 | |
| 74 | template<typename B> |
| 75 | void |
| 76 | Encoder_LDPC_QC_fast<B>::_encode(const B* U_K, B* X_N, const size_t frame_id) |
| 77 | { |
| 78 | std::memcpy(X_N, U_K, sizeof(B) * this->K); |
| 79 | const int n_zeros_pad = this->K_LDPC - this->K; |
| 80 | std::memset(X_N + this->K, 0, sizeof(B) * n_zeros_pad); |
| 81 | |
| 82 | const int nb_blocks = (this->N - this->K_LDPC) / this->Zc; |
| 83 | bool first_time = true; |
| 84 | B* parity_bits = X_N + this->K_LDPC; |
| 85 | for (int i = 0; i < this->K_LDPC / this->Zc; i++) |
| 86 | { |
| 87 | const B* input_ptr = X_N + i * this->Zc; |
| 88 | const int base = nb_blocks * i; |
| 89 | for (int j = 0; j < nb_blocks; j++) |
| 90 | { |
| 91 | B* parity_block = parity_bits + j * this->Zc; |
| 92 | if (first_time) std::memset(parity_block, 0, sizeof(B) * this->Zc); |
| 93 | |
| 94 | const auto& shifts = this->rot[j + base]; |
| 95 | for (size_t k = 0; k < shifts.size(); k++) |
| 96 | { |
| 97 | const int shift = shifts[k]; |
| 98 | int start = this->Zc - shift; |
| 99 | int l = 0; |
| 100 | for (; l < shift; l++) |
| 101 | parity_block[l] ^= input_ptr[start + l]; |
| 102 | for (; l < this->Zc; l++) |
| 103 | parity_block[l] ^= input_ptr[l - shift]; |
| 104 | } |
| 105 | } |
| 106 | first_time = false; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | // ==================================================================================== explicit template instantiation |
| 111 | #include "Module/Encoder/LDPC/QC/Encoder_LDPC_QC_fast.hpp" |
nothing calls this directly
no outgoing calls
no test coverage detected