Research-0912: Pixel-format edge coverage audit¶
- Date: 2026-05-31
- Author: Claude (Anthropic) on behalf of Lusoris
- Related: ADR-0912
Context¶
Most libvmaf unit tests under core/test/ allocate VmafPicture instances at (VMAF_PIX_FMT_YUV420P, 8). The chroma-stride and bit-depth-shift code paths that diverge for 4:2:2 / 4:4:4 / 10-bit / 12-bit / 16-bit inputs are largely unexercised at the unit-test layer — regressions there are only caught downstream (Python harness or cross-backend parity gate).
Method¶
- Enumerate every test that references a non-default pixel format or bit depth:
grep -rIn -E '(VMAF_PIX_FMT_YUV4|yuv4(22|44)|10le|12le|16le)' core/test
grep -rIn -E 'vmaf_picture_alloc\([^,]+,[^,]+,\s*(10|12|16)' core/test
- For each registered CPU extractor (
psnr,ssim,ms_ssim,ciede,cambi,psnr_hvs,adm,vif,motion), assess whether any existing test reaches itsinit/extractpath with each of{YUV422P, YUV444P}×{8, 10, 12, 16}.
Findings¶
Coverage matrix before this PR (CPU extractor surface)¶
| extractor | 420p8 | 420p10 | 420p12 | 420p16 | 422p8 | 422p10/12/16 | 444p8 | 444p10/12/16 |
|---|---|---|---|---|---|---|---|---|
psnr | ✓ many | (test_picture only) | — | ✓ test_16b_large_diff (2×2) | — | — | (full-model only) | — |
ssim | ✓ smoke | — | — | — | — | — | (full-model only) | — |
ms_ssim | ✓ smoke | — | — | — | — | — | (full-model only) | — |
ciede | (math only) | — | — | — | — | — | (full-model only) | — |
cambi | ✓ smoke + 10-bit YUV400 cases | ✓ via YUV400P 10 | — | — | — | — | — | — |
psnr_hvs | ✓ SIMD bit-exact | — | — | — | — | — | — | — |
adm | ✓ smoke | — | — | — | — | — | (full-model only) | — |
vif | ✓ smoke | — | — | — | — | — | (full-model only) | — |
motion | ✓ smoke | — | — | — | — | — | (full-model only) | — |
Notes:
- "✓ smoke" = at least one end-to-end smoke test wired into the fast suite at the extractor's public surface.
- "math only" = inner helper exercised via
#includeof the .c file (test_ciede.conly callsciede2000(LABColor, ...)). - "(full-model only)" = exercised by
test_pic_preallocation::test_picture_pool_yuv444which runs the fullvmaf_v0.6.1model on YUV444P 8-bit but does not isolate a single extractor. - "(test_picture only)" = referenced by an allocation-shape test that does not run an extractor.
Gap intersections by severity¶
S0 — High-value, low-cost (this PR):
- PSNR on 4:2:2 8-bit — exercises the
ss_hor=1, ss_ver=0chroma-stride path; no other CPU test runs an extractor on YUV422P input. - PSNR on 4:4:4 10-bit — exercises HBD scoring with chroma plane dimensions equal to luma; the only existing HBD smoke uses 4:2:0 16-bit at 2×2.
- PSNR on 4:2:0 12-bit — fills the 12-bit hole (the most common HDR bit depth in production pipelines).
- SSIM on 4:2:2 8-bit — exercises asymmetric chroma geometry under the integer SSIM decimation / window machinery.
- CIEDE on 4:2:2 8-bit — exercises
ciede.c::initchroma upscaling (scale_chroma_planes+ scratch YUV444 picture allocation) that the 4:4:4 fast-path bypasses entirely.
S1 — Worth filing as follow-ups:
- MS-SSIM at 10-bit / 12-bit.
- ADM at 10-bit (HDR pipelines feed the model with HBD ADM).
- VIF at 10-bit.
psnr_hvson 4:4:4 (no chroma path, but the JPEG-DCT block loop should be smoked).motion/motion_v2at 10-bit (allocates 16-bit blur scratch pictures regardless of input bpc, but the upcast path isn't smoked).
S2 — Specialised; leave alone:
cambialready covers HBD via the 10-bit YUV400 tests intest_cambi.c.tad,lpips,dists,transnet_v2,mobilesal,fastdvdnet_pre,ssimulacra2— research-grade extractors; pix-fmt edge testing is lower priority than fork-original audits already on backlog.
Decision¶
Plug the S0 cluster in one fast test (test_pixel_format_edge_coverage.c, 5 cases, ~40 ms wall-clock combined). S1 / S2 can land as follow-up bundles using the same pattern.
Reproducer¶
git worktree add -b test/pixel-format-edge-coverage \
/tmp/wt-pixfmt origin/master
cd /tmp/wt-pixfmt
meson setup core/build-cpu core \
-Denable_cuda=false -Denable_sycl=false \
-Denable_hip=false -Denable_metal=disabled
ninja -C core/build-cpu test/test_pixel_format_edge_coverage
core/build-cpu/test/test_pixel_format_edge_coverage
# → "5 tests run, 5 passed"
meson test -C core/build-cpu --suite=fast
# → "Ok: 50 Fail: 0"