Re: [PATCH v5] media: v4l2-ctrls: add control for dpcm predictor

2012-09-10 Thread Sakari Ailus
Hi Prabhakar,

On Mon, Sep 10, 2012 at 11:27:55AM +0530, Prabhakar Lad wrote:
...
 +   row id=v4l2-dpcm-predictor
 + entry spanname=descr Differential pulse-code modulation (DPCM) 
 compression can
 + be used to compress the samples into fewer bits than they would 
 otherwise require.
 + This is done by calculating the difference between consecutive 
 samples and outputting
 + the difference which in average is much smaller than the values of 
 the samples
 + themselves since there is generally lots of correlation between 
 adjacent pixels. In
 + decompression the original samples are reconstructed. The process 
 isn't lossless as
 + the encoded sample size in bits is less than the original.
 +
 + paraFormats using DPCM compression include xref 
 linkend=pixfmt-srggb10dpcm8 /./para
 +
 + paraThis control is used to select the predictor used to encode 
 the samples./para
 +
 + paraThe main difference between the simple and the advanced 
 predictors is image quality,
 + with advanced predictor supposed to produce better quality images 
 as a result. Simple
 + predictor can be used e.g. for testing purposes. For more 
 information about DPCM see ulink
 + 
 url=http://en.wikipedia.org/wiki/Differential_pulse-code_modulation;Wikipedia/ulink./para

Could you fit the above text (description of the control) at 80 characters
per line? With that change,

Acked-by: Sakari Ailus sakari.ai...@iki.fi

Kind regards,

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5] media: v4l2-ctrls: add control for dpcm predictor

2012-09-09 Thread Prabhakar Lad
From: Lad, Prabhakar prabhakar@ti.com

add V4L2_CID_DPCM_PREDICTOR control of type menu, which
determines the dpcm predictor. The predictor can be either
simple or advanced.

Signed-off-by: Lad, Prabhakar prabhakar@ti.com
Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com
Acked-by: Hans Verkuil hans.verk...@cisco.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
Cc: Sakari Ailus sakari.ai...@iki.fi
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Mauro Carvalho Chehab mche...@infradead.org
Cc: Hans de Goede hdego...@redhat.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Rob Landley r...@landley.net
---
This patches has one checkpatch warning for line over
80 characters altough it can be avoided I have kept it
for consistency.

Changes for v5:
1: Changed the control's name to 'Simple' and  'Advanced'
   as pointed by Sakari.
2: Changed the description of DPCM. Thanks to Sakari for
   providing the description.

Changes for v4:
1: Aligned the description to fit appropriately in the
   para tag, pointed by Sylwester.

Changes for v3:
1: Added better explanation for DPCM, pointed by Hans.

Changes for v2:
1: Added documentaion in controls.xml pointed by Sylwester.
2: Chnaged V4L2_DPCM_PREDICTOR_ADVANCE to V4L2_DPCM_PREDICTOR_ADVANCED
   pointed by Sakari.

 Documentation/DocBook/media/v4l/controls.xml |   39 +-
 drivers/media/v4l2-core/v4l2-ctrls.c |9 ++
 include/linux/videodev2.h|5 +++
 3 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 93b9c68..2c1599f 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4267,7 +4267,44 @@ interface and may change in the future./para
pixels / second.
/entry
  /row
- rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_DPCM_PREDICTOR/constant/entry
+   entrymenu/entry
+ /row
+ row id=v4l2-dpcm-predictor
+   entry spanname=descr Differential pulse-code modulation (DPCM) 
compression can
+   be used to compress the samples into fewer bits than they would 
otherwise require.
+   This is done by calculating the difference between consecutive 
samples and outputting
+   the difference which in average is much smaller than the values of 
the samples
+   themselves since there is generally lots of correlation between 
adjacent pixels. In
+   decompression the original samples are reconstructed. The process 
isn't lossless as
+   the encoded sample size in bits is less than the original.
+
+   paraFormats using DPCM compression include xref 
linkend=pixfmt-srggb10dpcm8 /./para
+
+   paraThis control is used to select the predictor used to encode 
the samples./para
+
+   paraThe main difference between the simple and the advanced 
predictors is image quality,
+   with advanced predictor supposed to produce better quality images 
as a result. Simple
+   predictor can be used e.g. for testing purposes. For more 
information about DPCM see ulink
+   
url=http://en.wikipedia.org/wiki/Differential_pulse-code_modulation;Wikipedia/ulink./para
+   /entry
+ /row
+ row
+   entrytbl spanname=descr cols=2
+ tbody valign=top
+   row
+entryconstantV4L2_DPCM_PREDICTOR_SIMPLE/constant/entry
+ entryPredictor type is simple/entry
+   /row
+   row
+ 
entryconstantV4L2_DPCM_PREDICTOR_ADVANCED/constant/entry
+ entryPredictor type is advanced/entry
+   /row
+ /tbody
+   /entrytbl
+ /row
+   rowentry/entry/row
/tbody
   /tgroup
   /table
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index b6a2ee7..8f2f40b 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -425,6 +425,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
Gray,
NULL,
};
+   static const char * const dpcm_predictor[] = {
+   Simple,
+   Advanced,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -502,6 +507,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
return mpeg4_profile;
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
return jpeg_chroma_subsampling;
+   case V4L2_CID_DPCM_PREDICTOR:
+   return dpcm_predictor;
 
default:
return NULL;
@@ -732,6 +739,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_IMAGE_PROC_CLASS: return Image Processing 
Controls;
case