From 32ddc1c750136e75753da6195bf0b8b020d83e87 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Thu, 25 Apr 2024 12:07:49 -0400 Subject: Add usage instructions to README.md --- README.md | 6 ++++++ encoder.py | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c2ac901..98eb594 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # 6.8301 Project +Encode: `python encoder.py -i in -o vid.mkv` + +Play video: `mpv --scale=nearest --fullscreen --loop --no-keepaspect vid.mkv` + +Decode: `python decoder.py -o out` + Formatting: `black -l 120 *.py` TODO: diff --git a/encoder.py b/encoder.py index 15ee859..f61ca9c 100644 --- a/encoder.py +++ b/encoder.py @@ -67,10 +67,7 @@ def get_frame(): ), ) ) - return np.stack( - ((frame & 0b0001) * 255, (frame >> 1 & 0b0011) * 255 / 3, (frame >> 3) * 255), - axis=-1, - ).astype(np.uint8) + return np.stack(((frame & 0b0001) * 255, (frame >> 1 & 0b0011) * 85, (frame >> 3) * 255), axis=-1).astype(np.uint8) if args.mix: -- cgit v1.2.3-70-g09d2