Skip to content

HEVC: support of interlaced content (TFF/BFF, field height and frame rate)#2637

Open
tobbee wants to merge 1 commit into
MediaArea:masterfrom
tobbee:HEVC_Interlace
Open

HEVC: support of interlaced content (TFF/BFF, field height and frame rate)#2637
tobbee wants to merge 1 commit into
MediaArea:masterfrom
tobbee:HEVC_Interlace

Conversation

@tobbee

@tobbee tobbee commented Jun 3, 2026

Copy link
Copy Markdown

What

Fixes #1092

Reports interlacing for HEVC, mirroring the existing AVC behaviour. Until now HEVC
streams had no ScanType/ScanOrder, and field-sequence streams were reported with the
coded field dimensions and rate (e.g. 1920×540 @ 50) instead of the frame values.

HEVC slice headers carry no field_pic_flag/bottom_field_flag; field coding is signalled
only via metadata, all of which the parser already read and discarded, or stored:

  • field_seq_flag (VUI) — was Skip_SB

  • pic_struct / source_scan_type (pic_timing SEI) — were Skip_S1

  • general_progressive_source_flag / general_interlaced_source_flag (profile_tier_level)

    Behaviour

  • Fills ScanType, ScanOrder (TFF/BFF), ScanType_StoreMethod
    (Interleaved vs Separated) and Interlacement, from pic_struct (per Table D.2), with a
    fallback to source_scan_type and the profile_tier_level constraint flags when no
    pic_timing SEI is present.

  • For separated fields (field_seq_flag=1, pic_struct ∈ {1,2,9–12}) the coded picture is a
    single field, so Height is doubled (1920×540 → 1920×1080) and FrameRate is halved
    (50 → 25) — this addresses @svart-riddare's point in Does not report interlacing on HEVC video contents #1092.

  • Field order for separated fields is derived from the parity of the first coded field of the
    initial IRAP (analogous to AVC's pic_struct_FirstDetected).

    Before / after

    On a 1080i50 HEVC .ts:

    Field Before After
    Height 540 1080
    FrameRate 50.000 25.000
    ScanType (absent) Interlaced
    ScanOrder (absent) TFF
    ScanType_StoreMethod (absent) SeparatedFields

    Notes

  • I can provide a 1080i50 HEVC .ts sample for the test suite.

  • Out of scope: frame doubling/tripling (pic_struct 7/8) rate handling — currently reported
    as Progressive, unchanged.

    Spec

    ISO/IEC 23008-2 (H.265): Table D.2 (pic_struct), source_scan_type semantics,
    field_seq_flag semantics (incl. NOTE 11 on field dimensions/rate).

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.

Does not report interlacing on HEVC video contents

1 participant