[PATCH] Raw camera output

Benjamin M. Schwartz bmschwar at fas.harvard.edu
Tue Feb 6 00:37:08 EST 2007


This patch enables raw Bayer-mode output from the camera.

This patch is completely untested, since I have no access to the hardware, but
it should not break any existing functionality.

Bayer-mode output will support advanced user-space image processing, e.g.
demosaicing by dcraw.  The highest-quality processing pipeline might eventually
also include multi-shot averaging for noise-reduction, exposure bracketing for
high dynamic range, and smarter color balancing.  Together, these techniques
should allow us to wring every last drop of quality out of this camera, with no
user intervention.

--Ben Schwartz

diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 466d6e9..533fa20 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -345,6 +345,17 @@ static struct regval_list ov7670_fmt_rgb444[] = {
        { 0xff, 0xff },
 };

+static struct regval_list ov7670_fmt_sbggr8[] = {
+       { REG_COM7, COM7_BAYER },       /* Selects Bayer mode */
+       { REG_RGB444, 0 },      /* No RGB444 please */
+       { REG_COM1, 0x0 },
+       { REG_COM15, COM15_R00FF },
+       { REG_COM9, 0x38 },     /* 16x gain ceiling; 0x8 is reserved bit */
+       { REG_COM8, 0x0 },      /* Disable all automatic adjustments */
+       { REG_COM13, 0x0 },     /* Record without gamma (linear values) */
+       { REG_GAIN, 0x01 },     /* User will set gain via t_brightness? */
+       { 0xff, 0xff },
+};



@@ -485,6 +496,11 @@ static struct ov7670_format_struct {
                .pixelformat    = V4L2_PIX_FMT_RGB565,
                .regs           = ov7670_fmt_rgb565,
        },
+       {
+               .desc           = "Bayer BA81",
+               .pixelformat    = V4L2_PIX_FMT_SBGGR8,
+               .regs           = ov7670_fmt_sbggr8,
+       },
 #if 0
        /*
         * Pretend we do RGB32.  This is here on the assumption that the



More information about the Devel mailing list