You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

455 lines
18KB

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