P0: PVR Texture Converter
What: TGA/PNG/BMP → PVR binary converter.
Why: pvrconv not present in SDK v0.40. THE blocker for
any texture work. Reference:
codex/hardware/PVR2_TEXTURE_FORMATS.md (complete format
spec). Scope: ~800 lines C or Rust. - Morton twiddle
reorder (Y-even, X-odd bit interleaving) - VQ encoding (k-means codebook
optimization, 256 entries × 2×2 pixels) - SmallVQ (reduced codebook for
16×16 through 64×64) - Mipmap chain generation (box filter, correct
per-level sizing) - All pixel formats: ARGB1555, RGB565, ARGB4444, Bump
(S/R) - GBIX + PVRT header output - Palette modes (4BPP, 8BPP with
twiddled indices) - --validate mode (pvr-validate
integrated) - PNG alpha channel support (pvrconv only supported BMP) -
Batch mode with dependency tracking
Alternative: Extend tvspelsfreak’s
texconv (already understands all PVR formats).