Skip to content

Video: H.264 picture-parameter path for the VAAPI sequence decoder #70

Description

@justin13888

rawshift-hwdec's sequence seam accepts VideoConfig::Avcc and HwCodec::H264 — the API is final — but the VAAPI backend has no H.264 picture-parameter path, so video_decoder() refuses H.264 and available_video_codecs() does not advertise it. This is deliberate: discovery that promises a session which then fails to open is worse than discovery that is narrow.

The driver side is ready — the runtime probe already tracks VAProfileH264ConstrainedBaseline / Main / High, and Caps::h264_any() reports them.

What it takes:

  • avcC parsing — parameter sets, lengthSizeMinusOne, and the optional High-profile tail that many muxers omit.
  • SPS/PPS/slice-header parsing — including a correct VUI HRD skip. A mis-skipped HRD silently corrupts max_dec_frame_buffering, which corrupts output order.
  • Scaling lists — these cannot be rejected the way the still HEVC path rejects them: VAIQMatrixBufferH264 is mandatory and High-profile camera encoders routinely signal matrices. Needs scaling_list() plus fall-back rules A and B.
  • sys.rs additionsVAPictureH264, VAPictureParameterBufferH264, VASliceParameterBufferH264, VAIQMatrixBufferH264, each with the size_of/offset_of layout test the existing structs carry.
  • slice_data_bit_offset — the highest-risk detail. Unlike HEVC's slice parameter buffer there is no companion slice_data_num_emu_prevn_bytes, so the offset must be expressed against the escaped NAL as submitted: 8 + rbsp_bit_pos + 8 * epb_count_within(rbsp_bit_pos / 8). This is the detail most likely to differ between iHD, i965, radeonsi and nvidia-vaapi-driver, so validate it on real hardware before building anything on top.

Scope note: field_pic_flag == 1 (PAFF) should be rejected explicitly, as docs/SUPPORT.md records — camera-origin H.264 is progressive, and paired-field reference management roughly doubles the state machine. MBAFF is fine; it is frame coding.

Follow-up to #39.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions