annotate libmpcodecs/vf_stereo3d.c @ 36833:5691f930dca6

Fix bug with Win32 GUI preferences. Fix memory leak by freeing proc_priority.
author ib
date Mon, 24 Feb 2014 14:25:53 +0000
parents 4cdc07440a68
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
1 /*
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
2 * Copyright (C) 2010 Gordon Schmidt <gordon.schmidt <at> s2000.tu-chemnitz.de>
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
3 *
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
4 * This file is part of MPlayer.
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
5 *
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
6 * MPlayer is free software; you can redistribute it and/or modify
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
9 * (at your option) any later version.
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
10 *
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
11 * MPlayer is distributed in the hope that it will be useful,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
14 * GNU General Public License for more details.
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
15 *
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License along
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
19 */
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
20
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
21 //==includes==//
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
22 #include <stdio.h>
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
23 #include <stdlib.h>
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
24 #include <string.h>
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
25
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
26 #include "config.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
27 #include "mp_msg.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
28 #include "help_mp.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
29
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
30 #include "img_format.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
31 #include "mp_image.h"
32445
7ec524214684 Use proper include instead of extern declarations in the .c file.
reimar
parents: 32441
diff changeset
32 #include "vd.h"
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
33 #include "vf.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
34 #include "m_struct.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
35
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
36 #include "libavutil/common.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
37 #include "libvo/fastmemcpy.h"
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
38
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
39 //==types==//
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
40 typedef enum stereo_code {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
41 ANAGLYPH_RC_GRAY, //anaglyph red/cyan gray
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
42 ANAGLYPH_RC_HALF, //anaglyph red/cyan half colored
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
43 ANAGLYPH_RC_COLOR, //anaglyph red/cyan colored
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
44 ANAGLYPH_RC_DUBOIS, //anaglyph red/cyan dubois
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
45 ANAGLYPH_GM_GRAY, //anaglyph green/magenta gray
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
46 ANAGLYPH_GM_HALF, //anaglyph green/magenta half colored
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
47 ANAGLYPH_GM_COLOR, //anaglyph green/magenta colored
35812
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
48 ANAGLYPH_GM_DUBOIS, //anaglyph green/magenta dubois
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
49 ANAGLYPH_YB_GRAY, //anaglyph yellow/blue gray
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
50 ANAGLYPH_YB_HALF, //anaglyph yellow/blue half colored
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
51 ANAGLYPH_YB_COLOR, //anaglyph yellow/blue colored
34986
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
52 ANAGLYPH_YB_DUBOIS, //anaglyph yellow/blue dubois
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
53 MONO_L, //mono output for debugging (left eye only)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
54 MONO_R, //mono output for debugging (right eye only)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
55 SIDE_BY_SIDE_LR, //side by side parallel (left eye left, right eye right)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
56 SIDE_BY_SIDE_RL, //side by side crosseye (right eye left, left eye right)
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
57 SIDE_BY_SIDE_2_LR, //side by side parallel with half width resolution
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
58 SIDE_BY_SIDE_2_RL, //side by side crosseye with half width resolution
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
59 ABOVE_BELOW_LR, //above-below (left eye above, right eye below)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
60 ABOVE_BELOW_RL, //above-below (right eye above, left eye below)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
61 ABOVE_BELOW_2_LR, //above-below with half height resolution
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
62 ABOVE_BELOW_2_RL, //above-below with half height resolution
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
63 INTERLEAVE_ROWS_LR, //row-interleave (left eye has top row)
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
64 INTERLEAVE_ROWS_RL, //row-interleave (right eye has top row)
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
65 STEREO_CODE_COUNT //no value set - TODO: needs autodetection
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
66 } stereo_code;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
67
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
68 typedef struct component {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
69 stereo_code fmt;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
70 unsigned int width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
71 unsigned int height;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
72 unsigned int off_left;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
73 unsigned int off_right;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
74 unsigned int row_left;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
75 unsigned int row_right;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
76 } component;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
77
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
78 //==global variables==//
34984
c24d1a0c7665 Make compiler give the ana_coeff array automatically the right size.
reimar
parents: 33789
diff changeset
79 static const int ana_coeff[][3][6] = {
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
80 [ANAGLYPH_RC_GRAY] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
81 {{19595, 38470, 7471, 0, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
82 { 0, 0, 0, 19595, 38470, 7471},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
83 { 0, 0, 0, 19595, 38470, 7471}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
84 [ANAGLYPH_RC_HALF] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
85 {{19595, 38470, 7471, 0, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
86 { 0, 0, 0, 0, 65536, 0},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
87 { 0, 0, 0, 0, 0, 65536}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
88 [ANAGLYPH_RC_COLOR] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
89 {{65536, 0, 0, 0, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
90 { 0, 0, 0, 0, 65536, 0},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
91 { 0, 0, 0, 0, 0, 65536}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
92 [ANAGLYPH_RC_DUBOIS] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
93 {{29891, 32800, 11559, -2849, -5763, -102},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
94 {-2627, -2479, -1033, 24804, 48080, -1209},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
95 { -997, -1350, -358, -4729, -7403, 80373}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
96 [ANAGLYPH_GM_GRAY] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
97 {{ 0, 0, 0, 19595, 38470, 7471},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
98 {19595, 38470, 7471, 0, 0, 0},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
99 { 0, 0, 0, 19595, 38470, 7471}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
100 [ANAGLYPH_GM_HALF] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
101 {{ 0, 0, 0, 65536, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
102 {19595, 38470, 7471, 0, 0, 0},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
103 { 0, 0, 0, 0, 0, 65536}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
104 [ANAGLYPH_GM_COLOR] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
105 {{ 0, 0, 0, 65536, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
106 { 0, 65536, 0, 0, 0, 0},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
107 { 0, 0, 0, 0, 0, 65536}},
35812
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
108 [ANAGLYPH_GM_DUBOIS] =
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
109 {{-4063,-10354, -2556, 34669, 46203, 1573},
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
110 {18612, 43778, 9372, -1049, -983, -4260},
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
111 { -983, -1769, 1376, 590, 4915, 61407}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
112 [ANAGLYPH_YB_GRAY] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
113 {{ 0, 0, 0, 19595, 38470, 7471},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
114 { 0, 0, 0, 19595, 38470, 7471},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
115 {19595, 38470, 7471, 0, 0, 0}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
116 [ANAGLYPH_YB_HALF] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
117 {{ 0, 0, 0, 65536, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
118 { 0, 0, 0, 0, 65536, 0},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
119 {19595, 38470, 7471, 0, 0, 0}},
34985
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
120 [ANAGLYPH_YB_COLOR] =
9d7b24fd046b Convert comments into designated initializers.
reimar
parents: 34984
diff changeset
121 {{ 0, 0, 0, 65536, 0, 0},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
122 { 0, 0, 0, 0, 65536, 0},
34986
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
123 { 0, 0, 65536, 0, 0, 0}},
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
124 [ANAGLYPH_YB_DUBOIS] =
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
125 {{65535,-12650,18451, -987, -7590, -1049},
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
126 {-1604, 56032, 4196, 370, 3826, -1049},
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
127 {-2345,-10676, 1358, 5801, 11416, 56217}},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
128 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
129
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
130 struct vf_priv_s {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
131 component in;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
132 component out;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
133 int ana_matrix[3][6];
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
134 unsigned int width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
135 unsigned int height;
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
136 unsigned int row_step;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
137 } const vf_priv_default = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
138 {SIDE_BY_SIDE_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
139 {ANAGLYPH_RC_DUBOIS}
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
140 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
141
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
142 //==functions==//
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
143 static inline uint8_t ana_convert(int coeff[6], uint8_t left[3], uint8_t right[3])
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
144 {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
145 int sum;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
146
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
147 sum = coeff[0] * left[0] + coeff[3] * right[0]; //red in
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
148 sum += coeff[1] * left[1] + coeff[4] * right[1]; //green in
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
149 sum += coeff[2] * left[2] + coeff[5] * right[2]; //blue in
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
150 return av_clip_uint8(sum >> 16);
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
151 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
152
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
153 static int config(struct vf_instance *vf, int width, int height, int d_width,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
154 int d_height, unsigned int flags, unsigned int outfmt)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
155 {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
156 if ((width & 1) || (height & 1)) {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
157 mp_msg(MSGT_VFILTER, MSGL_WARN, "[stereo3d] invalid height or width\n");
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
158 return 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
159 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
160 //default input values
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
161 vf->priv->width = width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
162 vf->priv->height = height;
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
163 vf->priv->row_step = 1;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
164 vf->priv->in.width = width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
165 vf->priv->in.height = height;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
166 vf->priv->in.off_left = 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
167 vf->priv->in.off_right = 0;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
168 vf->priv->in.row_left = 0;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
169 vf->priv->in.row_right = 0;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
170
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
171 //check input format
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
172 switch (vf->priv->in.fmt) {
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
173 case SIDE_BY_SIDE_2_LR:
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
174 d_width *= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
175 case SIDE_BY_SIDE_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
176 vf->priv->width = width / 2;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
177 vf->priv->in.off_right = vf->priv->width * 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
178 break;
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
179 case SIDE_BY_SIDE_2_RL:
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
180 d_width *= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
181 case SIDE_BY_SIDE_RL:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
182 vf->priv->width = width / 2;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
183 vf->priv->in.off_left = vf->priv->width * 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
184 break;
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
185 case ABOVE_BELOW_2_LR:
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
186 d_height *= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
187 case ABOVE_BELOW_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
188 vf->priv->height = height / 2;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
189 vf->priv->in.row_right = vf->priv->height;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
190 break;
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
191 case ABOVE_BELOW_2_RL:
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
192 d_height *= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
193 case ABOVE_BELOW_RL:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
194 vf->priv->height = height / 2;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
195 vf->priv->in.row_left = vf->priv->height;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
196 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
197 default:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
198 mp_msg(MSGT_VFILTER, MSGL_WARN,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
199 "[stereo3d] stereo format of input is not supported\n");
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
200 return 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
201 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
202 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
203 //default output values
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
204 vf->priv->out.width = vf->priv->width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
205 vf->priv->out.height = vf->priv->height;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
206 vf->priv->out.off_left = 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
207 vf->priv->out.off_right = 0;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
208 vf->priv->out.row_left = 0;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
209 vf->priv->out.row_right = 0;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
210
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
211 //check output format
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
212 switch (vf->priv->out.fmt) {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
213 case ANAGLYPH_RC_GRAY:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
214 case ANAGLYPH_RC_HALF:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
215 case ANAGLYPH_RC_COLOR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
216 case ANAGLYPH_RC_DUBOIS:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
217 case ANAGLYPH_GM_GRAY:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
218 case ANAGLYPH_GM_HALF:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
219 case ANAGLYPH_GM_COLOR:
35812
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
220 case ANAGLYPH_GM_DUBOIS:
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
221 case ANAGLYPH_YB_GRAY:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
222 case ANAGLYPH_YB_HALF:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
223 case ANAGLYPH_YB_COLOR:
34986
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
224 case ANAGLYPH_YB_DUBOIS:
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
225 memcpy(vf->priv->ana_matrix, ana_coeff[vf->priv->out.fmt],
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
226 sizeof(vf->priv->ana_matrix));
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
227 break;
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
228 case SIDE_BY_SIDE_2_LR:
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
229 d_width /= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
230 case SIDE_BY_SIDE_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
231 vf->priv->out.width = vf->priv->width * 2;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
232 vf->priv->out.off_right = vf->priv->width * 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
233 break;
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
234 case SIDE_BY_SIDE_2_RL:
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
235 d_width /= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
236 case SIDE_BY_SIDE_RL:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
237 vf->priv->out.width = vf->priv->width * 2;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
238 vf->priv->out.off_left = vf->priv->width * 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
239 break;
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
240 case ABOVE_BELOW_2_LR:
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
241 d_height /= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
242 case ABOVE_BELOW_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
243 vf->priv->out.height = vf->priv->height * 2;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
244 vf->priv->out.row_right = vf->priv->height;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
245 break;
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
246 case ABOVE_BELOW_2_RL:
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
247 d_height /= 2;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
248 case ABOVE_BELOW_RL:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
249 vf->priv->out.height = vf->priv->height * 2;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
250 vf->priv->out.row_left = vf->priv->height;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
251 break;
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
252 case INTERLEAVE_ROWS_LR:
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
253 vf->priv->row_step = 2;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
254 vf->priv->height = vf->priv->height / 2;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
255 vf->priv->out.off_right = vf->priv->width * 3;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
256 vf->priv->in.off_right += vf->priv->in.width * 3;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
257 break;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
258 case INTERLEAVE_ROWS_RL:
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
259 vf->priv->row_step = 2;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
260 vf->priv->height = vf->priv->height / 2;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
261 vf->priv->out.off_left = vf->priv->width * 3;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
262 vf->priv->in.off_left += vf->priv->in.width * 3;
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
263 break;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
264 case MONO_R:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
265 //same as MONO_L only needs switching of input offsets
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
266 vf->priv->in.off_left = vf->priv->in.off_right;
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
267 vf->priv->in.row_left = vf->priv->in.row_right;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
268 //nobreak;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
269 case MONO_L:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
270 //use default settings
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
271 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
272 default:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
273 mp_msg(MSGT_VFILTER, MSGL_WARN,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
274 "[stereo3d] stereo format of output is not supported\n");
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
275 return 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
276 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
277 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
278 if (!opt_screen_size_x && !opt_screen_size_y) {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
279 d_width = d_width * vf->priv->out.width / width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
280 d_height = d_height * vf->priv->out.height / height;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
281 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
282 return vf_next_config(vf, vf->priv->out.width, vf->priv->out.height,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
283 d_width, d_height, flags, outfmt);
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
284 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
285
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
286 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
287 {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
288 mp_image_t *dmpi;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
289 if (vf->priv->in.fmt == vf->priv->out.fmt) { //nothing to do
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
290 dmpi = mpi;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
291 } else {
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
292 int out_off_left, out_off_right;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
293 int in_off_left = vf->priv->in.row_left * mpi->stride[0] +
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
294 vf->priv->in.off_left;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
295 int in_off_right = vf->priv->in.row_right * mpi->stride[0] +
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
296 vf->priv->in.off_right;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
297
32541
45b3a91e8fb7 Indicate that stereo3d can now handle strides properly.
reimar
parents: 32540
diff changeset
298 dmpi = vf_get_image(vf->next, IMGFMT_RGB24, MP_IMGTYPE_TEMP,
45b3a91e8fb7 Indicate that stereo3d can now handle strides properly.
reimar
parents: 32540
diff changeset
299 MP_IMGFLAG_ACCEPT_STRIDE,
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
300 vf->priv->out.width, vf->priv->out.height);
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
301 out_off_left = vf->priv->out.row_left * dmpi->stride[0] +
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
302 vf->priv->out.off_left;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
303 out_off_right = vf->priv->out.row_right * dmpi->stride[0] +
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
304 vf->priv->out.off_right;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
305
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
306 switch (vf->priv->out.fmt) {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
307 case SIDE_BY_SIDE_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
308 case SIDE_BY_SIDE_RL:
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
309 case SIDE_BY_SIDE_2_LR:
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
310 case SIDE_BY_SIDE_2_RL:
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
311 case ABOVE_BELOW_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
312 case ABOVE_BELOW_RL:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
313 case ABOVE_BELOW_2_LR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
314 case ABOVE_BELOW_2_RL:
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
315 case INTERLEAVE_ROWS_LR:
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
316 case INTERLEAVE_ROWS_RL:
33602
042b10b477fa Change memcpy_pic to force it to never write to image parts between
reimar
parents: 33599
diff changeset
317 memcpy_pic2(dmpi->planes[0] + out_off_left,
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
318 mpi->planes[0] + in_off_left,
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
319 3 * vf->priv->width,
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
320 vf->priv->height,
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
321 dmpi->stride[0] * vf->priv->row_step,
33602
042b10b477fa Change memcpy_pic to force it to never write to image parts between
reimar
parents: 33599
diff changeset
322 mpi->stride[0] * vf->priv->row_step,
042b10b477fa Change memcpy_pic to force it to never write to image parts between
reimar
parents: 33599
diff changeset
323 vf->priv->row_step != 1);
042b10b477fa Change memcpy_pic to force it to never write to image parts between
reimar
parents: 33599
diff changeset
324 memcpy_pic2(dmpi->planes[0] + out_off_right,
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
325 mpi->planes[0] + in_off_right,
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
326 3 * vf->priv->width,
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
327 vf->priv->height,
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
328 dmpi->stride[0] * vf->priv->row_step,
33602
042b10b477fa Change memcpy_pic to force it to never write to image parts between
reimar
parents: 33599
diff changeset
329 mpi->stride[0] * vf->priv->row_step,
042b10b477fa Change memcpy_pic to force it to never write to image parts between
reimar
parents: 33599
diff changeset
330 vf->priv->row_step != 1);
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
331 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
332 case MONO_L:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
333 case MONO_R:
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
334 memcpy_pic(dmpi->planes[0],
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
335 mpi->planes[0] + in_off_left,
32538
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
336 3 * vf->priv->width,
28f08e7c2a0a Adjust d_height instead of bad ad-hoc scaling.
reimar
parents: 32445
diff changeset
337 vf->priv->height,
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
338 dmpi->stride[0],
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
339 mpi->stride[0]);
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
340 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
341 case ANAGLYPH_RC_GRAY:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
342 case ANAGLYPH_RC_HALF:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
343 case ANAGLYPH_RC_COLOR:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
344 case ANAGLYPH_RC_DUBOIS:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
345 case ANAGLYPH_GM_GRAY:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
346 case ANAGLYPH_GM_HALF:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
347 case ANAGLYPH_GM_COLOR:
35812
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
348 case ANAGLYPH_GM_DUBOIS:
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
349 case ANAGLYPH_YB_GRAY:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
350 case ANAGLYPH_YB_HALF:
35812
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
351 case ANAGLYPH_YB_COLOR:
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
352 case ANAGLYPH_YB_DUBOIS: {
33599
6d690eac34eb Avoid C99 syntax not supported by some old compilers.
reimar
parents: 33560
diff changeset
353 int i,x,y,il,ir,o;
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
354 unsigned char *source = mpi->planes[0];
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
355 unsigned char *dest = dmpi->planes[0];
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
356 unsigned int out_width = vf->priv->out.width;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
357 int *ana_matrix[3];
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
358
33599
6d690eac34eb Avoid C99 syntax not supported by some old compilers.
reimar
parents: 33560
diff changeset
359 for(i = 0; i < 3; i++)
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
360 ana_matrix[i] = vf->priv->ana_matrix[i];
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
361
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
362 for (y = 0; y < vf->priv->out.height; y++) {
32539
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
363 o = dmpi->stride[0] * y;
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
364 il = in_off_left + y * mpi->stride[0];
8341f48adbc5 Properly support src/dst stride in vf_stereo3d.
reimar
parents: 32538
diff changeset
365 ir = in_off_right + y * mpi->stride[0];
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
366 for (x = 0; x < out_width; x++) {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
367 dest[o ] = ana_convert(
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
368 ana_matrix[0], source + il, source + ir); //red out
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
369 dest[o + 1] = ana_convert(
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
370 ana_matrix[1], source + il, source + ir); //green out
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
371 dest[o + 2] = ana_convert(
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
372 ana_matrix[2], source + il, source + ir); //blue out
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
373 il += 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
374 ir += 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
375 o += 3;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
376 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
377 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
378 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
379 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
380 default:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
381 mp_msg(MSGT_VFILTER, MSGL_WARN,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
382 "[stereo3d] stereo format of output is not supported\n");
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
383 return 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
384 break;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
385 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
386 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
387 return vf_next_put_image(vf, dmpi, pts);
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
388 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
389
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
390 static int query_format(struct vf_instance *vf, unsigned int fmt)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
391 {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
392 switch (fmt)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
393 case IMGFMT_RGB24:
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
394 return vf_next_query_format(vf, fmt);
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
395 return 0;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
396 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
397
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
398 static void uninit(vf_instance_t *vf)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
399 {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
400 free(vf->priv);
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
401 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
402
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
403 static int vf_open(vf_instance_t *vf, char *args)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
404 {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
405 vf->config = config;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
406 vf->uninit = uninit;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
407 vf->put_image = put_image;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
408 vf->query_format = query_format;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
409
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
410 return 1;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
411 }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
412
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
413 ///Presets usage
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
414 static const struct format_preset {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
415 char* name;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
416 stereo_code scode;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
417 } vf_format_presets_defs[] = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
418 {"arcg", ANAGLYPH_RC_GRAY},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
419 {"anaglyph_red_cyan_gray", ANAGLYPH_RC_GRAY},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
420 {"arch", ANAGLYPH_RC_HALF},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
421 {"anaglyph_red_cyan_half_color", ANAGLYPH_RC_HALF},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
422 {"arcc", ANAGLYPH_RC_COLOR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
423 {"anaglyph_red_cyan_color", ANAGLYPH_RC_COLOR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
424 {"arcd", ANAGLYPH_RC_DUBOIS},
36185
4cdc07440a68 Fix typo in parameter name.
reimar
parents: 35812
diff changeset
425 {"anaglyph_red_cyan_dubois", ANAGLYPH_RC_DUBOIS},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
426 {"agmg", ANAGLYPH_GM_GRAY},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
427 {"anaglyph_green_magenta_gray", ANAGLYPH_GM_GRAY},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
428 {"agmh", ANAGLYPH_GM_HALF},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
429 {"anaglyph_green_magenta_half_color",ANAGLYPH_GM_HALF},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
430 {"agmc", ANAGLYPH_GM_COLOR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
431 {"anaglyph_green_magenta_color", ANAGLYPH_GM_COLOR},
35812
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
432 {"agmd", ANAGLYPH_GM_DUBOIS},
13e8ce81a20a Add more vf_stereo3d output formats.
cehoyos
parents: 34986
diff changeset
433 {"anaglyph_green_magenta_dubois", ANAGLYPH_GM_DUBOIS},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
434 {"aybg", ANAGLYPH_YB_GRAY},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
435 {"anaglyph_yellow_blue_gray", ANAGLYPH_YB_GRAY},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
436 {"aybh", ANAGLYPH_YB_HALF},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
437 {"anaglyph_yellow_blue_half_color", ANAGLYPH_YB_HALF},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
438 {"aybc", ANAGLYPH_YB_COLOR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
439 {"anaglyph_yellow_blue_color", ANAGLYPH_YB_COLOR},
34986
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
440 {"aybd", ANAGLYPH_YB_DUBOIS},
0eeb639da30e Add another anaglyph color variant.
reimar
parents: 34985
diff changeset
441 {"anaglyph_yellow_blue_dubois", ANAGLYPH_YB_DUBOIS},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
442 {"ml", MONO_L},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
443 {"mono_left", MONO_L},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
444 {"mr", MONO_R},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
445 {"mono_right", MONO_R},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
446 {"sbsl", SIDE_BY_SIDE_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
447 {"side_by_side_left_first", SIDE_BY_SIDE_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
448 {"sbsr", SIDE_BY_SIDE_RL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
449 {"side_by_side_right_first", SIDE_BY_SIDE_RL},
33789
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
450 {"sbs2l", SIDE_BY_SIDE_2_LR},
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
451 {"side_by_side_half_width_left_first", SIDE_BY_SIDE_2_LR},
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
452 {"sbs2r", SIDE_BY_SIDE_2_RL},
475d96f700d4 Half-width side-by-side formats for stereo3d.
reimar
parents: 33602
diff changeset
453 {"side_by_side_half_width_right_first",SIDE_BY_SIDE_2_RL},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
454 {"abl", ABOVE_BELOW_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
455 {"above_below_left_first", ABOVE_BELOW_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
456 {"abr", ABOVE_BELOW_RL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
457 {"above_below_right_first", ABOVE_BELOW_RL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
458 {"ab2l", ABOVE_BELOW_2_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
459 {"above_below_half_height_left_first", ABOVE_BELOW_2_LR},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
460 {"ab2r", ABOVE_BELOW_2_RL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
461 {"above_below_half_height_right_first",ABOVE_BELOW_2_RL},
33560
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
462 {"irl", INTERLEAVE_ROWS_LR},
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
463 {"interleave_rows_left_first", INTERLEAVE_ROWS_LR},
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
464 {"irr", INTERLEAVE_ROWS_RL},
16cf555989a9 Add support for converting to interleaved 3D in vf_stereo3d.
reimar
parents: 32541
diff changeset
465 {"interleave_rows_right_first", INTERLEAVE_ROWS_RL},
32441
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
466 { NULL, 0}
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
467 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
468
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
469 #define ST_OFF(f) M_ST_OFF(struct format_preset,f)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
470 static const m_option_t vf_format_preset_fields_in[] = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
471 {"in", ST_OFF(scode), CONF_TYPE_INT, 0,0,0, NULL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
472 { NULL, NULL, 0, 0, 0, 0, NULL }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
473 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
474 static const m_option_t vf_format_preset_fields_out[] = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
475 {"out", ST_OFF(scode), CONF_TYPE_INT, 0,0,0, NULL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
476 { NULL, NULL, 0, 0, 0, 0, NULL }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
477 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
478
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
479 static const m_struct_t vf_format_preset_in = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
480 "stereo_format_preset_in",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
481 sizeof(struct format_preset),
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
482 NULL,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
483 vf_format_preset_fields_in
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
484 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
485 static const m_struct_t vf_format_preset_out = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
486 "stereo_format_preset_out",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
487 sizeof(struct format_preset),
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
488 NULL,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
489 vf_format_preset_fields_out
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
490 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
491
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
492 static const m_struct_t vf_opts;
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
493 static const m_obj_presets_t format_preset_in = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
494 (struct m_struct_st*)&vf_format_preset_in,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
495 (struct m_struct_st*)&vf_opts,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
496 (struct format_preset*)vf_format_presets_defs,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
497 ST_OFF(name)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
498 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
499 static const m_obj_presets_t format_preset_out = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
500 (struct m_struct_st*)&vf_format_preset_out,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
501 (struct m_struct_st*)&vf_opts,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
502 (struct format_preset*)vf_format_presets_defs,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
503 ST_OFF(name)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
504 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
505
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
506 /// Now the options
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
507 #undef ST_OFF
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
508 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
509 static const m_option_t vf_opts_fields[] = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
510 {"stereo_in", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
511 (m_obj_presets_t*)&format_preset_in},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
512 {"stereo_out", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
513 (m_obj_presets_t*)&format_preset_out},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
514 {"in", ST_OFF(in.fmt), CONF_TYPE_INT, 0,0,0, NULL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
515 {"out", ST_OFF(out.fmt), CONF_TYPE_INT, 0,0,0, NULL},
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
516 { NULL, NULL, 0, 0, 0, 0, NULL }
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
517 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
518
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
519 static const m_struct_t vf_opts = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
520 "stereo3d",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
521 sizeof(struct vf_priv_s),
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
522 &vf_priv_default,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
523 vf_opts_fields
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
524 };
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
525
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
526
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
527 //==info struct==//
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
528 const vf_info_t vf_info_stereo3d = {
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
529 "stereoscopic 3d view",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
530 "stereo3d",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
531 "Gordon Schmidt",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
532 "view stereoscopic videos",
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
533 vf_open,
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
534 &vf_opts
1a9b4cb4ba01 Add stereo3d filter.
reimar
parents:
diff changeset
535 };