Re: [PATCH v6 11/17] media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS control

From: Nicolas Dufresne
Date: Wed Jun 01 2022 - 13:08:13 EST


Le mercredi 01 juin 2022 à 18:35 +0200, Jernej Škrabec a écrit :
> > I believe its defined following "Table A.8 – General tier and level limits".
> > With the assumption there will never be a level 7 (which I think is fair).
> > If anyone saw other reasons for this limit, let me know.
> >
> > This is a worse case scenario, this is quite unlikely in practice, so while
> > performance might be a disaster if your craft a stream for that case, I
> > don't think it will ever happen in real life.
>
> But do we really need to cover worst case scenario? In theory, one driver can
> set limit to (for example) max 100 slices and if there is a frame with 600
> slices, userspace app would submit 6 decode requests. Basically the same way
> it's done today. While not as performant, it would be good compromise between
> resources and speed.

The limit here is to prevent userland from tricking the kernel into doing very
big allocation. But with dynamic array, you'll allocate just the right amount.

Nicolas