ASS/SSA \pos Positioning for CEA-608 Captions
/* ccextractor#1885 */
/* 1-2 row captions: emit {\an7\pos(x,y)} tags */
/* >2 rows: fall back to whitespace layout */
float top_margin = 0.10f * playres_y;
float row_step = (playres_y * 0.80f) / 15.0f;
float y = top_margin + (row * row_step) + (row_step / 2.0f);
/* 118 dialogues correctly positioned in CI testing */Background
CCExtractor's ASS/SSA output used whitespace padding to approximate horizontal caption position. This is not spec-compliant and breaks in renderers that don't preserve leading whitespace (e.g. libass in mpv).
Root Cause
CEA-608 defines 32 PAC indent zones mapping to specific horizontal positions. These were being ignored in the ASS output path — all captions were left-aligned with padding added as a fallback.
The Fix
Mapped CEA-608 PAC indent values to pixel coordinates on a 1280×720 grid with 3/32 safe-area margins (as per broadcast standards). For 1–2 row captions, emit \pos(x,y) tags directly. Complex multi-row layouts fall back to the original whitespace method conservatively.
Evidence
Tested against CI suite — 118 dialogue lines correctly positioned. Verified rendering in libass-based players.
Result
PR ccextractor#1885, merged. Subtitle positioning is now spec-grounded rather than approximated.