Skip to content

Fix VUI signaling in SPS - #168

Merged
mpeg5 merged 2 commits into
masterfrom
fix_vui_signaling
Aug 7, 2026
Merged

Fix VUI signaling in SPS#168
mpeg5 merged 2 commits into
masterfrom
fix_vui_signaling

Conversation

@kpchoi

@kpchoi kpchoi commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

sps->vui_parameters_present_flag was hardcoded to 0, so none of the VUI
options (timing info, aspect ratio, color description, ...) ever reached the
bitstream. This enables it whenever any VUI field is actually requested;
default streams are unchanged.

Also fixed along the way:

  • The fps-to-VUI-timing propagation was inverted (num_units_in_tick = fps.num / fps.den,
    time_scale = 1). It now propagates fps.den / fps.num, so
    -z 30000/1001 --units-in-tick 1001 signals proper 29.97 timing without
    having to spell out --time-scale.
  • Several VUI command line options (--units-in-tick, --pic-struct,
    --chromaloc-tf/bf, --mv-over-pic-boundaries, --max-bits-per-cu-denom,
    --log2-max-mv-len-hor/ver, --neutral-chroma-flag, --frame-field-flag)
    were parsed into the args struct but never copied into the encoder
    parameters, i.e. silently ignored. They are wired up now.
  • xeve_param_default() set videoformat to 2 (NTSC) instead of 5
    (unspecified) and left the bitstream-restriction fields at 0 instead of
    their spec defaults, which would have turned the VUI on for every stream.
  • The app crashed on any early parameter-error exit (--sar 1 reproduces it
    on master) because the ERR path freed uninitialized image lists.
  • --sar, --videoformat, --colorprim, etc. now also accept plain numeric
    values in addition to names.

Verified: default streams are bit-exact with master (SEI text aside); VUI is
written only when requested; timing/aspect streams decode fine with xevd;
both profiles build.

Addresses #133

kpchoi added 2 commits August 7, 2026 16:14
Signed-off-by: KP Choi <kp5.choi@samsung.com>
Signed-off-by: KP Choi <kp5.choi@samsung.com>

@mpeg5 mpeg5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpeg5
mpeg5 merged commit 4d2e268 into master Aug 7, 2026
6 checks passed
@kpchoi
kpchoi deleted the fix_vui_signaling branch August 8, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants