mirror of
https://github.com/romanz/amodem.git
synced 2026-03-27 21:39:06 +08:00
Refactor a bit
This commit is contained in:
4
ecc.py
4
ecc.py
@@ -34,6 +34,10 @@ def decode(data, nsym=DEFAULT_NSYM):
|
||||
except ReedSolomonError:
|
||||
break
|
||||
|
||||
overhead = (i - len(dec)) / float(i)
|
||||
blocks = i / BLOCK_SIZE
|
||||
log.debug('Decoded %d blocks = %d bytes (ECC overhead %.1f%%)', blocks, len(dec), overhead * 100)
|
||||
|
||||
n = struct.calcsize(LEN_FMT)
|
||||
payload, length = dec[n:], dec[:n]
|
||||
length, = struct.unpack(LEN_FMT, length)
|
||||
|
||||
Reference in New Issue
Block a user