public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media <linux-media@vger.kernel.org>,
	Volokh Konstantin <volokh84@gmail.com>,
	Pete Eberlein <pete@sensoray.com>,
	Ismael Luceno <ismael.luceno@corp.bluecherry.net>,
	Kamil Debski <k.debski@samsung.com>,
	Andrzej Hajda <a.hajda@samsung.com>
Subject: Re: [RFC] Motion Detection API
Date: Thu, 09 May 2013 00:12:42 +0200	[thread overview]
Message-ID: <518ACDDA.3080908@gmail.com> (raw)
In-Reply-To: <20130508162648.GG1075@valkosipuli.retiisi.org.uk>

Hi Sakari :-)

On 05/08/2013 06:26 PM, Sakari Ailus wrote:
> On Tue, May 07, 2013 at 04:04:10PM +0200, Sylwester Nawrocki wrote:
>> On 05/07/2013 02:35 PM, Hans Verkuil wrote:
>>> A metadata plane works well if you have substantial amounts of data (e.g. histogram
>>> data) but it has the disadvantage of requiring you to use the MPLANE buffer types,
>>> something which standard apps do not support. I definitely think that is overkill
>>> for things like this.
>>
>> Standard application could use the MPLANE interface through the libv4l-mplane
>> plugin [1]. And meta-data plane could be handled in libv4l, passed in raw form
>> from the kernel.
>>
>> There can be substantial amount of meta-data per frame and we were considering
>> e.g. creating separate buffer queue for meta-data, to be able to use mmaped
>> buffer at user space, rather than parsing and copying data multiple times in
>> the kernel until it gets into user space and is further processed there.
>
> What kind of metadata do you have?

At least I can tell of three kinds of meta-data at the moment:

  a) face/smile/blink detection markers (rectangles), see struct 
is_face_marker
     in file [1] in the media tree for more details; these markers can be
     available after an image frame is dequeued AFAIK, i.e. not immediately
     together with the image data,

  b) EXIF tags (struct exif_attribute in file [1]), it's a preprocessed by
     the ISP metadata appended to each buffer,

  c) the object detection bitmap, and this one can have size comparable to
     the actual image frame; I didn't see how it works in practice yet 
though.

For b) I have been re-considering using EXIF standard (chapter 4.6, [2]) to
create some sane interface for the ISP driver.

 From performance POV only c) would need a meta-data specific buffer 
queue, as
such data has similar characteristics to the actual image data and a DMA 
engine
is used to capture those bitmaps.

As far as we're not copying megabytes of data by CPU there should be no big
issues, I guess couple pages per frame is fine.

>> I'm actually not sure if performance is a real issue here, were are talking
>> of 1.5 KiB order amounts of data per frame. Likely on x86 desktop machines
>> it is not a big deal, for ARM embedded platforms we would need to do some
>> profiling.
>>
>> I'm not sure myself yet how much such motion/object detection data should be
>> interpreted in the kernel, rather than in user space. I suspect some generic
>> API like in your $subject RFC makes sense, it would cover as many cases as
>> possible. But I was wondering how much it makes sense to design a sort of
>> raw interface/buffer queue (similar to raw sockets concept), that would allow
>> user space libraries to parse meta-data.
>
> This was proposed as one possible solution in the Cambourne meeting.
>
> <URL:http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/36587>

Oh, thanks for bringing up those meeting minutes.

> I'm in favour of using a separate video buffer queue for passing low-level
> metadata to user space.

Sure. I certainly see a need for such an interface. I wouldn't like to 
see it
as the only option, however. One of the main reasons of introducing MPLANE
API was to allow capture of meta-data. We are going to finally prepare some
RFC regarding usage of a separate plane for meta-data capture. I'm not sure
yet how it would look exactly in detail, we've just discussed this topic
roughly with Andrzej.

>> The format of meta-data could for example have changed after switching to
>> a new version of device's firmware. It might be rare, I'm just trying to say
>> I would like to avoid designing a kernel interface that might soon become a
>> limitation.
>
> On some devices it seems the metadata consists of much higher level
> information.

Indeed. It seems in case of devices like OMAP3 ISP we need to deal 
mostly with
raw data from a Bayer sensor, while for the Exynos ISP I would need to 
expose
something produced by the standalone ISP from such a raw metadata.

[1] drivers/media/platform/exynos4-is/fimc-is-param.h
[2] http://www.exif.org/Exif2-2.PDF

--

Regards,
Sylwester

  reply	other threads:[~2013-05-08 22:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 15:36 [RFC] Motion Detection API Hans Verkuil
2013-04-21 12:04 ` Ismael Luceno
2013-04-22  7:55   ` Hans Verkuil
2013-04-29 20:52 ` Laurent Pinchart
2013-05-06 13:41   ` Hans Verkuil
2013-05-07 12:09     ` Laurent Pinchart
2013-05-07 12:35       ` Hans Verkuil
2013-05-07 14:04         ` Sylwester Nawrocki
2013-05-08 16:26           ` Sakari Ailus
2013-05-08 22:12             ` Sylwester Nawrocki [this message]
2013-05-21 17:30               ` Sakari Ailus
2013-05-22 21:41                 ` Sylwester Nawrocki
2013-06-03  1:25                   ` Sakari Ailus
2013-06-09 17:56                     ` Sylwester Nawrocki
2013-08-21 10:45                       ` Sakari Ailus
2013-05-07 20:59       ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518ACDDA.3080908@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=a.hajda@samsung.com \
    --cc=hverkuil@xs4all.nl \
    --cc=ismael.luceno@corp.bluecherry.net \
    --cc=k.debski@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=pete@sensoray.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    --cc=volokh84@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox