From dae7afb517cfcaf3f25aa4b50a262d679f3e365f Mon Sep 17 00:00:00 2001 From: 4g5g Consultants Date: Thu, 11 Jan 2024 19:50:19 +0530 Subject: [PATCH] ldpc rate recovery patch --- src/UpperPHY/LDPC/ldpc_rate_recovery.cpp | 6 ++++++ test/LDPC/rate_recovery/main.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/UpperPHY/LDPC/ldpc_rate_recovery.cpp b/src/UpperPHY/LDPC/ldpc_rate_recovery.cpp index 400bd64..c46165e 100644 --- a/src/UpperPHY/LDPC/ldpc_rate_recovery.cpp +++ b/src/UpperPHY/LDPC/ldpc_rate_recovery.cpp @@ -43,6 +43,12 @@ void undo_selection(uint32_t z, uint32_t n, uint32_t e, out[k0] = in[k_idx++]; } } + + // set filler bits + if (len_filler_bits > 0) { + memset(&out[len_s_bits], INT8_MAX, len_filler_bits * sizeof(int8_t)); + } + // offset k0 to skip filler bits if (k0 >= len_s_bits && k0 < len_s_bits + len_filler_bits) { k0 = len_s_bits + len_filler_bits; diff --git a/test/LDPC/rate_recovery/main.cpp b/test/LDPC/rate_recovery/main.cpp index 3a399b1..1993a3d 100644 --- a/test/LDPC/rate_recovery/main.cpp +++ b/test/LDPC/rate_recovery/main.cpp @@ -39,6 +39,12 @@ void ref_undo_selection(uint32_t z, uint32_t n, uint32_t e, out[k0] = in[k_idx++]; } } + + // set filler bits + if (len_filler_bits > 0) { + memset(&out[len_s_bits], INT8_MAX, len_filler_bits * sizeof(int8_t)); + } + // offset k0 to skip filler bits if (k0 >= len_s_bits && k0 < len_s_bits + len_filler_bits) { k0 = len_s_bits + len_filler_bits; @@ -267,7 +273,7 @@ bool test_ref_rate_recovery() { passed &= (in_filler[j] == out_filler[i]); j++; } else if ((i >= (z * 10 - 2 * z - f)) && (i < (z * 10 - 2 * z))) { - passed &= (0 == out_filler[i]); + passed &= (INT8_MAX == out_filler[i]); } else if (n <= e) { passed &= (in_filler[j] == out_filler[i]); j++; -- GitLab