iter36: remove env-gated DIAG probes (iter29/30/33/35)

Cleans up the campaign's exploratory env-gated dumps now that all
bugs are fixed:
- iter29 LIBVA_HEVC_DUMP_SLICE_TAIL (h265.c) — refuted 40-byte inflation theory
- iter30 LIBVA_TS_SCALE (picture.c) — refuted timestamp magnitude theory
- iter33 LIBVA_VP8_DUMP_FRAME (vp8.c) — led to α-30 fix
- iter35 LIBVA_MPEG2_DUMP_FRAME (mpeg2.c) — confirmed MPEG-2 ctrls correct

Total: -131 lines / +7 lines (α-7 comment refresh).

Preexisting framework env knobs retained:
- LIBVA_V4L2_DUMP_OUTPUT (picture.c α-16)
- LIBVA_V4L2_DUMP_CAPTURE (surface.c)
- LIBVA_V4L2_ZERO_CAPTURE (picture.c)
- LIBVA_V4L2_REQUEST_VIDEO_PATH / MEDIA_PATH / NO_AUTODETECT (request.c)

The 3 load-bearing fixes remain unchanged:
α-25 (rkvdec image_fmt pre-seed, src/context.c)
α-29 (slice_params.short_term_ref_pic_set_size, src/h265.c)
α-30 (VP8 OUTPUT header prepend, src/picture.c)
This commit is contained in:
2026-05-14 18:12:55 +00:00
parent 48fd0288c3
commit 7db15a5685
4 changed files with 7 additions and 131 deletions
-21
View File
@@ -70,7 +70,6 @@
#include "surface.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -631,26 +630,6 @@ int h265_set_controls(struct request_data *driver_data,
cumulative_offset,
&slice_params_array[i]);
/* iter29 DIAG: dump trailing 80 bytes of each HEVC slice.
* Set LIBVA_HEVC_DUMP_SLICE_TAIL=1 to enable. Goal: characterise
* the 40-byte inflation in ffmpeg-vaapi vs ffmpeg-v4l2request for
* frame 2+ slices (see iter27/28 close). */
if (getenv("LIBVA_HEVC_DUMP_SLICE_TAIL")) {
uint32_t sz = slice->slice_data_size;
uint32_t boff = slice->slice_data_byte_offset;
uint8_t *p = (uint8_t *)surface_object->source_data + cumulative_offset;
uint32_t dump_n = sz < 80 ? sz : 80;
uint32_t start = sz - dump_n;
uint32_t k;
fprintf(stderr, "iter29 slice[%u] nut=%u size=%u boff=%u start_in_slice=%u tail80:",
i, slice_params_array[i].nal_unit_type, sz, boff, start);
for (k = 0; k < dump_n; k++) {
if ((k & 0xf) == 0) fprintf(stderr, "\n +%04x:", start + k);
fprintf(stderr, " %02x", p[start + k]);
}
fprintf(stderr, "\n");
}
cumulative_offset += slice->slice_data_size;
}
-24
View File
@@ -57,9 +57,6 @@
#include "surface.h"
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
@@ -224,27 +221,6 @@ int mpeg2_set_controls(struct request_data *driver_data,
* surface's permanent request_fd (iter6 per-OUTPUT-slot binding;
* picture.c:284 sets surface_object->request_fd at BeginPicture).
*/
/* iter35 DIAG: dump v4l2_ctrl_mpeg2_* contents. LIBVA_MPEG2_DUMP_FRAME=1 */
if (getenv("LIBVA_MPEG2_DUMP_FRAME")) {
uint8_t *sb = (uint8_t *)&sequence;
uint8_t *pb = (uint8_t *)&pic;
uint8_t *qb = (uint8_t *)&quant;
unsigned int k;
fprintf(stderr, "mpeg2: SEQ size=%zu ", sizeof(sequence));
for (k = 0; k < sizeof(sequence); k++)
fprintf(stderr, "%02x ", sb[k]);
fprintf(stderr, "\nmpeg2: PIC size=%zu [0..32]=", sizeof(pic));
for (k = 0; k < 32 && k < sizeof(pic); k++)
fprintf(stderr, "%02x ", pb[k]);
fprintf(stderr, "\nmpeg2: PIC [32..end]=");
for (k = 32; k < sizeof(pic); k++)
fprintf(stderr, "%02x ", pb[k]);
fprintf(stderr, "\nmpeg2: QUANT size=%zu [0..16]=", sizeof(quant));
for (k = 0; k < 16; k++)
fprintf(stderr, "%02x ", qb[k]);
fprintf(stderr, "\n");
}
struct v4l2_ext_control ctrls[3] = {
{
.id = V4L2_CID_STATELESS_MPEG2_SEQUENCE,
+7 -19
View File
@@ -497,27 +497,15 @@ VAStatus RequestEndPicture(VADriverContextP context, VAContextID context_id)
/*
* iter9 α-7: monotonic per-context counter instead of gettimeofday,
* so DPB.reference_ts / OUTPUT QBUF ts stay small (matches
* ffmpeg-v4l2request's pattern). gettimeofday's giant ns may or may
* not be load-bearing for rkvdec's reference resolution — Phase 5
* reviewer flagged this as low-probability (VP9/MPEG-2 use the same
* pattern and PASS), but this is the only remaining wire-byte diff.
*
* iter30 DIAG: LIBVA_TS_SCALE env-gated multiplier so we can sweep
* timestamp magnitude to test whether small-ts collides with stale
* CAPTURE entries in vb2_find_buffer for HEVC frame 2+ divergence.
* ffmpeg-v4l2request's pattern). Confirmed in iter30 sweep
* (1×, 1000×, 1000000× multipliers all produce identical output);
* the counter scheme works on both rkvdec and hantro vb2_find_buffer.
*/
context_object->timestamp_counter++;
{
uint64_t ns = (uint64_t)context_object->timestamp_counter * 1000;
const char *scale = getenv("LIBVA_TS_SCALE");
if (scale && scale[0] != '\0') {
uint64_t mul = (uint64_t)strtoull(scale, NULL, 0);
if (mul > 0)
ns *= mul;
}
surface_object->timestamp.tv_sec = (time_t)(ns / 1000000000ULL);
surface_object->timestamp.tv_usec = (suseconds_t)((ns / 1000ULL) % 1000000ULL);
}
surface_object->timestamp.tv_sec =
(time_t)(context_object->timestamp_counter / 1000000);
surface_object->timestamp.tv_usec =
(suseconds_t)(context_object->timestamp_counter % 1000000);
/*
* iter6: request_fd was bound to the surface in BeginPicture from
-67
View File
@@ -59,8 +59,6 @@
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
@@ -246,71 +244,6 @@ int vp8_set_controls(struct request_data *driver_data,
if (picture->pic_fields.bits.sign_bias_alternate)
frame.flags |= V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT;
/* iter33 DIAG: dump v4l2_ctrl_vp8_frame contents.
* LIBVA_VP8_DUMP_FRAME=1 enables. */
if (getenv("LIBVA_VP8_DUMP_FRAME")) {
uint8_t *p = (uint8_t *)&frame;
uint32_t k;
fprintf(stderr,
"vp8: width=%u height=%u version=%u flags=0x%llx num_dct=%u\n",
frame.width, frame.height, frame.version,
(unsigned long long)frame.flags, frame.num_dct_parts);
fprintf(stderr,
"vp8: first_part_size=%u first_part_header_bits=%u prob_skip_false=%u prob_intra=%u prob_last=%u prob_gf=%u\n",
frame.first_part_size, frame.first_part_header_bits,
frame.prob_skip_false, frame.prob_intra,
frame.prob_last, frame.prob_gf);
fprintf(stderr,
"vp8: lf level=%u sharpness=%u flags=0x%x ref_frm_delta=[%d %d %d %d] mb_mode_delta=[%d %d %d %d]\n",
frame.lf.level, frame.lf.sharpness_level, frame.lf.flags,
frame.lf.ref_frm_delta[0], frame.lf.ref_frm_delta[1],
frame.lf.ref_frm_delta[2], frame.lf.ref_frm_delta[3],
frame.lf.mb_mode_delta[0], frame.lf.mb_mode_delta[1],
frame.lf.mb_mode_delta[2], frame.lf.mb_mode_delta[3]);
fprintf(stderr,
"vp8: quant y_ac=%u y_dc_d=%d y2_dc_d=%d y2_ac_d=%d uv_dc_d=%d uv_ac_d=%d\n",
frame.quant.y_ac_qi, frame.quant.y_dc_delta,
frame.quant.y2_dc_delta, frame.quant.y2_ac_delta,
frame.quant.uv_dc_delta, frame.quant.uv_ac_delta);
fprintf(stderr,
"vp8: seg flags=0x%x quant_update=[%d %d %d %d] lf_update=[%d %d %d %d]\n",
frame.segment.flags,
frame.segment.quant_update[0], frame.segment.quant_update[1],
frame.segment.quant_update[2], frame.segment.quant_update[3],
frame.segment.lf_update[0], frame.segment.lf_update[1],
frame.segment.lf_update[2], frame.segment.lf_update[3]);
fprintf(stderr,
"vp8: coder range=%u value=%u bit_count=%u\n",
frame.coder_state.range, frame.coder_state.value,
frame.coder_state.bit_count);
fprintf(stderr, "vp8: dct_part_sizes=[");
for (k = 0; k < 8; k++)
fprintf(stderr, "%u%s", frame.dct_part_sizes[k],
k < 7 ? " " : "]\n");
fprintf(stderr,
"vp8: refs last=%llu golden=%llu alt=%llu\n",
(unsigned long long)frame.last_frame_ts,
(unsigned long long)frame.golden_frame_ts,
(unsigned long long)frame.alt_frame_ts);
fprintf(stderr, "vp8: entropy y_mode_probs=[%u %u %u %u] uv_mode_probs=[%u %u %u]\n",
frame.entropy.y_mode_probs[0], frame.entropy.y_mode_probs[1],
frame.entropy.y_mode_probs[2], frame.entropy.y_mode_probs[3],
frame.entropy.uv_mode_probs[0], frame.entropy.uv_mode_probs[1],
frame.entropy.uv_mode_probs[2]);
fprintf(stderr, "vp8: coeff_probs[0][0][0][0..11]=");
for (k = 0; k < 11; k++)
fprintf(stderr, "%u ", frame.entropy.coeff_probs[0][0][0][k]);
fprintf(stderr, "\n");
fprintf(stderr, "vp8: VAAPI-src probability_set=%d dct_coeff_probs[0][0][0][0..11]=",
probability_set);
for (k = 0; k < 11; k++)
fprintf(stderr, "%u ", probability->dct_coeff_probs[0][0][0][k]);
fprintf(stderr, "\n");
fprintf(stderr, "vp8: VAAPI-src probability size=%zu ptr=%p\n",
sizeof(*probability), (void *)probability);
(void)p;
}
/* Clause 1+10: single-control batched submission */
struct v4l2_ext_control ctrls[1] = {
{