All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Subject: Re: [PATCH/RFC 2/2] v4l: Define a pixel format for the R-Car VSP1 1-D histogram engine
Date: Thu, 21 Apr 2016 12:43:57 +0300	[thread overview]
Message-ID: <20160421094357.GB32125@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <1461199227-22506-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent,

On Thu, Apr 21, 2016 at 03:40:27AM +0300, Laurent Pinchart wrote:
> The format is used on the R-Car VSP1 video queues that carry
> 1-D histogram statistics data.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  .../DocBook/media/v4l/pixfmt-meta-vsp1-hgo.xml     | 307 +++++++++++++++++++++
>  Documentation/DocBook/media/v4l/pixfmt.xml         |   9 +
>  drivers/media/v4l2-core/v4l2-ioctl.c               |   1 +
>  include/uapi/linux/videodev2.h                     |   3 +
>  4 files changed, 320 insertions(+)
>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-meta-vsp1-hgo.xml
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-meta-vsp1-hgo.xml b/Documentation/DocBook/media/v4l/pixfmt-meta-vsp1-hgo.xml
> new file mode 100644
> index 000000000000..b40bd10695d2
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/pixfmt-meta-vsp1-hgo.xml
> @@ -0,0 +1,307 @@
> +<refentry id="V4L2-META-FMT-VSP1-HGO">
> +  <refmeta>
> +    <refentrytitle>V4L2_META_FMT_VSP1_HGO ('VSPH')</refentrytitle>
> +    &manvol;
> +  </refmeta>
> +  <refnamediv>
> +    <refname>
> +      <constant>V4L2_META_FMT_VSP1_HGO</constant>
> +    </refname>
> +    <refpurpose>Renesas R-Car VSP1 1-D Histogram Data</refpurpose>
> +  </refnamediv>
> +  <refsect1>
> +    <title>Description</title>
> +    <para>
> +This format describes histogram data generated by the Renesas R-Car VSP1 1-D
> +Histogram (HGO) engine.
> +    </para>
> +    <para>
> +The VSP1 HGO is a histogram computation engine that can operate on RGB, YCrCb
> +or HSV data. It operates on a possibly cropped and subsampled input image and
> +computes the minimum, maximum and sum of all pixels as well as per-channel
> +histograms.
> +    </para>
> +The HGO can compute histograms independently per channel, on the maximum of the
> +three channels (RGB data only) or on the Y channel only (YCbCr only). It can
> +additionally output the histogram with 64 or 256 bins, resulting in four
> +possible modes of operation.
> +      <itemizedlist>
> +	<listitem>
> +	  <para>
> +	    In <emphasis>64 bins normal mode</emphasis>, the HGO operates
> +	    on the three channels independently to compute three 64-bins
> +	    histograms. RGB, YCbCr and HSV image formats are supported.
> +	  </para>
> +	</listitem>
> +	<listitem>
> +	  <para>
> +	    In <emphasis>64 bins maximum mode</emphasis>, the HGO operates
> +	    on the maximum of the (R, G, B) channels to compute a single
> +	    64-bins histogram. Only the RGB image format is supported.
> +	  </para>
> +	</listitem>
> +	<listitem>
> +	  <para>
> +	    In <emphasis>256 bins normal mode</emphasis>, the HGO operates
> +	    on the Y channel to compute a single 256-bins histogram. Only the
> +	    YCbCr image format is supported.
> +	  </para>
> +	</listitem>
> +	<listitem>
> +	  <para>
> +	    In <emphasis>256 bins maximum mode</emphasis>, the HGO operates
> +	    on the maximum of the (R, G, B) channels to compute a single
> +	    256-bins histogram. Only the RGB image format is supported.
> +	  </para>
> +	</listitem>
> +      </itemizedlist>
> +    <para>
> +    </para>
> +    <para>
> +All data is stored in memory in little endian format. Each cell in the tables
> +below contains one byte.
> +    </para>
> +    <table frame="none">
> +      <title>VSP1 HGO Data - 64 Bins, Normal Mode (792 bytes)</title>
> +      <tgroup cols="5">
> +	<colspec colnum="1" colname="offset" align="left" />
> +	<colspec colnum="2" colname="b3"     align="center" />
> +	<colspec colnum="3" colname="b2"     align="center" />
> +	<colspec colnum="4" colname="b1"     align="center" />
> +	<colspec colnum="5" colname="b0"     align="center" />
> +	<spanspec namest="b3" nameend="b0" spanname="word" colsep="1" align="center" />
> +	<thead>
> +	  <row>
> +	    <entry>Offset</entry>
> +	    <entry spanname="word">Memory</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry>[31:24]</entry>
> +	    <entry>[23:16]</entry>
> +	    <entry>[15:8]</entry>
> +	    <entry>[7:0]</entry>
> +	  </row>
> +	</thead>
> +	<tbody valign="top">
> +	  <row>
> +	    <entry>0</entry>
> +	    <entry>-</entry>
> +	    <entry>R/Cr/H max [7:0]</entry>
> +	    <entry>-</entry>
> +	    <entry>R/Cr/H min [7:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>4</entry>
> +	    <entry>-</entry>
> +	    <entry>G/Y/S max [7:0]</entry>
> +	    <entry>-</entry>
> +	    <entry>G/Y/S min [7:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>8</entry>
> +	    <entry>-</entry>
> +	    <entry>B/Cb/V max [7:0]</entry>
> +	    <entry>-</entry>
> +	    <entry>B/Cb/V min [7:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>12</entry>
> +	    <entry spanname="word">R/Cr/H sum [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>16</entry>
> +	    <entry spanname="word">G/Y/S sum [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>20</entry>
> +	    <entry spanname="word">B/Cb/V sum [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>24</entry>
> +	    <entry spanname="word">R/Cr/H bin 0 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry spanname="word">...</entry>
> +	  </row>
> +	  <row>
> +	    <entry>276</entry>
> +	    <entry spanname="word">R/Cr/H bin 63 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>280</entry>
> +	    <entry spanname="word">G/Y/S bin 0 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry spanname="word">...</entry>
> +	  </row>
> +	  <row>
> +	    <entry>532</entry>
> +	    <entry spanname="word">G/Y/S bin 63 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>536</entry>
> +	    <entry spanname="word">B/Cb/V bin 0 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry spanname="word">...</entry>
> +	  </row>
> +	  <row>
> +	    <entry>788</entry>
> +	    <entry spanname="word">B/Cb/V bin 63 [31:0]</entry>
> +	  </row>
> +	</tbody>
> +      </tgroup>
> +    </table>
> +    <table frame="none">
> +      <title>VSP1 HGO Data - 64 Bins, Max Mode (264 bytes)</title>
> +      <tgroup cols="5">
> +	<colspec colnum="1" colname="offset" align="left" />
> +	<colspec colnum="2" colname="b3"     align="center" />
> +	<colspec colnum="3" colname="b2"     align="center" />
> +	<colspec colnum="4" colname="b1"     align="center" />
> +	<colspec colnum="5" colname="b0"     align="center" />
> +	<spanspec namest="b3" nameend="b0" spanname="word" colsep="1" align="center" />
> +	<thead>
> +	  <row>
> +	    <entry>Offset</entry>
> +	    <entry spanname="word">Memory</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry>[31:24]</entry>
> +	    <entry>[23:16]</entry>
> +	    <entry>[15:8]</entry>
> +	    <entry>[7:0]</entry>
> +	  </row>
> +	</thead>
> +	<tbody valign="top">
> +	  <row>
> +	    <entry>0</entry>
> +	    <entry>-</entry>
> +	    <entry>max(R,G,B) max [7:0]</entry>
> +	    <entry>-</entry>
> +	    <entry>max(R,G,B) min [7:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>4</entry>
> +	    <entry spanname="word">max(R,G,B) sum [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>8</entry>
> +	    <entry spanname="word">max(R,G,B) bin 0 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry spanname="word">...</entry>
> +	  </row>
> +	  <row>
> +	    <entry>260</entry>
> +	    <entry spanname="word">max(R,G,B) bin 63 [31:0]</entry>
> +	  </row>
> +	</tbody>
> +      </tgroup>
> +    </table>
> +    <table frame="none">
> +      <title>VSP1 HGO Data - 256 Bins, Normal Mode (1032 bytes)</title>
> +      <tgroup cols="5">
> +	<colspec colnum="1" colname="offset" align="left" />
> +	<colspec colnum="2" colname="b3"     align="center" />
> +	<colspec colnum="3" colname="b2"     align="center" />
> +	<colspec colnum="4" colname="b1"     align="center" />
> +	<colspec colnum="5" colname="b0"     align="center" />
> +	<spanspec namest="b3" nameend="b0" spanname="word" colsep="1" align="center" />
> +	<thead>
> +	  <row>
> +	    <entry>Offset</entry>
> +	    <entry spanname="word">Memory</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry>[31:24]</entry>
> +	    <entry>[23:16]</entry>
> +	    <entry>[15:8]</entry>
> +	    <entry>[7:0]</entry>
> +	  </row>
> +	</thead>
> +	<tbody valign="top">
> +	  <row>
> +	    <entry>0</entry>
> +	    <entry>-</entry>
> +	    <entry>Y max [7:0]</entry>
> +	    <entry>-</entry>
> +	    <entry>Y min [7:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>4</entry>
> +	    <entry spanname="word">Y sum [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>8</entry>
> +	    <entry spanname="word">Y bin 0 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry spanname="word">...</entry>
> +	  </row>
> +	  <row>
> +	    <entry>1028</entry>
> +	    <entry spanname="word">Y bin 255 [31:0]</entry>
> +	  </row>
> +	</tbody>
> +      </tgroup>
> +    </table>
> +    <table frame="none">
> +      <title>VSP1 HGO Data - 256 Bins, Max Mode (1032 bytes)</title>
> +      <tgroup cols="5">
> +	<colspec colnum="1" colname="offset" align="left" />
> +	<colspec colnum="2" colname="b3"     align="center" />
> +	<colspec colnum="3" colname="b2"     align="center" />
> +	<colspec colnum="4" colname="b1"     align="center" />
> +	<colspec colnum="5" colname="b0"     align="center" />
> +	<spanspec namest="b3" nameend="b0" spanname="word" colsep="1" align="center" />
> +	<thead>
> +	  <row>
> +	    <entry>Offset</entry>
> +	    <entry spanname="word">Memory</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry>[31:24]</entry>
> +	    <entry>[23:16]</entry>
> +	    <entry>[15:8]</entry>
> +	    <entry>[7:0]</entry>
> +	  </row>
> +	</thead>
> +	<tbody valign="top">
> +	  <row>
> +	    <entry>0</entry>
> +	    <entry>-</entry>
> +	    <entry>max(R,G,B) max [7:0]</entry>
> +	    <entry>-</entry>
> +	    <entry>max(R,G,B) min [7:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>4</entry>
> +	    <entry spanname="word">max(R,G,B) sum [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry>8</entry>
> +	    <entry spanname="word">max(R,G,B) bin 0 [31:0]</entry>
> +	  </row>
> +	  <row>
> +	    <entry></entry>
> +	    <entry spanname="word">...</entry>
> +	  </row>
> +	  <row>
> +	    <entry>1028</entry>
> +	    <entry spanname="word">max(R,G,B) bin 255 [31:0]</entry>
> +	  </row>
> +	</tbody>
> +      </tgroup>
> +    </table>
> +  </refsect1>
> +</refentry>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
> index 5a08aeea4360..b001e7c29859 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -1740,6 +1740,15 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
>      </table>
>    </section>
>  
> +  <section id="meta-formats">
> +    <title>Meta-data Formats</title>

s/-/ /

> +
> +    <para>These formats are used for meta-data.</para>

Ditto.

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> +
> +    &sub-meta-vsp1-hgo;
> +
> +  </section>
> +
>    <section id="sdr-formats">
>      <title>SDR Formats</title>
>  
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 1a3f7ca546de..f833fcfd6277 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1259,6 +1259,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>  	case V4L2_SDR_FMT_CS8:		descr = "Complex S8"; break;
>  	case V4L2_SDR_FMT_CS14LE:	descr = "Complex S14LE"; break;
>  	case V4L2_SDR_FMT_RU12LE:	descr = "Real U12LE"; break;
> +	case V4L2_META_FMT_VSP1_HGO:	descr = "R-Car VSP1 1-D Histogram"; break;
>  
>  	default:
>  		/* Compressed formats */
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 5035295a0138..154b645a43b1 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -638,6 +638,9 @@ struct v4l2_pix_format {
>  #define V4L2_SDR_FMT_CS14LE       v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
>  #define V4L2_SDR_FMT_RU12LE       v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
>  
> +/* Meta-data formats */
> +#define V4L2_META_FMT_VSP1_HGO    v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 Histogram */
> +
>  /* priv field value to indicates that subsequent fields are valid. */
>  #define V4L2_PIX_FMT_PRIV_MAGIC		0xfeedcafe
>  

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

      reply	other threads:[~2016-04-21  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21  0:40 [PATCH/RFC 0/2] Meta-data video device type Laurent Pinchart
2016-04-21  0:40 ` [PATCH/RFC 1/2] v4l: Add meta-data " Laurent Pinchart
2016-04-21  6:39   ` Hans Verkuil
2016-04-21 19:15     ` Laurent Pinchart
2016-04-22  7:46       ` Hans Verkuil
2016-04-22 13:58         ` Mauro Carvalho Chehab
2016-04-22 14:01           ` Hans Verkuil
2016-04-22 14:37             ` Mauro Carvalho Chehab
2016-04-21  8:44   ` Sakari Ailus
2016-04-21 19:24     ` Laurent Pinchart
2016-04-21 21:48       ` Sakari Ailus
2016-04-22 13:54   ` Mauro Carvalho Chehab
2016-04-21  0:40 ` [PATCH/RFC 2/2] v4l: Define a pixel format for the R-Car VSP1 1-D histogram engine Laurent Pinchart
2016-04-21  9:43   ` Sakari Ailus [this message]

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=20160421094357.GB32125@valkosipuli.retiisi.org.uk \
    --to=sakari.ailus@iki.fi \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.