tb: descramble: Expand offset search
If we get very lucky, the descrambler can lock after only 28 bits
(the size of the idle counter). Take this scenario into account when
deciding on the offset.
Fixes: 12a4678
("Add (de)scrambling support")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
fe908de1f1
commit
27d4c6457e
|
@ -80,7 +80,7 @@ async def test_descramble(descrambler, valids):
|
||||||
|
|
||||||
best_corr = -1
|
best_corr = -1
|
||||||
best_off = None
|
best_off = None
|
||||||
for off in range(30, 42):
|
for off in range(28, 42):
|
||||||
corr = sum(i == o for i, o in zip(ins[off:], outs))
|
corr = sum(i == o for i, o in zip(ins[off:], outs))
|
||||||
if corr > best_corr:
|
if corr > best_corr:
|
||||||
best_corr = corr
|
best_corr = corr
|
||||||
|
|
Loading…
Reference in New Issue