[MPlayer-dev-eng] [PATCH] YellowBlue/AmberBlue Dubios support for stereo3d

Bob mpbob at ezpi.net
Tue Jan 17 22:39:14 CET 2012


Hi,
I've patched stereo3d filter to support amber/blue least-square/dubois 
(eric dubois) filter as specified on:
http://www.flickr.com/photos/e_dubois/5230654930/ and 
http://www.site.uottawa.ca/~edubois/anaglyph/

The settings numbers have been converted by taking the 
numbers*65535/1062, and it works for me(TM).
Tinkering with this filter, I realized that there is most likely a large 
room for improvement in speed and gama/hue corrections, but works for 
simple material.
Most likely it could be done a ton better by using hue tables, but 
unfortunately ColorCode 3D has some rather nasty patents that shouldn't 
be tripped over..
If anyone have ideas on how to implement good gamma & hue corrections 
without tripping over US Patent 6,687,003 and EPO 1131658, I'll gladly 
try to implement it...


Index: libmpcodecs/vf_stereo3d.c
===================================================================
--- libmpcodecs/vf_stereo3d.c    (revision 34578)
+++ libmpcodecs/vf_stereo3d.c    (working copy)
@@ -48,6 +48,7 @@
      ANAGLYPH_YB_GRAY,   //anaglyph yellow/blue gray
      ANAGLYPH_YB_HALF,   //anaglyph yellow/blue half colored
      ANAGLYPH_YB_COLOR,  //anaglyph yellow/blue colored
+    ANAGLYPH_YB_DUBOIS,  //anaglyph yellow/blue colored
      MONO_L,             //mono output for debugging (left eye only)
      MONO_R,             //mono output for debugging (right eye only)
      SIDE_BY_SIDE_LR,    //side by side parallel (left eye left, right 
eye right)
@@ -74,7 +75,7 @@
  } component;

  //==global variables==//
-static const int ana_coeff[10][3][6] = {
+static const int ana_coeff[11][3][6] = {
      {{19595, 38470,  7471,     0,     0,     0},    //ANAGLYPH_RC_GRAY
       {    0,     0,     0, 19595, 38470,  7471},
       {    0,     0,     0, 19595, 38470,  7471}},
@@ -102,9 +103,13 @@
      {{    0,     0,     0, 65536,     0,     0},    //ANAGLYPH_YB_HALF
       {    0,     0,     0,     0, 65536,     0},
       {19595, 38470,  7471,     0,     0,     0}},
+
      {{    0,     0,     0, 65536,     0,     0},    //ANAGLYPH_YB_COLOR
       {    0,     0,     0,     0, 65536,     0},
-     {    0,     0, 65536,     0,     0,     0}}
+     {    0,     0, 65536,     0,     0,     0}},
+    {{65535,-12650,18451,   -987, -7590, -1049},    //ANAGLYPH_YB_DUBOIS
+     {-1604, 56032, 4196,    370,  3826, -1049},
+     {-2345,-10676, 1358,   5801, 11416, 56217}}
  };

  struct vf_priv_s {
@@ -200,6 +205,7 @@
      case ANAGLYPH_YB_GRAY:
      case ANAGLYPH_YB_HALF:
      case ANAGLYPH_YB_COLOR:
+    case ANAGLYPH_YB_DUBOIS:
          memcpy(vf->priv->ana_matrix, ana_coeff[vf->priv->out.fmt],
                 sizeof(vf->priv->ana_matrix));
          break;
@@ -325,6 +331,7 @@
          case ANAGLYPH_GM_COLOR:
          case ANAGLYPH_YB_GRAY:
          case ANAGLYPH_YB_HALF:
+        case ANAGLYPH_YB_DUBOIS:
          case ANAGLYPH_YB_COLOR: {
              int i,x,y,il,ir,o;
              unsigned char *source     = mpi->planes[0];
@@ -411,6 +418,8 @@
      {"anaglyph_yellow_blue_half_color",  ANAGLYPH_YB_HALF},
      {"aybc",                             ANAGLYPH_YB_COLOR},
      {"anaglyph_yellow_blue_color",       ANAGLYPH_YB_COLOR},
+    {"aybd",                             ANAGLYPH_YB_DUBOIS},
+    {"anaglyph_yellow_blue_dubois",      ANAGLYPH_YB_DUBOIS},
      {"ml",                               MONO_L},
      {"mono_left",                        MONO_L},
      {"mr",                               MONO_R},





More information about the MPlayer-dev-eng mailing list