nvidia-vaapi-driver icon indicating copy to clipboard operation
nvidia-vaapi-driver copied to clipboard

Chromium SliceParams / SliceData interleave behavior

Open kode54 opened this issue 1 month ago • 3 comments

Chromium sends a whole batch of SliceParams in a row, then sends a single SliceData for the whole lot. I've formulated a patch that uses AppendableBuffers to store the slice data for all codecs, since this is apparently valid behavior in the API.

kode54 avatar Nov 16 '25 10:11 kode54

It's even weirder. They use a mapping mechanism to allocate buffers without assigning anything to them, then they map the buffer contents to the buffers. And the way they queue the buffers in the mapping list, at least for the AV1 handler, it lists the SliceData buffer before the SliceParams buffers. Who wrote this crap?

kode54 avatar Nov 16 '25 11:11 kode54

Yeah, looks like they're using some sort of sparse creation method that only takes buffer sizes, then maps the data pointers to them in one single call of another function. And yes, the AV1 implementation queues the slice data buffer first, then one slice param buffer per slice.

Also, it appears the AV1 code in this wrapper ends up setting the nNumSlices to double the number of slices. First it sets it to columns times rows, then it increments it for every slice param queued.

kode54 avatar Nov 17 '25 01:11 kode54

Grr. I fixed the uniform tile sizes issue. But I ran into another.

10 bit and possibly 12 bit per channel AV1 video files will try to decode to P010 or P012 format. But for some reason, both Chrome and Firefox are commanding the decoder to use an NV12 output format. And the output format can't be changed just based on the surface formats.

Bleh.

kode54 avatar Nov 18 '25 18:11 kode54