From patchwork Mon Sep 10 12:03:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Lad X-Patchwork-Id: 1431911 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork2.kernel.org (Postfix) with ESMTP id F084ADF28C for ; Mon, 10 Sep 2012 12:06:12 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8AC4BqS032342; Mon, 10 Sep 2012 07:04:11 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8AC4Bnm012019; Mon, 10 Sep 2012 07:04:11 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Mon, 10 Sep 2012 07:04:11 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8AC4BFP014632; Mon, 10 Sep 2012 07:04:11 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3B6D180628; Mon, 10 Sep 2012 07:04:11 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp20.itg.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by linux.omap.com (Postfix) with ESMTP id 6CDE480628 for ; Mon, 10 Sep 2012 07:04:09 -0500 (CDT) Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8AC46SA024756; Mon, 10 Sep 2012 17:34:06 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 10 Sep 2012 17:34:06 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8AC46TG031191; Mon, 10 Sep 2012 17:34:06 +0530 From: Prabhakar Lad To: LMML Subject: [PATCH v6] media: v4l2-ctrls: add control for dpcm predictor Date: Mon, 10 Sep 2012 17:33:44 +0530 Message-ID: <1347278624-5296-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 CC: dlos , Rob Landley , , , Hans de Goede , Kyungmin Park , Hans Verkuil , Sylwester Nawrocki , Sakari Ailus , Mauro Carvalho Chehab X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar 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 Signed-off-by: Manjunath Hadli Acked-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Sylwester Nawrocki Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Hans de Goede Cc: Kyungmin Park Cc: Rob Landley --- This patches has one checkpatch warning for line over 80 characters altough it can be avoided I have kept it for consistency. Changes for v6: 1: Fitted the description within 80 characters per line, pointed by Sakari. 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 | 48 +++++++++++++++++++++++++- drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++ include/linux/videodev2.h | 5 +++ 3 files changed, 61 insertions(+), 1 deletions(-) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 93b9c68..f0fb08d 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -4267,7 +4267,53 @@ interface and may change in the future. pixels / second. - + + + V4L2_CID_DPCM_PREDICTOR + + menu + + + 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. + + Formats using DPCM compression include + . + + This control is used to select the predictor used to encode + the samples. + + The 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 + + Wikipedia. + + + + + + + V4L2_DPCM_PREDICTOR_SIMPLE + Predictor type is simple + + + V4L2_DPCM_PREDICTOR_ADVANCED + Predictor type is advanced + + + + + 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 V4L2_CID_LINK_FREQ: return "Link Frequency"; case V4L2_CID_PIXEL_RATE: return "Pixel Rate"; + case V4L2_CID_DPCM_PREDICTOR: return "DPCM Predictor"; default: return NULL; @@ -832,6 +840,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_ISO_SENSITIVITY_AUTO: case V4L2_CID_EXPOSURE_METERING: case V4L2_CID_SCENE_MODE: + case V4L2_CID_DPCM_PREDICTOR: *type = V4L2_CTRL_TYPE_MENU; break; case V4L2_CID_LINK_FREQ: diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 6d6dfa7..ca9fb78 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -2000,6 +2000,11 @@ enum v4l2_jpeg_chroma_subsampling { #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1) #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) +#define V4L2_CID_DPCM_PREDICTOR (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) +enum v4l2_dpcm_predictor { + V4L2_DPCM_PREDICTOR_SIMPLE = 0, + V4L2_DPCM_PREDICTOR_ADVANCED = 1, +}; /* * T U N I N G