| 42 | |
| 43 | template<typename B> |
| 44 | void |
| 45 | Encoder_repetition_sys<B>::_encode(const B* U_K, B* X_N, const size_t /*frame_id*/) |
| 46 | { |
| 47 | // repetition |
| 48 | if (buffered_encoding) |
| 49 | { |
| 50 | // systematic bits |
| 51 | std::copy(U_K, U_K + this->K, X_N); |
| 52 | |
| 53 | // parity bits |
| 54 | for (auto i = 1; i <= rep_count; i++) |
| 55 | std::copy(U_K, U_K + this->K, X_N + i * this->K); |
| 56 | } |
| 57 | else |
| 58 | { |
| 59 | for (auto i = 0; i < this->K; i++) |
| 60 | { |
| 61 | const auto off1 = i * (rep_count + 1); |
| 62 | const auto off2 = off1 + 1; |
| 63 | |
| 64 | const auto bit = U_K[i]; |
| 65 | |
| 66 | X_N[off1] = bit; // systematic bit |
| 67 | |
| 68 | // parity bits |
| 69 | for (auto j = 0; j < rep_count; j++) |
| 70 | X_N[off2 + j] = bit; |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | template<typename B> |
| 76 | bool |
nothing calls this directly
no outgoing calls
no test coverage detected