[PATCH 04/14] media: h264: Add stateless encode core

Nicolas Dufresne nicolas.dufresne at collabora.com
Tue Nov 17 13:37:28 PST 2026


Hi,

Le vendredi 22 mai 2026 à 12:16 +0200, Paul Kocialkowski a écrit :
> The H.264 stateless encode core is the common implementation called by
> drivers to coordinate stateless encoding. It provides all the relevant
> configuration parameters to drivers, through a state mechanism.
> 
> States are built from controls (some of which are optional) with various
> inter-control checks along the way. A state can be constrained by the
> driver through a dedicated operation callback in order to disable
> unsupported features that may have been requested by userspace.
> The general philosophy is to adapt parameters provided by userspace to
> reach a state that can be handled by the hardware and bail out if no
> such accommodation can be made.
> 
> Adapted parameters are returned to userspace by updating the controls.
> This is currently not attached to the inbound media request but should
> be when support for it becomes available.
> 
> Signed-off-by: Paul Kocialkowski <paulk at sys-base.io>
> 

Nice idea.

> +
> +static void state_debug(struct v4l2_h264_enc *enc)
> +{
> +	struct v4l2_h264_enc_state *state = &enc->state_active;
> +	struct v4l2_ctrl_h264_sps *sps = &state->sps;
> +	struct v4l2_ctrl_h264_pps *pps = &state->pps;
> +	struct v4l2_ctrl_h264_encode_params *encode = &state->encode;
> +
> +	pr_debug("+ v4l2-h264-enc: state");

Imagine you get two of these concurrently tracing, it will be hard to see what
is what, consider combining like we do for ref list.

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20261117/bb23d061/attachment.sig>


More information about the linux-arm-kernel mailing list