| 36 | |
| 37 | template<typename B> |
| 38 | void |
| 39 | Encoder_LDPC_from_QC<B>::_encode(const B* U_K, B* X_N, const size_t /*frame_id*/) |
| 40 | { |
| 41 | int M = this->N - this->K; |
| 42 | |
| 43 | // Systematic part |
| 44 | std::copy_n(U_K, this->K, X_N); |
| 45 | |
| 46 | // Calculate parity part |
| 47 | mipp::vector<int8_t> parity(M, 0); |
| 48 | |
| 49 | for (auto i = 0; i < M; i++) |
| 50 | for (auto& l : this->H.get_rows_from_col(i)) |
| 51 | if (l < (unsigned)this->K) parity[i] ^= U_K[l]; |
| 52 | |
| 53 | auto* X_N_ptr = X_N + this->K; |
| 54 | for (auto i = 0; i < M; i++) |
| 55 | { |
| 56 | X_N_ptr[i] = 0; |
| 57 | for (auto j = 0; j < M; j++) |
| 58 | X_N_ptr[i] ^= parity[j] & invH2[i][j]; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | template<typename B> |
| 63 | void |
nothing calls this directly
no outgoing calls
no test coverage detected