libmpcodecs/vf_stereo3d: update to latest version from mplayer

Merged commits:
commit 9a2978f37bcdf7a28235c9322e9e5a4fe15e2ff2
Author: cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>
Date:   Thu Jan 31 12:12:36 2013 +0000

    Add more vf_stereo3d output formats.

    Adds high quality green-magenta and yellow-blue dubois
    anaglyph 3D output support.

    Patch by thomas schorpp, thomas.schorpp gmail

    git-svn-id: svn://svn.mplayerhq.hu:/mplayer/trunk@35906 b3059339-0415-0410-9bf9-f77b7e298cf2

commit 2c50e66460d8d3ec460cbf9425f252f75ea1022d
Author: reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Date:   Sun Aug 12 17:31:47 2012 +0000

    Add another anaglyph color variant.

    Patch by Bob [mpbob ezpi net].

    git-svn-id: svn://svn.mplayerhq.hu:/mplayer/trunk@35080 b3059339-0415-0410-9bf9-f77b7e298cf2

commit 71c5261c2ac63e6e29a5a899b52d1ec4bdb62c4e
Author: reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Date:   Sun Aug 12 17:25:30 2012 +0000

    Convert comments into designated initializers.

    That is a simple way to ensure they always correspond
    to what the compiler actually does.

    git-svn-id: svn://svn.mplayerhq.hu:/mplayer/trunk@35079 b3059339-0415-0410-9bf9-f77b7e298cf2

commit d7164c5e1ba524c2a6983d979ef57e193b2c8a9f
Author: reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Date:   Sun Aug 12 17:20:24 2012 +0000

    Make compiler give the ana_coeff array automatically the right size.
    Makes adding more colour schemes easier.

    git-svn-id: svn://svn.mplayerhq.hu:/mplayer/trunk@35078 b3059339-0415-0410-9bf9-f77b7e298cf2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/9/head
multiple authors 12 years ago committed by Michael Niedermayer
parent 5a83115130
commit 708ed15d8c
  1. 54
      libavfilter/libmpcodecs/vf_stereo3d.c

@ -43,9 +43,11 @@ typedef enum stereo_code {
ANAGLYPH_GM_GRAY, //anaglyph green/magenta gray
ANAGLYPH_GM_HALF, //anaglyph green/magenta half colored
ANAGLYPH_GM_COLOR, //anaglyph green/magenta colored
ANAGLYPH_GM_DUBOIS, //anaglyph green/magenta dubois
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 dubois
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)
@ -72,37 +74,55 @@ typedef struct component {
} component;
//==global variables==//
static const int ana_coeff[10][3][6] = {
{{19595, 38470, 7471, 0, 0, 0}, //ANAGLYPH_RC_GRAY
static const int ana_coeff[][3][6] = {
[ANAGLYPH_RC_GRAY] =
{{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 19595, 38470, 7471},
{ 0, 0, 0, 19595, 38470, 7471}},
{{19595, 38470, 7471, 0, 0, 0}, //ANAGLYPH_RC_HALF
[ANAGLYPH_RC_HALF] =
{{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{ 0, 0, 0, 0, 0, 65536}},
{{65536, 0, 0, 0, 0, 0}, //ANAGLYPH_RC_COLOR
[ANAGLYPH_RC_COLOR] =
{{65536, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{ 0, 0, 0, 0, 0, 65536}},
{{29891, 32800, 11559, -2849, -5763, -102}, //ANAGLYPH_RC_DUBOIS
[ANAGLYPH_RC_DUBOIS] =
{{29891, 32800, 11559, -2849, -5763, -102},
{-2627, -2479, -1033, 24804, 48080, -1209},
{ -997, -1350, -358, -4729, -7403, 80373}},
{{ 0, 0, 0, 19595, 38470, 7471}, //ANAGLYPH_GM_GRAY
[ANAGLYPH_GM_GRAY] =
{{ 0, 0, 0, 19595, 38470, 7471},
{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 19595, 38470, 7471}},
{{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_GM_HALF
[ANAGLYPH_GM_HALF] =
{{ 0, 0, 0, 65536, 0, 0},
{19595, 38470, 7471, 0, 0, 0},
{ 0, 0, 0, 0, 0, 65536}},
{{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_GM_COLOR
[ANAGLYPH_GM_COLOR] =
{{ 0, 0, 0, 65536, 0, 0},
{ 0, 65536, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 65536}},
{{ 0, 0, 0, 19595, 38470, 7471}, //ANAGLYPH_YB_GRAY
[ANAGLYPH_GM_DUBOIS] =
{{-4063,-10354, -2556, 34669, 46203, 1573},
{18612, 43778, 9372, -1049, -983, -4260},
{ -983, -1769, 1376, 590, 4915, 61407}},
[ANAGLYPH_YB_GRAY] =
{{ 0, 0, 0, 19595, 38470, 7471},
{ 0, 0, 0, 19595, 38470, 7471},
{19595, 38470, 7471, 0, 0, 0}},
{{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_YB_HALF
[ANAGLYPH_YB_HALF] =
{{ 0, 0, 0, 65536, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{19595, 38470, 7471, 0, 0, 0}},
{{ 0, 0, 0, 65536, 0, 0}, //ANAGLYPH_YB_COLOR
[ANAGLYPH_YB_COLOR] =
{{ 0, 0, 0, 65536, 0, 0},
{ 0, 0, 0, 0, 65536, 0},
{ 0, 0, 65536, 0, 0, 0}}
{ 0, 0, 65536, 0, 0, 0}},
[ANAGLYPH_YB_DUBOIS] =
{{65535,-12650,18451, -987, -7590, -1049},
{-1604, 56032, 4196, 370, 3826, -1049},
{-2345,-10676, 1358, 5801, 11416, 56217}},
};
struct vf_priv_s {
@ -195,9 +215,11 @@ static int config(struct vf_instance *vf, int width, int height, int d_width,
case ANAGLYPH_GM_GRAY:
case ANAGLYPH_GM_HALF:
case ANAGLYPH_GM_COLOR:
case ANAGLYPH_GM_DUBOIS:
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;
@ -322,9 +344,11 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
case ANAGLYPH_GM_GRAY:
case ANAGLYPH_GM_HALF:
case ANAGLYPH_GM_COLOR:
case ANAGLYPH_GM_DUBOIS:
case ANAGLYPH_YB_GRAY:
case ANAGLYPH_YB_HALF:
case ANAGLYPH_YB_COLOR: {
case ANAGLYPH_YB_COLOR:
case ANAGLYPH_YB_DUBOIS: {
int i,x,y,il,ir,o;
unsigned char *source = mpi->planes[0];
unsigned char *dest = dmpi->planes[0];
@ -410,12 +434,16 @@ static const struct format_preset {
{"anaglyph_green_magenta_half_color",ANAGLYPH_GM_HALF},
{"agmc", ANAGLYPH_GM_COLOR},
{"anaglyph_green_magenta_color", ANAGLYPH_GM_COLOR},
{"agmd", ANAGLYPH_GM_DUBOIS},
{"anaglyph_green_magenta_dubois", ANAGLYPH_GM_DUBOIS},
{"aybg", ANAGLYPH_YB_GRAY},
{"anaglyph_yellow_blue_gray", ANAGLYPH_YB_GRAY},
{"aybh", ANAGLYPH_YB_HALF},
{"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},

Loading…
Cancel
Save