]> git.sesse.net Git - ffmpeg/blob - libavfilter/vf_stereo3d.c
Merge commit 'e8cafd2773bc56455c8816593cbd9368f2d69a80'
[ffmpeg] / libavfilter / vf_stereo3d.c
1 /*
2  * Copyright (c) 2010 Gordon Schmidt <gordon.schmidt <at> s2000.tu-chemnitz.de>
3  * Copyright (c) 2013 Paul B Mahol
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21
22 #include "libavutil/avassert.h"
23 #include "libavutil/imgutils.h"
24 #include "libavutil/opt.h"
25 #include "libavutil/parseutils.h"
26 #include "libavutil/pixdesc.h"
27 #include "avfilter.h"
28 #include "formats.h"
29 #include "internal.h"
30 #include "video.h"
31
32 enum StereoCode {
33     ANAGLYPH_RC_GRAY,   // anaglyph red/cyan gray
34     ANAGLYPH_RC_HALF,   // anaglyph red/cyan half colored
35     ANAGLYPH_RC_COLOR,  // anaglyph red/cyan colored
36     ANAGLYPH_RC_DUBOIS, // anaglyph red/cyan dubois
37     ANAGLYPH_GM_GRAY,   // anaglyph green/magenta gray
38     ANAGLYPH_GM_HALF,   // anaglyph green/magenta half colored
39     ANAGLYPH_GM_COLOR,  // anaglyph green/magenta colored
40     ANAGLYPH_GM_DUBOIS, // anaglyph green/magenta dubois
41     ANAGLYPH_YB_GRAY,   // anaglyph yellow/blue gray
42     ANAGLYPH_YB_HALF,   // anaglyph yellow/blue half colored
43     ANAGLYPH_YB_COLOR,  // anaglyph yellow/blue colored
44     ANAGLYPH_YB_DUBOIS, // anaglyph yellow/blue dubois
45     ANAGLYPH_RB_GRAY,   // anaglyph red/blue gray
46     ANAGLYPH_RG_GRAY,   // anaglyph red/green gray
47     MONO_L,             // mono output for debugging (left eye only)
48     MONO_R,             // mono output for debugging (right eye only)
49     INTERLEAVE_ROWS_LR, // row-interleave (left eye has top row)
50     INTERLEAVE_ROWS_RL, // row-interleave (right eye has top row)
51     SIDE_BY_SIDE_LR,    // side by side parallel (left eye left, right eye right)
52     SIDE_BY_SIDE_RL,    // side by side crosseye (right eye left, left eye right)
53     SIDE_BY_SIDE_2_LR,  // side by side parallel with half width resolution
54     SIDE_BY_SIDE_2_RL,  // side by side crosseye with half width resolution
55     ABOVE_BELOW_LR,     // above-below (left eye above, right eye below)
56     ABOVE_BELOW_RL,     // above-below (right eye above, left eye below)
57     ABOVE_BELOW_2_LR,   // above-below with half height resolution
58     ABOVE_BELOW_2_RL,   // above-below with half height resolution
59     STEREO_CODE_COUNT   // TODO: needs autodetection
60 };
61
62 typedef struct StereoComponent {
63     enum StereoCode format;
64     int width, height;
65     int off_left, off_right;
66     int row_left, row_right;
67 } StereoComponent;
68
69 static const int ana_coeff[][3][6] = {
70   [ANAGLYPH_RB_GRAY]   =
71     {{19595, 38470,  7471,     0,     0,     0},
72      {    0,     0,     0,     0,     0,     0},
73      {    0,     0,     0, 19595, 38470,  7471}},
74   [ANAGLYPH_RG_GRAY]   =
75     {{19595, 38470,  7471,     0,     0,     0},
76      {    0,     0,     0, 19595, 38470,  7471},
77      {    0,     0,     0,     0,     0,     0}},
78   [ANAGLYPH_RC_GRAY]   =
79     {{19595, 38470,  7471,     0,     0,     0},
80      {    0,     0,     0, 19595, 38470,  7471},
81      {    0,     0,     0, 19595, 38470,  7471}},
82   [ANAGLYPH_RC_HALF]   =
83     {{19595, 38470,  7471,     0,     0,     0},
84      {    0,     0,     0,     0, 65536,     0},
85      {    0,     0,     0,     0,     0, 65536}},
86   [ANAGLYPH_RC_COLOR]  =
87     {{65536,     0,     0,     0,     0,     0},
88      {    0,     0,     0,     0, 65536,     0},
89      {    0,     0,     0,     0,     0, 65536}},
90   [ANAGLYPH_RC_DUBOIS] =
91     {{29891, 32800, 11559, -2849, -5763,  -102},
92      {-2627, -2479, -1033, 24804, 48080, -1209},
93      { -997, -1350,  -358, -4729, -7403, 80373}},
94   [ANAGLYPH_GM_GRAY]   =
95     {{    0,     0,     0, 19595, 38470,  7471},
96      {19595, 38470,  7471,     0,     0,     0},
97      {    0,     0,     0, 19595, 38470,  7471}},
98   [ANAGLYPH_GM_HALF]   =
99     {{    0,     0,     0, 65536,     0,     0},
100      {19595, 38470,  7471,     0,     0,     0},
101      {    0,     0,     0,     0,     0, 65536}},
102   [ANAGLYPH_GM_COLOR]  =
103     {{    0,     0,     0, 65536,     0,     0},
104      {    0, 65536,     0,     0,     0,     0},
105      {    0,     0,     0,     0,     0, 65536}},
106   [ANAGLYPH_GM_DUBOIS]  =
107     {{-4063,-10354, -2556, 34669, 46203,  1573},
108      {18612, 43778,  9372, -1049,  -983, -4260},
109      { -983, -1769,  1376,   590,  4915, 61407}},
110   [ANAGLYPH_YB_GRAY]   =
111     {{    0,     0,     0, 19595, 38470,  7471},
112      {    0,     0,     0, 19595, 38470,  7471},
113      {19595, 38470,  7471,     0,     0,     0}},
114   [ANAGLYPH_YB_HALF]   =
115     {{    0,     0,     0, 65536,     0,     0},
116      {    0,     0,     0,     0, 65536,     0},
117      {19595, 38470,  7471,     0,     0,     0}},
118   [ANAGLYPH_YB_COLOR]  =
119     {{    0,     0,     0, 65536,     0,     0},
120      {    0,     0,     0,     0, 65536,     0},
121      {    0,     0, 65536,     0,     0,     0}},
122   [ANAGLYPH_YB_DUBOIS] =
123     {{65535,-12650,18451,   -987, -7590, -1049},
124      {-1604, 56032, 4196,    370,  3826, -1049},
125      {-2345,-10676, 1358,   5801, 11416, 56217}},
126 };
127
128 typedef struct Stereo3DContext {
129     const AVClass *class;
130     StereoComponent in, out;
131     int width, height;
132     int row_step;
133     int ana_matrix[3][6];
134 } Stereo3DContext;
135
136 #define OFFSET(x) offsetof(Stereo3DContext, x)
137 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
138
139 static const AVOption stereo3d_options[] = {
140     { "in",    "set input format",  OFFSET(in.format),  AV_OPT_TYPE_INT, {.i64=SIDE_BY_SIDE_LR}, SIDE_BY_SIDE_LR, ABOVE_BELOW_2_RL, FLAGS, "in"},
141     { "ab2l",  "above below half height left first",  0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR},  0, 0, FLAGS, "in" },
142     { "ab2r",  "above below half height right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_RL},  0, 0, FLAGS, "in" },
143     { "abl",   "above below left first",              0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_LR},    0, 0, FLAGS, "in" },
144     { "abr",   "above below right first",             0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_RL},    0, 0, FLAGS, "in" },
145     { "sbs2l", "side by side half width left first",  0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_LR}, 0, 0, FLAGS, "in" },
146     { "sbs2r", "side by side half width right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_RL}, 0, 0, FLAGS, "in" },
147     { "sbsl",  "side by side left first",             0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_LR},   0, 0, FLAGS, "in" },
148     { "sbsr",  "side by side right first",            0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_RL},   0, 0, FLAGS, "in" },
149     { "out",   "set output format", OFFSET(out.format), AV_OPT_TYPE_INT, {.i64=ANAGLYPH_RC_DUBOIS}, 0, STEREO_CODE_COUNT-1, FLAGS, "out"},
150     { "ab2l",  "above below half height left first",  0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR},   0, 0, FLAGS, "out" },
151     { "ab2r",  "above below half height right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_RL},   0, 0, FLAGS, "out" },
152     { "abl",   "above below left first",              0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_LR},     0, 0, FLAGS, "out" },
153     { "abr",   "above below right first",             0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_RL},     0, 0, FLAGS, "out" },
154     { "agmc",  "anaglyph green magenta color",        0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_GM_COLOR},  0, 0, FLAGS, "out" },
155     { "agmd",  "anaglyph green magenta dubois",       0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_GM_DUBOIS}, 0, 0, FLAGS, "out" },
156     { "agmg",  "anaglyph green magenta gray",         0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_GM_GRAY},   0, 0, FLAGS, "out" },
157     { "agmh",  "anaglyph green magenta half color",   0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_GM_HALF},   0, 0, FLAGS, "out" },
158     { "arbg",  "anaglyph red blue gray",              0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_RB_GRAY},   0, 0, FLAGS, "out" },
159     { "arcc",  "anaglyph red cyan color",             0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_RC_COLOR},  0, 0, FLAGS, "out" },
160     { "arcd",  "anaglyph red cyan dubois",            0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_RC_DUBOIS}, 0, 0, FLAGS, "out" },
161     { "arcg",  "anaglyph red cyan gray",              0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_RC_GRAY},   0, 0, FLAGS, "out" },
162     { "arch",  "anaglyph red cyan half color",        0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_RC_HALF},   0, 0, FLAGS, "out" },
163     { "argg",  "anaglyph red green gray",             0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_RG_GRAY},   0, 0, FLAGS, "out" },
164     { "aybc",  "anaglyph yellow blue color",          0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_YB_COLOR},  0, 0, FLAGS, "out" },
165     { "aybd",  "anaglyph yellow blue dubois",         0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_YB_DUBOIS}, 0, 0, FLAGS, "out" },
166     { "aybg",  "anaglyph yellow blue gray",           0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_YB_GRAY},   0, 0, FLAGS, "out" },
167     { "aybh",  "anaglyph yellow blue half color",     0, AV_OPT_TYPE_CONST, {.i64=ANAGLYPH_YB_HALF},   0, 0, FLAGS, "out" },
168     { "irl",   "interleave rows left first",          0, AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_ROWS_LR}, 0, 0, FLAGS, "out" },
169     { "irr",   "interleave rows right first",         0, AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_ROWS_RL}, 0, 0, FLAGS, "out" },
170     { "ml",    "mono left",                           0, AV_OPT_TYPE_CONST, {.i64=MONO_L},             0, 0, FLAGS, "out" },
171     { "mr",    "mono right",                          0, AV_OPT_TYPE_CONST, {.i64=MONO_R},             0, 0, FLAGS, "out" },
172     { "sbs2l", "side by side half width left first",  0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_LR},  0, 0, FLAGS, "out" },
173     { "sbs2r", "side by side half width right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_RL},  0, 0, FLAGS, "out" },
174     { "sbsl",  "side by side left first",             0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_LR},    0, 0, FLAGS, "out" },
175     { "sbsr",  "side by side right first",            0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_RL},    0, 0, FLAGS, "out" },
176     {NULL},
177 };
178
179 AVFILTER_DEFINE_CLASS(stereo3d);
180
181 static int query_formats(AVFilterContext *ctx)
182 {
183     static const enum AVPixelFormat pix_fmts[] = {
184         AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
185     };
186
187     ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
188
189     return 0;
190 }
191
192 static int config_output(AVFilterLink *outlink)
193 {
194     AVFilterContext *ctx = outlink->src;
195     AVFilterLink *inlink = ctx->inputs[0];
196     Stereo3DContext *s = ctx->priv;
197     AVRational aspect = inlink->sample_aspect_ratio;
198
199     s->in.width     =
200     s->width        = inlink->w;
201     s->in.height    =
202     s->height       = inlink->h;
203     s->row_step     = 1;
204     s->in.off_left  =
205     s->in.off_right =
206     s->in.row_left  =
207     s->in.row_right = 0;
208
209     switch (s->in.format) {
210     case SIDE_BY_SIDE_2_LR:
211         aspect.num     *= 2;
212     case SIDE_BY_SIDE_LR:
213         s->width        = inlink->w / 2;
214         s->in.off_right = s->width * 3;
215         break;
216     case SIDE_BY_SIDE_2_RL:
217         aspect.num     *= 2;
218     case SIDE_BY_SIDE_RL:
219         s->width        = inlink->w / 2;
220         s->in.off_left  = s->width * 3;
221         break;
222     case ABOVE_BELOW_2_LR:
223         aspect.den     *= 2;
224     case ABOVE_BELOW_LR:
225         s->in.row_right =
226         s->height       = inlink->h / 2;
227         break;
228     case ABOVE_BELOW_2_RL:
229         aspect.den     *= 2;
230     case ABOVE_BELOW_RL:
231         s->in.row_left  =
232         s->height       = inlink->h / 2;
233         break;
234     default:
235         av_log(ctx, AV_LOG_ERROR, "input format %d is not supported\n", s->in.format);
236         return AVERROR(EINVAL);
237     }
238
239     s->out.width     = s->width;
240     s->out.height    = s->height;
241     s->out.off_left  =
242     s->out.off_right =
243     s->out.row_left  =
244     s->out.row_right = 0;
245
246     switch (s->out.format) {
247     case ANAGLYPH_RB_GRAY:
248     case ANAGLYPH_RG_GRAY:
249     case ANAGLYPH_RC_GRAY:
250     case ANAGLYPH_RC_HALF:
251     case ANAGLYPH_RC_COLOR:
252     case ANAGLYPH_RC_DUBOIS:
253     case ANAGLYPH_GM_GRAY:
254     case ANAGLYPH_GM_HALF:
255     case ANAGLYPH_GM_COLOR:
256     case ANAGLYPH_GM_DUBOIS:
257     case ANAGLYPH_YB_GRAY:
258     case ANAGLYPH_YB_HALF:
259     case ANAGLYPH_YB_COLOR:
260     case ANAGLYPH_YB_DUBOIS:
261         memcpy(s->ana_matrix, ana_coeff[s->out.format], sizeof(s->ana_matrix));
262         break;
263     case SIDE_BY_SIDE_2_LR:
264         aspect.num      /= 2;
265     case SIDE_BY_SIDE_LR:
266         s->out.width     =
267         s->out.off_right = s->width * 3;
268         break;
269     case SIDE_BY_SIDE_2_RL:
270         aspect.num      /= 2;
271     case SIDE_BY_SIDE_RL:
272         s->out.width     = s->width * 2;
273         s->out.off_left  = s->width * 3;
274         break;
275     case ABOVE_BELOW_2_LR:
276         aspect.den      /= 2;
277     case ABOVE_BELOW_LR:
278         s->out.height    = s->height * 2;
279         s->out.row_right = s->height;
280         break;
281     case ABOVE_BELOW_2_RL:
282         aspect.den      /= 2;
283     case ABOVE_BELOW_RL:
284         s->out.height    = s->height * 2;
285         s->out.row_left  = s->height;
286         break;
287     case INTERLEAVE_ROWS_LR:
288         s->row_step      = 2;
289         s->height        = s->height / 2;
290         s->out.off_right = s->width * 3;
291         s->in.off_right += s->in.width * 3;
292         break;
293     case INTERLEAVE_ROWS_RL:
294         s->row_step      = 2;
295         s->height        = s->height / 2;
296         s->out.off_left  = s->width * 3;
297         s->in.off_left  += s->in.width * 3;
298         break;
299     case MONO_R:
300         s->in.off_left   = s->in.off_right;
301         s->in.row_left   = s->in.row_right;
302     case MONO_L:
303         break;
304     default:
305         av_log(ctx, AV_LOG_ERROR, "output format is not supported\n");
306         return AVERROR(EINVAL);
307     }
308
309     outlink->w = s->out.width;
310     outlink->h = s->out.height;
311     outlink->sample_aspect_ratio = aspect;
312
313     return 0;
314 }
315
316 static inline uint8_t ana_convert(const int *coeff, uint8_t *left, uint8_t *right)
317 {
318     int sum;
319
320     sum  = coeff[0] * left[0] + coeff[3] * right[0]; //red in
321     sum += coeff[1] * left[1] + coeff[4] * right[1]; //green in
322     sum += coeff[2] * left[2] + coeff[5] * right[2]; //blue in
323
324     return av_clip_uint8(sum >> 16);
325 }
326
327 static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
328 {
329     AVFilterContext *ctx  = inlink->dst;
330     Stereo3DContext *s = ctx->priv;
331     AVFilterLink *outlink = ctx->outputs[0];
332     AVFrame *out;
333     int out_off_left, out_off_right;
334     int in_off_left, in_off_right;
335     int ret;
336
337     out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
338     if (!out) {
339         av_frame_free(&inpicref);
340         return AVERROR(ENOMEM);
341     }
342     av_frame_copy_props(out, inpicref);
343
344     in_off_left   = s->in.row_left  * inpicref->linesize[0] + s->in.off_left;
345     in_off_right  = s->in.row_right * inpicref->linesize[0] + s->in.off_right;
346     out_off_left  = s->out.row_left  * out->linesize[0] + s->out.off_left;
347     out_off_right = s->out.row_right * out->linesize[0] + s->out.off_right;
348
349     switch (s->out.format) {
350     case SIDE_BY_SIDE_LR:
351     case SIDE_BY_SIDE_RL:
352     case SIDE_BY_SIDE_2_LR:
353     case SIDE_BY_SIDE_2_RL:
354     case ABOVE_BELOW_LR:
355     case ABOVE_BELOW_RL:
356     case ABOVE_BELOW_2_LR:
357     case ABOVE_BELOW_2_RL:
358     case INTERLEAVE_ROWS_LR:
359     case INTERLEAVE_ROWS_RL:
360         av_image_copy_plane(out->data[0] + out_off_left,
361                             out->linesize[0] * s->row_step,
362                             inpicref->data[0] + in_off_left,
363                             inpicref->linesize[0] * s->row_step,
364                             3 * s->width, s->height);
365         av_image_copy_plane(out->data[0] + out_off_right,
366                             out->linesize[0] * s->row_step,
367                             inpicref->data[0] + in_off_right,
368                             inpicref->linesize[0] * s->row_step,
369                             3 * s->width, s->height);
370         break;
371     case MONO_L:
372     case MONO_R:
373         av_image_copy_plane(out->data[0], out->linesize[0],
374                             inpicref->data[0] + in_off_left,
375                             inpicref->linesize[0],
376                             3 * s->width, s->height);
377         break;
378     case ANAGLYPH_RB_GRAY:
379     case ANAGLYPH_RG_GRAY:
380     case ANAGLYPH_RC_GRAY:
381     case ANAGLYPH_RC_HALF:
382     case ANAGLYPH_RC_COLOR:
383     case ANAGLYPH_RC_DUBOIS:
384     case ANAGLYPH_GM_GRAY:
385     case ANAGLYPH_GM_HALF:
386     case ANAGLYPH_GM_COLOR:
387     case ANAGLYPH_GM_DUBOIS:
388     case ANAGLYPH_YB_GRAY:
389     case ANAGLYPH_YB_HALF:
390     case ANAGLYPH_YB_COLOR:
391     case ANAGLYPH_YB_DUBOIS: {
392         int i, x, y, il, ir, o;
393         uint8_t *src = inpicref->data[0];
394         uint8_t *dst = out->data[0];
395         int out_width = s->out.width;
396         int *ana_matrix[3];
397
398         for (i = 0; i < 3; i++)
399             ana_matrix[i] = s->ana_matrix[i];
400
401         for (y = 0; y < s->out.height; y++) {
402             o   = out->linesize[0] * y;
403             il  = in_off_left  + y * inpicref->linesize[0];
404             ir  = in_off_right + y * inpicref->linesize[0];
405             for (x = 0; x < out_width; x++, il += 3, ir += 3, o+= 3) {
406                 dst[o    ] = ana_convert(ana_matrix[0], src + il, src + ir);
407                 dst[o + 1] = ana_convert(ana_matrix[1], src + il, src + ir);
408                 dst[o + 2] = ana_convert(ana_matrix[2], src + il, src + ir);
409             }
410         }
411         break;
412     }
413     default:
414         av_assert0(0);
415     }
416
417     ret = ff_filter_frame(outlink, out);
418     av_frame_free(&inpicref);
419     if (ret < 0)
420         return ret;
421     return 0;
422 }
423
424 static const AVFilterPad stereo3d_inputs[] = {
425     {
426         .name             = "default",
427         .type             = AVMEDIA_TYPE_VIDEO,
428         .get_video_buffer = ff_null_get_video_buffer,
429         .filter_frame     = filter_frame,
430     },
431     { NULL }
432 };
433
434 static const AVFilterPad stereo3d_outputs[] = {
435     {
436         .name         = "default",
437         .type         = AVMEDIA_TYPE_VIDEO,
438         .config_props = config_output,
439     },
440     { NULL }
441 };
442
443 AVFilter avfilter_vf_stereo3d = {
444     .name          = "stereo3d",
445     .description   = NULL_IF_CONFIG_SMALL("Convert video stereoscopic 3D view."),
446     .priv_size     = sizeof(Stereo3DContext),
447     .query_formats = query_formats,
448     .inputs        = stereo3d_inputs,
449     .outputs       = stereo3d_outputs,
450     .priv_class    = &stereo3d_class,
451 };