feat(venc): expose video0.maxIpProp, the RC I-to-P size cap the firmware honours - #111
feat(venc): expose video0.maxIpProp, the RC I-to-P size cap the firmware honours#111vertexodessa wants to merge 1 commit into
Conversation
PR Summary by QodoExpose video0.maxIpProp (u32MaxIPProp) as live CBR I/P size cap
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
Code Review by Qodo
1. Non-CBR returns 500
|
…are honours The per-frame byte caps maxIBytes/maxPBytes are dead on Star6E firmware: probed live 2026-08-22 under H.265 CBR, IDRs measured an identical 42-44 KB with the caps at 2000, 26000, and 8, and the RC priority switch changed nothing. qpDelta barely moves IDR size either (43 KB at 0 and at -6) because the CBR rate controller owns the I/P QP relationship. The parameter the SigmaStar CBR RC actually honours for I-frame size is u32MaxIPProp in MI_VENC_RcParam_t (stParamH265Cbr / stParamH264Cbr), the cap on I-frame size as a proportion of P frames. waybeam never set it, so the permissive SDK default is why recovery IDRs land at ~3x the P-frame budget and occupy the air for ~60 ms at 10 Mbps. This adds video0.maxIpProp (canonical video0.max_ip_prop), live on Star6E and Maruko, CBR only (other rate modes fail the apply with 409). 0 = SDK default: the first apply captures the driver's value so 0 can restore it live, mirroring the minQp/maxQp pattern. Applied at boot when persisted and via /set and /live/set through a new LIVE_GROUP_MAX_IP_PROP. CV610 reports the field unsupported. Validation follows minQp/maxQp: validate_field_cfg() bounds the value to 0..100 and rejects a non-zero value under any rc_mode other than cbr, and the key is in the loaded-config set. That is what makes the documented 409 true — the backend apply returns -1 on non-CBR, which the live-set path would otherwise report as 500 — and it also catches a negative JSON value, which the loader wraps large through the unsigned field. The captured driver default lives in each backend's existing control context rather than a new file-scope global. Contract 0.18.2 -> 0.18.3 (additive). config/waybeam.default.json gains the field at 0 so the save-layout byte-equal test keeps policing the printer. tests/test_venc_config.c pins the loader-side rules. Verified: make test 2491/0; star6e and maruko cross-builds clean.
429b86b to
e151a37
Compare
|
Adversarial review at Blocking defect: the CBR dependency is validated only when the changed key is The current tests cover loader validation only. Please also cover:
The PR text is accurate that Star6E and Maruko are wired through RC-param read/modify/write, CV610 is capability-gated, persisted validation catches wrapped negatives, and Maruko is compile-tested only. The statements that I reproduced |
|
Maruko device test report (device observations only)
Live/API checks under H.265 CBR, 1280x720@30, 10000 kbps, one-second GOP,
The probe received 480 sidecar FRAME datagrams per run; the size table includes only frames for which the probe matched RTP and sidecar metadata. In this scene, IDRs were already smaller than median P frames, and the tested values did not produce a monotonic/reproducible decrease. This test therefore verifies API/apply stability but does not demonstrate a binding A second matrix used 3000 kbps,
Validation/persistence observations:
Existing byte-field comparison on the same device/config family, using forced IDRs:
Not tested here: Star6E, non-CBR modes, H.264, or a scene/config where IDRs exceed P frames enough to demonstrate whether |
|
Star6E high-bitrate device test report (device observations only)
Isolation correction: the first run was excluded after Common isolated config: CBR, one-second GOP, At an achieved 24.7..25.5 Mbps, a continuous-motion paired sidecar sample produced:
Direct off-device H.265 access-unit measurements (
At an achieved 38.1..40.8 Mbps, direct six-second captures produced:
In these 25/40 Mbps configurations, value 1 reproducibly reduced key-AU size; value 2 reduced it in the 25 Mbps samples but not the 40 Mbps sample; values 4 and 100 matched the default-sized key AUs. Key AUs were already much smaller than ordinary AUs in every sample. Full-frame motion did not create the 42–44 KB IDR population described in the PR text on this device/config. Existing byte-field comparison at achieved 25 Mbps:
Not tested here: H.264, non-CBR rate modes, IMX415, or another Star6E firmware build. After testing, the original binary and config SHA-256 hashes matched their pre-test values, the original frame-SHM configuration was active, and |
|
Setup details for the Star6E measurements above The encoder binary under test was the PR-head Star6E build already identified above:
Sensor/IQ environment:
Encoder/test options after stopping the interfering
No recording path was enabled and no capture was written on the device. |
|
Heads-up: #114 (parity sync v0.65.2 → v0.67.1, 54 commits) is open and will conflict with this one. This PR claims Code overlap is real but small: #114 touches Sorry for the churn — happy to help with the rebase if useful. |
|
#114 is merged, so this now shows as conflicting. Nine files overlap: Most of it is mechanical — the sync added Bookkeeping to re-cut: |
Summary
Exposes
video0.maxIpProp(canonicalvideo0.max_ip_prop): theu32MaxIPPropfield ofMI_VENC_RcParam_t(stParamH265Cbr/stParamH264Cbr), the CBR rate controller's cap on I-frame size as a proportion of P frames.Motivation: the per-frame byte caps
maxIBytes/maxPBytesare inert on Star6E firmware. Probed live 2026-08-22 under H.265 CBR at 10 Mbps, IDRs measured an identical 42-44 KB with the caps at 2000, 26000, and 8, and switching RC priority changed nothing.qpDeltabarely moves IDR size either (43 KB at 0 and at -6) because the CBR RC owns the I/P QP relationship.u32MaxIPPropis the parameter the SigmaStar CBR RC actually honours; waybeam never set it, so the permissive SDK default is why recovery IDRs land at ~3x the P-frame budget and occupy ~60 ms of air at 10 Mbps.Behaviour
/setand/live/set, through a newLIVE_GROUP_MAX_IP_PROP. Applied at boot when persisted.0..100, CBR only. Validated invalidate_field_cfg()likeminQp/maxQp: values above 100 and a non-zero value under a non-CBRrc_modeare rejected with 409 on/set,/live/set, and at config load, so the backend apply never sees them (and a negative JSON value, which the loader wraps large, is caught the same way).0= SDK default. The first apply captures the driver's value so0can restore it live, mirroring theminQp/maxQppattern. The captured default lives in each backend's existing control context struct, not a new file-scope global.HTTP_API_CONTRACT.md,/api/v1/versionstring bumped.config/waybeam.default.jsongains"maxIpProp": 0so the save-layout byte-equal test keeps policing the printer.VERSION0.65.2 -> 0.66.0,HISTORY.mdentry.Verification
make test: 2491 passed, 0 failed (adds a loader validation table formaxIpProp)make build SOC_BUILD=star6eandSOC_BUILD=maruko: cleanIndependent of #110; whichever merges second needs a trivial
VERSION/HISTORY.mdrebase.