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

Method _encode

src/Module/Encoder/Turbo/Encoder_turbo_legacy.cpp:74–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73template<typename B>
74void
75Encoder_turbo_legacy<B>::_encode(const B* U_K, B* X_N, const size_t frame_id)
76{
77 this->pi->interleave(U_K - frame_id * this->K, this->U_K_i.data(), frame_id);
78 sub_enc->encode(U_K - frame_id * this->K, X_N_n.data(), frame_id);
79 sub_enc->encode(this->U_K_i.data(), X_N_i.data(), frame_id);
80
81 const auto off1 = ((3 * this->K + (2 * sub_enc->tail_length())) * frame_id) - (frame_id * this->N);
82 const auto off2 = (2 * this->K + (1 * sub_enc->tail_length())) * frame_id;
83 for (auto i = 0; i < this->K; i++)
84 {
85 X_N[off1 + 3 * i + 0] = X_N_n[off2 + 2 * i + 0];
86 X_N[off1 + 3 * i + 1] = X_N_n[off2 + 2 * i + 1];
87 X_N[off1 + 3 * i + 2] = X_N_i[off2 + 2 * i + 1];
88 }
89
90 const auto off1_tails_n = off1 + 3 * this->K;
91 const auto off2_tails_n = off2 + 2 * this->K;
92 for (auto i = 0; i < sub_enc->tail_length() / 2; i++)
93 {
94 X_N[off1_tails_n + 2 * i + 0] = X_N_n[off2_tails_n + 2 * i + 0];
95 X_N[off1_tails_n + 2 * i + 1] = X_N_n[off2_tails_n + 2 * i + 1];
96 }
97
98 const auto off1_tails_i = off1_tails_n + sub_enc->tail_length();
99 const auto off2_tails_i = off2_tails_n;
100 for (auto i = 0; i < sub_enc->tail_length() / 2; i++)
101 {
102 X_N[off1_tails_i + 2 * i + 0] = X_N_i[off2_tails_i + 2 * i + 0];
103 X_N[off1_tails_i + 2 * i + 1] = X_N_i[off2_tails_i + 2 * i + 1];
104 }
105}
106
107template<typename B>
108bool

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.80
tail_lengthMethod · 0.45

Tested by

no test coverage detected