diff options
Diffstat (limited to 'encoder.py')
-rw-r--r-- | encoder.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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( ( |