From 488a8cbe2ba1561108f7e86babc4d5d6d4692034 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Sun, 29 Sep 2019 10:06:14 +0200 Subject: [PATCH] keep locations sorted by offset per layer --- ldpc_decoder.hh | 1 + ldpc_decoder2.hh | 1 + 2 files changed, 2 insertions(+) diff --git a/ldpc_decoder.hh b/ldpc_decoder.hh index fee71c3..32991c0 100644 --- a/ldpc_decoder.hh +++ b/ldpc_decoder.hh @@ -160,6 +160,7 @@ class LDPCDecoder lo[c].shi = shift[c] / W; shift[c] = (shift[c] + 1) % M; } + std::sort(lo, lo + cnt, [](const Loc &a, const Loc &b){ return a.off < b.off; }); TYPE par[2]; if (i) { par[0] = pty[W*(i-1)+j]; diff --git a/ldpc_decoder2.hh b/ldpc_decoder2.hh index 005e41b..c262b62 100644 --- a/ldpc_decoder2.hh +++ b/ldpc_decoder2.hh @@ -223,6 +223,7 @@ public: lo[c].shi = shift[c] / W; shift[c] = (shift[c] + 1) % M; } + std::sort(lo, lo + cnt, [](const Loc &a, const Loc &b){ return a.off < b.off; }); lo += cnt; } }