diff --git a/src/UpperPHY/LDPC/ldpc_rate_recovery.cpp b/src/UpperPHY/LDPC/ldpc_rate_recovery.cpp index 400bd640cb26689a21d77a00ed2d6da0d1c8459f..c46165e5cea2487d46a3b0e3f0837fb1c4c37c59 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 3a399b132b8cb8af16f0b7addf48fc01806247de..1993a3d9567bf5916ffc235f91fb0cbd1a70a080 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++;