Skip to content

media: apple: ave: keep 6070 H.264 P pictures as references (split from #2375) - #3533

Open
RyanTheTide wants to merge 1 commit into
mainfrom
fix/ave-h264-p-references-20261129
Open

RyanTheTide wants to merge 1 commit into
mainfrom
fix/ave-h264-p-references-20261129

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: The H.264 references fix from commit 1 of #2375 (by Lucas Goossen), split into its own PR as the review suggested, without the rate-control and VUI changes. A nonzero Process timescale made AVE 6070 H.264 P slices non-reference pictures and left frame_num stuck at 1. H.264 now writes zero there (PTS stays in AVE_PROC_TIMESCALE), and the Start motion lambdas are set for full-pel search. The behaviour is selected by the command layout's h264_inter capability. HEVC and other layouts are unchanged.

Tested: Build and KUnit at this head: the arm64 Clang build (16 KiB pages) has no warnings, AVE KUnit passes 50/50 including the new ave_6070_h264_inter case, and strict checkpatch is clean. On the 11-22 base, the same commit took v4l2slh264dec decode of our encode from 4/120 to 120/120 frames in order, bit-exact against ffmpeg, on the M1 Pro and M2 (rows posted on #2375).

Risk: two-way · H.264 encode on Macs with the AVE 6070 command layout.

Not yet: a row at this exact head on the M1 Pro or M2 (encode a clip, decode it, check frame order). It goes in the next combined boot.

Details

The lambdas (64/256/64) are encoder quality weights, not hardware safety limits. The KUnit case checks both codecs with the capability on and off.

Evidence

Earlier rows: #2375 comments of 2026-11-22. Source item: REFMACS7.md:11.

Reapply the standalone H.264 fix from Lucas Goossen's first commit
in linux#2375 on main, without the rate-control and VUI changes.

A nonzero Process timescale makes P slices non-reference pictures
and leaves frame_num at 1. Write zero for H.264 while keeping PTS
in AVE_PROC_TIMESCALE. Set the Start motion lambdas for full-pel
search and inter/intra decisions to 64, 256 and 64 respectively.
These are encoder quality weights, not hardware safety limits.

Select the behavior with the command layout's h264_inter capability;
HEVC retains its timescale and other command layouts are unchanged.
The KUnit case checks both codecs with the capability on and off.


Signed-off-by: Lucas Goossen <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at a12ab26b

Blockers:

  1. Hosted CI at a12ab26b (20 jobs: apple-build, host-tests, pr-text, readiness, KUnit suites) is currently QUEUED; wait for green CI.
  2. Missing exact-head hardware encode+decode row at a12ab26b on an AVE 6070 Mac (M1 Pro or M2; prior 120/120 bit-exact rows were on #2375's 11-22 base; queued in Not yet:).

Checked: no Apple material, no AI attribution, preserves original author (Lucas Goossen) and human DCO Signed-off-by chain, selects behavior via command-layout capability ave_fw_layout.h264_inter (no chip/board if-gates, no new parameters, no hardcoded safety limits — motion lambdas 64/256/64 are encoder quality weights), HEVC and other command layouts are completely unchanged, ave_6070_h264_inter KUnit covers both H.264 and HEVC with h264_inter on and off (50/50 AVE KUnit PASS, arm64 Clang 16 KiB clean, checkpatch --strict clean), PR body has Tested: and Risk: two-way, branch is MERGEABLE against main.

Evidence
  • Inspected full diff (+123/-1 across abi.rst, ave-abi-test.c, ave-layout.c, ave-layout.h, ave-sess.c, ave-writer.c, ave.h):
    • ave-layout.c: enables .h264_inter = true and records Start offsets 0xff98/0xffa4/0xffa8 on ave_layout_6070_11_1.
    • ave-writer.c: writes 64, 256, 64 in ave_start_config() when p->h264_inter is set (H.264 branch only), and writes 0 to l->timescale in ave_build_process() when p->h264_inter && p->codec == AVE_CODEC_H264 while keeping AVE_PROC_TIMESCALE for HEVC and non-h264_inter layouts.
    • ave-abi-test.c: ave_6070_h264_inter() asserts both codecs with on = 0 and on = 1, verifying timescale, all three lambda words, and untouched h264_skip_mode / static_area_mask.
  • Code is clean; ready to approve and merge once CI is green and the exact-head M1 Pro / M2 encode+decode row passes at a12ab26b.

@github-actions github-actions Bot added area:media Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at a12ab26b: not ready yet

Check Detail
CI at head no failing: KUnit asahi, KUnit spi-hid-apple, KUnit avd, KUnit ave, KUnit isp, KUnit jpeg
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA a12ab26b, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · H.264 encode on Macs with the AVE 6070 command layout.

Areas: area:media

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at a12ab26b7472

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: no Apple material, no AI attribution, preserves original author (Lucas Goossen) and human DCO Signed-off-by chain, selects behavior via command-layout capability ave_fw_layout.h264_inter (no chip/board if-gates, no new parameters, no hardcoded safety limits — motion lambdas 64/256/64 are encoder quality weights), HEVC and other command layouts are completely unchanged, ave_6070_h264_inter KUnit covers both H.264 and HEVC with h264_inter on and off (50/50 AVE KUnit PASS, arm64 Clang 16 KiB clean, checkpatch --strict clean), PR body has Tested: and Risk: two-way, branch is MERGEABLE against main.

Follow-ups (not blocking): queued CI; AVE 6070 encode+decode row on M1 Pro/M2

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026

This branch has not been deployed

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

Labels

area:media Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants