Hi, Le Wed 15 Jan 25, 14:51, Nicolas Dufresne a écrit : > 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. Yes it seems common that hardware will not support certain features or values and need some bitstream values set to some hard-coded values. There's also various controls for the stateful API that define most of the basic things that can be configured in the SPS/PPS. Then each driver exposing what it supports is a pretty good fit. > 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. I'm not really sure it's needed to pass the whole pps/sps in controls. Reusing the individual stafeul controls feels like a good fit from what I can see. And yes we'd need some extra info to be passed from userspace about things like frame type, qp, etc that will impact the generated bitstream. Paul -- Paul Kocialkowski, Independent contractor - sys-base - https://www.sys-base.io/ Free software developer - https://www.paulk.fr/ Expert in multimedia, graphics and embedded hardware support with Linux.
Attachment:
signature.asc
Description: PGP signature