On Tue, 4 Jun 2019 10:12:10 +0200 Thierry Reding <thierry.reding@xxxxxxxxx> wrote: > On Mon, Jun 03, 2019 at 07:55:48PM -0400, Nicolas Dufresne wrote: > > Le lundi 03 juin 2019 à 23:48 +0200, Jernej Škrabec a écrit : > > > Dne ponedeljek, 03. junij 2019 ob 13:09:45 CEST je Boris Brezillon napisal(a): > > > > The driver only supports per-slice decoding, and in that mode > > > > decode_params->num_slices must be set to 1 and the slice_params array > > > > should contain only one element. > > > > > > What Cedrus actually needs to know is if this is first slice in frame or not. I > > > imagine it resets some stuff internally when first slice is processed. > > > > > > So if driver won't get all slices of one frame at once, it can't know if this > > > is first slice in frame or not. I guess we need additional flag for this. > > > > A first slice of a frame comes with a new timestamp, so you don't need > > a flag for that. > > But slices for the same frame will all have the same timestamp, so we > can't use the timestamp to tell the individual slices apart. I think Nicolas was suggesting to keep the last decoded slice timestamp around and check it against the new slice one. If they are different, that means we are dealing with a new frame, and this slice is the first in the frame. > > I mentioned this in that other thread, but I think it'd be useful to > pass along the number of each of the slices. Drivers can use this in > order to conceal errors when corrupt slices are detected during the > decode operation. > > So if we also passed a slice index along with the offset of the slice in > the bitstream, that should give us enough information to achieve both. A > slice with index 0 is obviously going to be the first slice in a frame. There's also the ->first_mb_in_slice field which should be 0 for the first slice and > 0 for others assuming userspace pass slices in order (might be an issue if we want to support ASO).