MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / _encode

Method _encode

src/Module/Encoder/LDPC/From_QC/Encoder_LDPC_from_QC.cpp:38–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template<typename B>
38void
39Encoder_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
62template<typename B>
63void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected