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

Method __encode_from_state

src/Module/Encoder/RSC_DB/Encoder_RSC_DB.cpp:197–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195
196template<typename B>
197void
198Encoder_RSC_DB<B>::__encode_from_state(const B* U_K,
199 B* X_N,
200 const bool only_parity,
201 const int init_state,
202 int& end_state)
203{
204 // clang-format off
205 auto j = 0; // cur offset in X_N buffer
206 auto state = init_state;
207 for (auto i = 0; i < this->K; i += 2)
208 {
209 auto in = U_K[i] * 2 + U_K[i + 1];
210 auto parity = out_parity[in][state];
211 state = next_state[in][state];
212 if (!only_parity)
213 {
214 X_N[j++] = U_K[i];
215 X_N[j++] = U_K[i + 1];
216 }
217 X_N[j++] = (parity >> 1) & 1;
218 X_N[j++] = (parity) & 1;
219 }
220 end_state = state;
221 // clang-format on
222}
223
224template<typename B>
225void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected