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