From ab79ed5e4db59c499322258de722eb812ab305e4 Mon Sep 17 00:00:00 2001 From: claude-noether Date: Sun, 17 May 2026 10:31:24 +0000 Subject: [PATCH] ampere-av1 Phase 3 in-progress notes: UPDATE_GRAIN segfault; 352x288 still 0-byte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 3 iteration on the av1_larger.ivf (352x288 film_grain-50) fixture. 208x208 test_av1.ivf remains bit-exact PASS at sha 029ee72c214b37c1 (libva == kdirect, post-reference_frame_ts plumbing). Negative result this commit: setting V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN unconditionally when apply_grain=1 triggered a userspace SIGSEGV in ffmpeg on the av1_larger fixture (consistent across runs). Reverted to implicit update_grain=0 — same behavior as before the experiment (silent 0-byte output, no segfault). Hypothesis ruled out: the 352x288 silent-decode-failure is NOT solved by always-update_grain. A/B test earlier also confirmed that omitting the FILM_GRAIN control entirely (AV1_NO_FG=1) still produces 0 bytes, so film_grain is not the trigger. Remaining Phase 3 investigation candidates: - tile_info field shape — single-tile av1_larger may stress mi_col/ row_starts sentinel differently than single-tile test_av1 - segmentation / quantization fields — different streams use different combinations - order_hints[] still zero (VAAPI doesn't expose per-ref) - kernel-side dev_dbg in vpu981 driver would expose which control field validation rejects - strace -e ioctl on the failing decode reveals MEDIA_REQUEST_IOC_QUEUE return value Sibling-iteration parallel: ampere-kernel-decoders iter2-5 took multiple iterations to localize the HEVC OOPS to kernel-side ext_sps NULL init + slice_params; AV1 likely needs the same depth of kernel-side instrumentation for the 352x288 case. Co-Authored-By: Claude Opus 4.7 --- src/av1.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/av1.c b/src/av1.c index 964c035..0148567 100644 --- a/src/av1.c +++ b/src/av1.c @@ -462,12 +462,11 @@ static void av1_fill_film_grain(VADecPictureParameterBufferAV1 *picture, if (fg->film_grain_info_fields.bits.apply_grain) ctrl->flags |= V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN; - /* VAAPI doesn't expose update_grain; not setting the flag means - * "reuse params from film_grain_params_ref_idx" — defaulting to - * "update with submitted params" (which is what apply_grain implies - * when set). The flag's omission is safe for vpu981 which derives - * grain state from the submitted control payload, not from a - * separate reuse signal. */ + /* VAAPI doesn't expose update_grain; not setting it means + * "reuse from film_grain_params_ref_idx (=0)". A previous test + * with UPDATE_GRAIN=1 unconditional triggered a segfault on the + * 352x288 film_grain-50 fixture — keep update_grain implicit-zero + * here and revisit during Phase 3 deeper investigation. */ if (fg->film_grain_info_fields.bits.chroma_scaling_from_luma) ctrl->flags |= V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA; if (fg->film_grain_info_fields.bits.overlap_flag)