The patch number 14292 was added via Hans de Goede <hdego...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Hans de Goede  <hdego...@redhat.com>
libv4l: Make new faster autogain slightly slower to avoid overshoot


libv4l: Make new faster autogain slightly slower to avoid overshoot

Priority: normal

Signed-off-by: Hans de Goede <hdego...@redhat.com>


---

 v4l2-apps/libv4l/libv4lconvert/cpia1.c               |    5 +++--
 v4l2-apps/libv4l/libv4lconvert/processing/autogain.c |   10 ++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff -r 5cdb0f8e6513 -r 347b8c919f3f v4l2-apps/libv4l/libv4lconvert/cpia1.c
--- a/v4l2-apps/libv4l/libv4lconvert/cpia1.c    Tue Jan 12 15:06:44 2010 +0100
+++ b/v4l2-apps/libv4l/libv4lconvert/cpia1.c    Fri Jan 15 10:34:06 2010 +0100
@@ -202,8 +202,9 @@
     return -1;
   }
 
-  if (src_size != 4 ||
-      src[0] != EOI || src[1] != EOI || src[2] != EOI || src[3] != EOI) {
+  if (src_size < 4 ||
+      src[src_size - 4] != EOI || src[src_size - 3] != EOI ||
+      src[src_size - 2] != EOI || src[src_size - 1] != EOI) {
     fprintf(stderr, "cpia1 decode error: invaled EOI marker\n");
     return -1;
   }
diff -r 5cdb0f8e6513 -r 347b8c919f3f 
v4l2-apps/libv4l/libv4lconvert/processing/autogain.c
--- a/v4l2-apps/libv4l/libv4lconvert/processing/autogain.c      Tue Jan 12 
15:06:44 2010 +0100
+++ b/v4l2-apps/libv4l/libv4lconvert/processing/autogain.c      Fri Jan 15 
10:34:06 2010 +0100
@@ -45,11 +45,11 @@
 {
   int ctrl_range = (ctrl->maximum - ctrl->minimum) / ctrl->step;
 
-  /* If we are of 2 * deadzone or more, and we have a very fine grained
+  /* If we are of 3 * deadzone or more, and we have a very fine grained
      control, take larger steps, otherwise we take ages to get to the
      right setting point. We use 256 as tripping point for determineing fine
      grained controls here, as avg_lum has a range of 0 - 255. */
-  if (abs(steps) >= 2 && ctrl_range > 256)
+  if (abs(steps) >= 3 && ctrl_range > 256)
     *value += steps * ctrl->step * (ctrl_range / 256);
   else
     *value += steps * ctrl->step;
@@ -178,8 +178,10 @@
   if (steps) {
     data->last_gain_correction = steps;
     /* We are still settling down, force the next update sooner. Note we
-       skip the next frame as that is still captured with the old settings. */
-    data->lookup_table_update_counter = V4L2PROCESSING_UPDATE_RATE - 1;
+       skip the next frame as that is still captured with the old settings,
+       and another one just to be sure (because if we re-adjust based
+       on the old settings we might overshoot). */
+    data->lookup_table_update_counter = V4L2PROCESSING_UPDATE_RATE - 2;
   }
 
   if (gain != orig_gain) {


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/347b8c919f3f7665c3d987d6e6105459d97c3431

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to