Files
openwrt/target/linux/rockchip
Daniel Golle bf610ebb84 rockchip: rkvenc: retry a frame whose bitstream overflowed
A job whose bitstream overflows the capture buffer counts as a
hardware fault: two in a row put both queues into error and end the
stream. The rate controller reaches that state on its own whenever a
few dark frames drive the QP to the floor and the next bright frame
no longer fits, which a start into a sunlit scene does on every other
attempt even with the step limiter fixed.

Handle the overflow as the rate-control event it is: force clear, feed
the controller the buffer size as the frame size, restart that frame
type from its control QP and run the same frame again while the job
stays running for the mem2mem framework, so user space sees one late
frame and no dropped one. An IDR that carried the joined parameter
sets carries them again on the retry. A frame that overflows twice is
a fault as before, and the consecutive error count stays with the bus
errors, the hardware watchdog and the job timeout. A timed out job
clears the latched status before it starts so that it is never taken
for an overflow.

Fixes: 64129c4282 ("rockchip: add the RKVENC H.264 and HEVC encoder")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-10-31 10:52:53 +00:00
..