Skip to content

media: apple: prepare HEVC Main/Main10 with frame ops (Apple payload WIP) - #703

Closed
RyanTheTide wants to merge 3 commits into
integration/aurorafrom
avd/rewrite-hevc
Closed

RyanTheTide wants to merge 3 commits into
integration/aurorafrom
avd/rewrite-hevc

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

HEVC frame preparation currently depends on mutable context scratch state and assumes NAL-relative slice offsets. This draft adds CPU-only prepare/pack_cmd/retire callbacks, snapshots request controls, gives each frame slot independent scratch storage, and writes bounded little-endian instruction programs. Whole-NAL GStreamer and absolute entropy-data FFmpeg layouts are normalized before the shared builder. Main/Main10 keep NV12/P010 selection, and T6040 advertises HEVC with its v5 header.

The shared avd-queue.h is copied verbatim from the rewrite contract. A small core compatibility bridge retains the existing single-job path while avd/rewrite-core is developed; the codec callbacks do not access queues or MMIO.

The Apple packer is incomplete and cannot submit Apple payloads. The licensed eiln/avd V3 map covers known header/scaling/reference/first-slice fields. Borage includes its documented common fields, command constants and work validation, but syntax/work assignment, Main10 candidates and packed address masks remain capture TODOs. T8112/T8140 layouts are explicit ledger TODO entries. pack_cmd() rejects incomplete payloads. This draft does not claim Apple-firmware or queued decode is working.

Validation:

  • git diff --check passes; the queue header matches the contract verbatim; Python and C syntax parsing pass. Syntax parsing does not replace compilation or execution.
  • Host harness added: 192 old/new instruction comparisons across Main/Main10, CTU32/64, 1x1/2x2 tiles, I/P/B, four instruction generations and both slice layouts; separate ASan/UBSan field/bounds tests. These use synthetic controls, not libx265 control captures or decoded pixels.
  • Execution pending: the build host is currently unavailable. Host checks and an arm64 W=1 WERROR driver build have been requested; no passing build or runtime result is claimed.

Remaining work before completion: resolve the documented Apple capture fields and per-SoC layouts, integrate the queue/backend program contract, and obtain passing host and arm64 build results.

Build bounded per-frame instruction programs with slot-private scratch
storage and snapshot request controls. Normalize whole-NAL and absolute
entropy-data slice descriptions before generating instructions. Keep the
current single-job path through a core compatibility bridge.

Add licensed V3 frame-parameter field maps and the known Borage descriptor
fields and validation. Leave unsupported Apple payload fields explicit and
reject incomplete commands. Advertise the T6040 HEVC capability with the
v5 header.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Require the final absolute entropy range to end at bytesused, so a padded
whole-NAL description cannot be mistaken for an absolute data-only layout.
Keep the first V3 slice's MV address when later segments are emitted.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
avd-hevc-slices.c returns -EINVAL but did not include linux/errno.h,
so the module failed to build with clang on its own.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide changed the base branch from aurora-wip to integration/aurora November 2, 2026 23:16
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The HEVC Main/Main10 frame-op approach here was replaced by the merged backend and v5-header work on integration/aurora: #1487 (v5 HEVC header on T8132) and #1116 (macOS HEVC slice/scaling parity). Closing.

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.

1 participant