aboutsummaryrefslogtreecommitdiff
path: root/encoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'encoder.py')
-rw-r--r--encoder.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/encoder.py b/encoder.py
index f61ca9c..6b7b3d5 100644
--- a/encoder.py
+++ b/encoder.py
@@ -44,13 +44,13 @@ idx = 0
def get_frame():
global idx
- frame = np.array(rsc.encode(packets[idx]))
+ frame = np.array(rsc.encode(bytearray(packets[idx])))
idx = (idx + 1) % len(packets)
frame = np.pad(frame, (0, frame_size // 2 - len(frame))) ^ frame_xor
- # Add 4 bytes, pad frame to be multiple of 255
- frame = np.pad(frame, (0, (len(frame) + 258) // 255 * 255 - len(frame)))
+ # Pad frame to be multiple of 255
+ # frame = np.pad(frame, (0, (len(frame) + 254) // 255 * 255 - len(frame)))
# Space out elements in each size 255 chunk
- frame = np.ravel(frame.reshape(len(frame) // 255, 255), "F")[: frame_size // 2]
+ # frame = np.ravel(frame.reshape(len(frame) // 255, 255), "F")[: frame_size // 2]
frame = np.ravel(np.column_stack((frame >> 4, frame & 0b1111)))
frame = np.concatenate(
(