Commit Graph

11 Commits

Author SHA1 Message Date
kris
5c550d8524 Separate the details of the bitmap packing from operations on the
packed representation (diff, apply etc).  This allows the (D)HGRBitmap
classes to focus on the bitmap packing and share common logic.

Numpy has unfortunate long-standing bugs to do with type coercion of
np.uint64, which leads to spurious "incompatible type" warnings when
e.g. operating on a np.uint64 and some other integer type.  To work
around this we cast explicitly to np.uint64 everywhere.

Get tests working again - for now HGR tests in screen_test.py are
disabled until I finish implementing new packing.

HGRBitmap is still incomplete although closer.
2019-07-04 15:21:20 +01:00
kris
666272a8fc Checkpoint WIP for easier comparison to dhgr branch:
- naive version of NTSC artifacting, it uses a sliding 4-bit window to
  assign a nominal (D)HGR colour to each dot position.  A more
  sophisticated/correct implementation would model the YIQ signal
  directly.

- Switch DHGRBitmap implementation to use a 34-bit representation of
  the 4-byte tuple, comprised of a 3-bit header and footer, plus
  4*7=28-bit body.  The headers/footers account for the influence on
  neighbouring tuples from the 4-bit NTSC window.

- With this model each screen byte influences 13 pixels, so we need to
  precompute 2^26 edit distances for all possible (source, target)
  13-bit sequences.

- Checkpointing not-yet-working HGR implementation.

- Add new unit tests but not yet all passing due to refactoring
2019-07-02 22:40:50 +01:00
kris
b2c00784b0 Minor code cleanups 2019-06-21 22:08:22 +01:00
kris
cf3c687a8f Fix merges after rebase 2019-06-19 22:10:15 +01:00
kris
edefe649f4 Parametrize the RGB palette to encode with, and support both NTSC and
IIGS palettes.

Move the palette diff_matrix generation into make_data_tables.py since
that is the only place it is used.

Demand-load the edit distance matrices when transcoding.
2019-06-19 22:06:54 +01:00
kris
33aa4d46c4 Rename FrameSequencer to FrameGrabber and break out into separate file.
Add a test case that the bmp2dhr output of input filenames containing
'.'  are handled correctly.

Break out video.Mode into video_mode.VideoMode to resolve circular
dependency.
2019-06-19 22:04:02 +01:00
kris
fac2089206 Add tests for _diff_weights 2019-06-19 22:02:13 +01:00
kris
da2e2476e7 Rename tests and clean up a bit. Still don't pass. 2019-03-21 17:21:43 +00:00
kris
cf493e782c Add module docstrings 2019-03-21 16:42:47 +00:00
kris
fb47e48e4a Fix imports and point to player debug symbols 2019-03-21 16:24:40 +00:00
kris
bbfcacd674 Move transcoder to new location 2019-03-21 16:10:16 +00:00