[vlc-devel] [PATCH] codec: cea708: Add aspect ratio aware positioning

Thomas Symborski thomas.symborski at gmail.com
Wed May 28 10:52:16 UTC 2025


This patch enhances CEA-708 closed caption positioning to be aspect ratio
aware, addressing specification compliance issues where captions were
positioned incorrectly on different video aspect ratios.

The implementation dynamically selects between 4:3 (160 columns) and 16:9
(210 columns) grid layouts based on the source video's display aspect ratio
(DAR). CEA-608 captions continue to use the traditional 4:3 grid exclusively
for backward compatibility. The font scaling ratio has been corrected from
1.06 to 1.3 to improve visual consistency.

Changes include:
- Dynamic aspect ratio detection in CEA708SpuConvert using DAR calculation
- Grid selection logic (4:3 for DAR < 5:3, 16:9 for DAR >= 5:3)
- New UPDT_REGION_USES_16_9_GRID flag in substext.h
- Comprehensive test suite with aspect ratio and integration tests
- Updated build system configuration for new tests

Testing performed:
- Unit tests validate aspect ratio calculations for common video formats
- Integration tests verify decoder functionality with different formats
- Regression testing confirms no impact on existing CEA-608 functionality
- Tests pass on both autotools and meson build systems

This addresses positioning inaccuracies on widescreen content and improves
specification compliance for modern broadcast standards.

Signed-off-by: Thomas Symborski <thomas.symborski at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20250528/e3956290/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cea708-aspect-ratio-positioning.patch
Type: application/octet-stream
Size: 30385 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20250528/e3956290/attachment.obj>


More information about the vlc-devel mailing list