| 79 | |
| 80 | template<typename B, typename R> |
| 81 | int |
| 82 | Decoder_RA<B, R>::_decode_siho(const R* Y_N, B* V_K, const size_t frame_id) |
| 83 | { |
| 84 | // auto t_load = std::chrono::steady_clock::now(); // ----------------------------------------------------------- |
| 85 | // LOAD set F, B and Td at 0 |
| 86 | for (auto i = 0; i < this->N; i++) |
| 87 | { |
| 88 | Fw[i] = 0; |
| 89 | Bw[i] = 0; |
| 90 | Td[i] = 0; |
| 91 | } |
| 92 | // auto d_load = std::chrono::steady_clock::now() - t_load; |
| 93 | |
| 94 | // auto t_decod = std::chrono::steady_clock::now(); // -------------------------------------------------------- |
| 95 | // DECODE |
| 96 | for (auto iter = 0; iter < max_iter; iter++) |
| 97 | { |
| 98 | /////////////////// |
| 99 | // SISO decoding // |
| 100 | /////////////////// |
| 101 | |
| 102 | // Forward |
| 103 | Fw[0] = Td[0]; |
| 104 | for (auto i = 1; i < this->N; i++) |
| 105 | Fw[i] = check_node(Fw[i - 1] + Y_N[i - 1], Td[i]); |
| 106 | |
| 107 | // Backward |
| 108 | Bw[this->N - 2] = check_node(Y_N[this->N - 1], Td[this->N - 1]); |
| 109 | for (auto i = this->N - 3; i >= 0; i--) |
| 110 | Bw[i] = check_node(Bw[i + 1] + Y_N[i + 1], Td[i + 1]); |
| 111 | |
| 112 | // Extrinsic |
| 113 | Tu[0] = Bw[0] + Y_N[0]; |
| 114 | Tu[this->N - 1] = check_node(Fw[this->N - 2] + Y_N[this->N - 2], Y_N[this->N - 1]); |
| 115 | for (auto i = 1; i < this->N - 1; i++) |
| 116 | Tu[i] = check_node(Fw[i - 1] + Y_N[i - 1], Bw[i] + Y_N[i]); |
| 117 | |
| 118 | // Deinterleave |
| 119 | interleaver->deinterleave(Tu.data(), Wu.data(), frame_id, false); |
| 120 | |
| 121 | // U computation |
| 122 | R tmp; |
| 123 | for (auto i = 0; i < this->K; i++) |
| 124 | { |
| 125 | tmp = 0; |
| 126 | for (auto j = 0; j < rep_count; j++) |
| 127 | tmp += Wu[i * rep_count + j]; |
| 128 | for (auto j = 0; j < rep_count; j++) |
| 129 | Wd[i * rep_count + j] = tmp - Wu[i * rep_count + j]; |
| 130 | U[i] = tmp; |
| 131 | } |
| 132 | |
| 133 | // Interleaving |
| 134 | interleaver->interleave(Wd.data(), Td.data(), frame_id, false); |
| 135 | } |
| 136 | // auto d_decod = std::chrono::steady_clock::now() - t_decod; |
| 137 | |
| 138 | // auto t_store = std::chrono::steady_clock::now(); // --------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected