From 25d3e5f06f940097062eb5dd672437b6bd0c0c3a Mon Sep 17 00:00:00 2001 From: claude-noether Date: Thu, 14 May 2026 18:38:26 +0000 Subject: [PATCH] =?UTF-8?q?iter37:=20revert=20=CE=B1-26=20=E2=80=94=20deco?= =?UTF-8?q?de=5Fparams.short=5Fterm=5Fref=5Fpic=5Fset=5Fsize=20back=20to?= =?UTF-8?q?=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit α-26 (iter26) wrote VAAPI's picture->st_rps_bits to the V4L2 decode_params field of the same name based on field-name match. Per V4L2 spec, this field is the bit-count of st_ref_pic_set() *in the SPS* — VAAPI doesn't expose that. The slice-header bit-count (which IS what VAAPI's st_rps_bits provides) belongs in slice_params->short_term_ref_pic_set_size (handled correctly in α-29). rkvdec doesn't read decode_params->short_term_ref_pic_set_size, so the misroute was harmless but stale. This revert restores spec-correct semantics (0 when SPS bit-count is unknown). Cosmetic cleanup; no functional change. --- src/h265.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/h265.c b/src/h265.c index 76eabef..59f06bb 100644 --- a/src/h265.c +++ b/src/h265.c @@ -314,18 +314,19 @@ static void h265_fill_decode_params(struct request_data *driver_data, decode_params->num_poc_st_curr_after = n_st_after; decode_params->num_poc_lt_curr = n_lt; /* - * iter26 α-26: VAAPI DOES expose short_term_ref_pic_set bit-count - * via picture->st_rps_bits. Without populating this, rkvdec's - * DPB reference resolution for P/B frames uses the wrong slice- - * header skip and reads the wrong reference; frame 1 (IDR) decodes - * correctly but frames 2+ diverge (iter25 evidence: cmp differs at - * byte 1382401 = frame 2 boundary, kdirect bytes 4-5 = 0x0a 0x00, - * libva = 0x00 0x00). + * decode_params->short_term_ref_pic_set_size is the bit-count of + * short_term_ref_pic_set() inside the **SPS** (per V4L2 spec + * v4l2-controls.h doc). VAAPI doesn't expose this — it exposes + * picture->st_rps_bits which is the bit-count of st_ref_pic_set() + * inside the **slice header** when short_term_ref_pic_set_sps_flag=0. + * That value belongs in slice_params->short_term_ref_pic_set_size, + * not here (see [[va-st-rps-bits-is-slice-field]] memory + α-29). * - * long_term_ref_pic_set_size and num_delta_pocs_of_ref_rps_idx still - * left zero (VAAPI doesn't expose either). + * α-26 wrote st_rps_bits to this decode_params field in iter26 by + * field-name match; rkvdec doesn't read this field at all, so the + * misroute was harmless but stale. iter36 reverts to 0. */ - decode_params->short_term_ref_pic_set_size = picture->st_rps_bits; + decode_params->short_term_ref_pic_set_size = 0; /* * iter11 α-14: IRAP/IDR/NO_OUTPUT_OF_PRIOR flags. VAAPI doesn't