SlimeCodec Convert v0.2.0 — Windows x64
========================================

NormMAP commutator-norm driven video re-encoder.
Reduces bitrate up to 48% at the same CRF by reallocating bits
away from low-motion blocks detected via commutator norm analysis.


QUICK START (GUI)
-----------------
1. Double-click  slimecodec-gui.exe
2. Click "Browse..." to select an input video
3. Adjust settings (or leave defaults)
4. Click "Convert"
5. Output file appears in the same folder as input (*_slime.mp4)


QUICK START (CLI)
-----------------
  slimecodec-convert.exe input.mp4 -o output.mp4


CLI OPTIONS
-----------
  slimecodec-convert.exe [OPTIONS] <INPUT>

  -o, --output <PATH>        Output file (default: {input}_slime.mp4)
      --codec <h264|av1>     Video codec (default: h264)
      --crf <N>              Quality 0-51 (default: 23 for h264, 35 for av1)
      --strength <F>         NormMAP QP strength 0.0-1.0 (default: 0.15)
      --keyint <SEC>         Keyframe interval in seconds, 0=auto (default: 0)
                             Set to 2 for HLS DVR compatibility.
      --normmap <PATH>       Write .normmap sidecar file
      --normmap-mode <0|1|2> 0=bitmask 1=uint8-log 2=float16 (default: 1)
      --pass1-only           Generate NormMAP only, skip re-encoding

EXAMPLES
--------
  # Basic conversion (H.264, CRF 23, strength 0.15)
  slimecodec-convert.exe video.mp4 -o output.mp4

  # Stronger compression
  slimecodec-convert.exe video.mp4 -o output.mp4 --strength 0.3

  # AV1 output
  slimecodec-convert.exe video.mp4 -o output.mp4 --codec av1

  # HLS-ready with 2-second keyframe interval
  slimecodec-convert.exe video.mp4 -o output.mp4 --keyint 2

  # Export NormMAP analysis alongside video
  slimecodec-convert.exe video.mp4 -o output.mp4 --normmap analysis.normmap


HOW IT WORKS
------------
SlimeCodec analyses consecutive video frames using the commutator norm
of 8x8 pixel blocks:

  d = ||[A, B]||_F = ||AB - BA||_F

where A and B are grayscale matrices of the same block in two adjacent
frames. Blocks with low d-values have minimal perceptual change and can
tolerate higher quantisation without visible quality loss.

Pipeline:
  Pass 1 — Decode all frames, compute d-values for every 8x8 block pair.
  Pass 2 — Re-encode with per-macroblock QP offsets via FFmpeg ROI side data.
            Low-d blocks get positive QP offset (more compression).
            High-d blocks keep base QP (preserve detail).

Audio streams are copied through without re-encoding (-c:a copy).
Original timestamps (PTS) and duration are preserved exactly.

The --strength parameter controls how aggressively low-d blocks are
compressed. 0.15 is a good default; 0.3 is more aggressive; 0.0 disables
NormMAP and produces a standard re-encode.


INCLUDED FILES
--------------
  slimecodec-gui.exe           GUI application (egui)
  slimecodec-convert.exe       CLI tool
  avcodec-61.dll               FFmpeg 7.1 libraries
  avdevice-61.dll
  avfilter-10.dll
  avformat-61.dll
  avutil-59.dll
  postproc-58.dll
  swresample-5.dll
  swscale-8.dll
  README.txt                   This file
  CHANGELOG.txt                Version history


SYSTEM REQUIREMENTS
-------------------
  - Windows 10/11 x64
  - No installation or runtime dependencies
  - All FFmpeg libraries are bundled


LICENSE
-------
SlimeCodec is proprietary software. Patent pending.
FFmpeg libraries are licensed under LGPL/GPL.
