Skip to main content

Module debug_rect

Module debug_rect 

Source
Expand description

Spatial decision logging for encoder debugging.

When the debug-rect feature is enabled, the debug_rect! macro logs every encoder decision alongside the rectangle it affects. Logs are collected in a global buffer and flushed to a sidecar CSV when the frame is complete.

When the feature is disabled, the macro compiles to nothing.

§CSV format

stage,x,y,w,h,message

§Query workflow

  1. Encode with --features debug-rect → produces output.jxl.debug_rect.csv
  2. Decode both our JXL and cjxl’s JXL, diff the pixels to find divergent regions
  3. Call query_overlapping (or grep the CSV) for rectangles touching that region
  4. Read the message column to understand every decision that affected those pixels

Functions§

clear
diff_and_query
find_worst_block
find_worst_blocks
flush
query_overlapping