daemon: AV1 Frame Header OBU synthesiser + Temporal Delimiter #24
Reference in New Issue
Block a user
Delete Branch "noether/daemon-av1-frame-header-obu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 2 of the AV1 OBU encoder pack (PR #22 landed Phase 1 — the Sequence Header). Adds the two remaining pieces of the per-frame OBU assembly:
av1_synth_temporal_delimiter_obu()— trivial 2-byte OBU that AV1 temporal units must start with so libavcodec's parser detects access-unit boundaries.av1_synth_frame_header_obu()— encodes a Frame Header OBU (AV1 §5.9) fromV4L2_CID_STATELESS_AV1_SEQUENCE+V4L2_CID_STATELESS_AV1_FRAMEcontrols.Frame Header scope (libva-v4l2-request common-case path)
Out-of-scope branches return 0 so a future
decoder.cintegration can surface coverage warnings and fall back to direct libavcodec parsing where the consumer happens to ship a fully-OBU'd access unit.Integration status (NOT in this PR)
The new primitives are not yet wired into
decoder.c. The AV1 decode hot path still passes the OUTPUT buffer straight to libavcodec — which works only when the V4L2 consumer is sending a fully-OBU'd access unit, not strictly the V4L2 stateless contract.A real wiring needs a separate kernel-side change:
daedalus_v4l2_proto.h: addstruct daedalus_av1_metamirroringv4l2_ctrl_av1_sequence + v4l2_ctrl_av1_frame.kernel/daedalus_v4l2_main.c: captureV4L2_CID_STATELESS_AV1_{SEQUENCE,FRAME}atdevice_run, forward over the chardev.daemon/src/chardev_client.c: receive meta.daemon/src/decoder.c: assembleTD + SH + FH + OBU_TILE_GROUP-wrapped OUTPUT bytes, send to libavcodec.Tracked as a follow-on. This PR ships the encoder primitives; the wiring lands later once the kernel-side meta forwarding is in place.
Tests
test_av1_obu_synth.cgrows 5 new cases (9 total, all green on hertz):Bit-walk of the KEY-frame happy path confirms the OBU envelope (
obu_type=3 = FRAME_HEADER,has_size_field=1, leb128 size byte), then steps throughshow_existing_frame,frame_type,show_frame,disable_cdf_update,allow_screen_content_tools. Build clean on hertz (Pi 5, Debian trixie, 6.18.29+rpt-rpi-2712,gcc -Wall -Wextra -Wpedantic). No new warnings.Closes task #159.