New LSF puncture matrix (P1).

master
Rob Riggs 2021-08-29 20:37:22 -05:00
rodzic b2977c66a4
commit facdd74307
1 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -14,13 +14,20 @@ namespace mobilinkd
{ {
/// Puncture matrix for linx setup frame. /// Puncture matrix for linx setup frame.
inline constexpr auto P1 = std::experimental::make_array<int8_t>( inline constexpr std::array<int8_t, 61> make_p1() {
1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, std::array<int8_t, 61> result{};
1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, for (size_t i = 0, j = 2; i != 61; ++i) {
1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, if (i == j) {
0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, result[i] = 0;
0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, j += 4;
1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1); } else {
result[i] = 1;
}
}
return result;
};
inline constexpr auto P1 = make_p1();
/// Puncture matrix for audio frames. /// Puncture matrix for audio frames.
inline constexpr auto P2 = std::experimental::make_array<int8_t>( inline constexpr auto P2 = std::experimental::make_array<int8_t>(