Re: [PATCH v3 07/10] media: uapi: Add generic 8-bit metadata format definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jacopo,

On Fri, Aug 11, 2023 at 11:43:26AM +0200, Jacopo Mondi wrote:
> Hi Sakari
> 
> On Fri, Aug 11, 2023 at 09:11:39AM +0000, Sakari Ailus wrote:
> > Hi Jacopo,
> >
> > On Fri, Aug 11, 2023 at 08:31:16AM +0200, Jacopo Mondi wrote:
> > > > > +V4L2_META_FMT_GENERIC_CSI2_10
> > > > > +-----------------------------
> > > > > +
> > > > > +V4L2_META_FMT_GENERIC_CSI2_10 contains packed 8-bit generic metadata, 10 bits
> > > > > +for each 8 bits of data. Every four bytes of metadata is followed by a single
> > > > > +byte of padding. The way the data is stored follows the CSI-2 specification.
> > > > > +
> > > > > +This format is also used on CSI-2 on 20 bits per sample format that packs two
> > > > > +bytes of metadata into one sample.
> > > > > +
> > > > > +This format is little endian.
> > > > > +
> > > > > +**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_10.**
> > > > > +Each cell is one byte. "M" denotes a byte of metadata and "p" a byte of padding.
> > > >
> > > > I think you should document whether the padding is always 0 or can be any value.
> > > > Perhaps 'X' is a better 'name' for the padding byte in the latter case.
> > > >
> > >
> > > Did I get this right that this format is supposed to work as the RAW10
> > > CSI-2 packed image format, where 4 bytes contain the higher 8 bits of
> > > the 10 bits sample and the 5th byte every 4 contains the lower 2 bits of
> > > the previous 4 sample ?
> > >
> > > If that's the case, is 'padding' the correct term here ?
> >
> > What else would you call it? It'll be zeros that exist just due to the bit
> > depth used and as such not interesting at all.
> 
> Ah, they will be 0s! They won't contain the 2 lower bits of the
> previous 4 bytes then ?
> 
> I guess this is due to the fact the number of valid bits in each
> metadata sample is always 8, regardless of the sample size on the
> media bus ?

Correct. This is also documented for the generic metadata formats.

> 
> The DMA engine will re-pack them to CSI2_10 (or CSI2_12 etc) just to match
> the image format sizes then ?

Generally yes. The receiver hardware / DMA is of course free to strip out
the padding but in practice that doesn't seem to be done.

> 
> In this case, padding is indeed correct, sorry for the noise!

No problem.

-- 
Regards,

Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux