Le mercredi 15 janvier 2025 à 16:03 +0100, Paul Kocialkowski a écrit : > We could have some common per-codec bitstream generation v4l2 code with either > a cpu buffer access backend or a driver-specific implementation for writing the > bits. I already have a base for this in my cedrus h264 encoder work: > https://github.com/bootlin/linux/blob/cedrus/h264-encoding/drivers/staging/media/sunxi/cedrus/cedrus_enc_h264.c#L722 There is a lot of code in there that you can throw directly into v4l2-h264, this is exactly what that library is meant for. It had never meant to be limited to generating intermediate reference lists for decoders, or to be decoder specific. Note that golomb coding can further be generalized. I do agree at least for now that letting the driver write headers have more advantages. It allows notably to turn off the knobs that would not otherwise be supported. The modification would of course be reference at s_ctrl time, assuming you reuse existing sps/pps and other similar compound controls. As we didn't have encoder in mind when we created these compound controls, its possible that we'll have to add an extended one to fill the gaps, which has always been the plan. Nicolas