Skip to content

fix(tools): accept odd dimensions for raw YUV chroma-subsampled inputs (ADR-1398) - #1672

Merged
lusoris merged 2 commits into
masterfrom
fix/cli-raw-odd-420
Oct 1, 2026
Merged

lusoris merged 2 commits into
masterfrom
fix/cli-raw-odd-420

Conversation

@lusoris

@lusoris lusoris commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Accept odd dimensions for raw YUV 4:2:0 and 4:2:2 inputs in the vmaf CLI using ceiling chroma, matching .y4m behaviour (ADR-1398). Previously validate_chroma_alignment() refused odd widths for 4:2:0/4:2:2 and odd heights for 4:2:0 while .y4m inputs were accepted. Per user decision 2026-10-01 ("Accept both (Recommended)"), the CLI validates positive dimensions and allows odd dimensions for raw YUV inputs with ceil chroma ((dim + 1) / 2).

Type

  • fix — bug fix

Checklist

  • Commits follow Conventional Commits (the commit-msg hook enforces this).
  • make format && make lint is green locally.
  • Unit tests pass: python3 scripts/ci/run_meson_test.py -- -C build.
  • If I touched any SIMD/GPU code path, I ran /cross-backend-diff and the worst ULP is ≤ 2.
  • If I touched a feature extractor with SIMD/GPU twins, I either updated every twin or listed the gap under "Known follow-ups" below.
  • If I added a new .c / .cpp / .cu / .h / .hpp, it has the appropriate license header (see CONTRIBUTING.md).
  • If this is a breaking change, the commit message uses ! or BREAKING CHANGE: and the migration path is documented below.
  • If this PR adds an ADR, the ADR row lives in docs/adr/_index_fragments/<NNNN-slug>.md and the slug is appended to docs/adr/_index_fragments/_order.txt — do not edit docs/adr/README.md directly (regenerated by scripts/docs/concat-adr-index.sh; see ADR-0221).

Bug-status hygiene (ADR-0165)

  • docs/state.md updated in this PR with a row in the appropriate section (Open / Recently closed / Confirmed not-affected / Deferred), OR no state delta: REASON.

Netflix golden-data gate (ADR-0024)

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.
  • If I believe a golden value must change, I have explained why below AND pinged @lusoris for a CODEOWNERS exception.

Deep-dive deliverables (ADR-0108)

  • Research digest — no digest needed: user decision on issue RC3 handoff: office box → ryzen-4090-arc (living checklist) #1641 handoff specifies accepting odd dimensions for raw inputs matching y4m.
  • Decision matrix — captured in the corresponding ADR's ## Alternatives considered (ADR-1398).
  • AGENTS.md invariant note — added to the relevant package's AGENTS.md.
  • Reproducer / smoke-test command — pasted below under "Reproducer".
  • CHANGELOG fragment — a new file under changelog.d/<section>/<topic>.md (added / changed / deprecated / removed / fixed / security). Do not edit CHANGELOG.md directly — scripts/release/concat-changelog-fragments.sh renders the Unreleased block from the fragment tree (see ADR-0221).
  • Rebase note — entry added to docs/rebase-notes.md under a new ID, OR no rebase impact: REASON.

Reproducer

meson test -C build test_vmaf_raw_odd_dims test_vmaf_option_dict_ownership
python3 -m unittest python/test/vmafx_cli_test.py

Known follow-ups

None.

…s (ADR-1398)

The vmaf CLI formerly refused odd-sized raw YUV 4:2:0 and 4:2:2 inputs with
"odd width/height %d not allowed..." via validate_chroma_alignment()
(ADR-0461), whereas .y4m inputs were accepted because frame_w was padded
to a multiple of 16. The C engine and raw readers handle odd dimensions
with ceiling chroma (vmaf_chroma_extent(), picture_geometry.h, PR #1643,
PR #1664).

Per user decision on 2026-10-01 ("Accept both (Recommended)"), the CLI
now accepts raw YUV inputs with odd dimensions using ceiling chroma,
matching .y4m.

- core/tools/vmaf.cpp: validate_chroma_alignment() returns 0.
- core/tools/test/test_vmaf_raw_odd_dims.sh: add positive (19x19,
  1921x1081, 19x20, 20x19, 19x19 422), boundary (1x1 420/422), and
  negative (file size mismatch exits 2 cleanly) regression tests.
- core/tools/test/test_vmaf_option_dict_ownership.sh: test Case 2 with
  mismatched dimensions instead of odd height to preserve early-exit
  dictionary leak coverage.
- python/test/vmafx_cli_test.py: add unit tests asserting raw YUV scores
  match Y4M bit-identically for odd dimensions, 1x1 boundary, and file
  size error handling.
- docs: document odd dimensions support in docs/usage/cli.md and
  core/tools/AGENTS.md, record ADR-1398, update docs/state.md,
  docs/rebase-notes.md, changelog fragment, and citations registry.

Closes T-CLI-RAW-ODD-DIMENSIONS-REFUSED-2026-10-01.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant