| 195 | |
| 196 | template<typename B> |
| 197 | void |
| 198 | Encoder_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 | |
| 224 | template<typename B> |
| 225 | void |
nothing calls this directly
no outgoing calls
no test coverage detected