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.

131 lines
2.8KB

  1. /*
  2. * Copyright (c) 2019 Eugene Lyapustin
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVFILTER_V360_H
  21. #define AVFILTER_V360_H
  22. #include "avfilter.h"
  23. enum Projections {
  24. EQUIRECTANGULAR,
  25. CUBEMAP_3_2,
  26. CUBEMAP_6_1,
  27. EQUIANGULAR,
  28. FLAT,
  29. DUAL_FISHEYE,
  30. BARREL,
  31. CUBEMAP_1_6,
  32. STEREOGRAPHIC,
  33. NB_PROJECTIONS,
  34. };
  35. enum InterpMethod {
  36. NEAREST,
  37. BILINEAR,
  38. BICUBIC,
  39. LANCZOS,
  40. NB_INTERP_METHODS,
  41. };
  42. enum Faces {
  43. TOP_LEFT,
  44. TOP_MIDDLE,
  45. TOP_RIGHT,
  46. BOTTOM_LEFT,
  47. BOTTOM_MIDDLE,
  48. BOTTOM_RIGHT,
  49. NB_FACES,
  50. };
  51. enum Direction {
  52. RIGHT, ///< Axis +X
  53. LEFT, ///< Axis -X
  54. UP, ///< Axis +Y
  55. DOWN, ///< Axis -Y
  56. FRONT, ///< Axis -Z
  57. BACK, ///< Axis +Z
  58. NB_DIRECTIONS,
  59. };
  60. enum Rotation {
  61. ROT_0,
  62. ROT_90,
  63. ROT_180,
  64. ROT_270,
  65. NB_ROTATIONS,
  66. };
  67. enum RotationOrder {
  68. YAW,
  69. PITCH,
  70. ROLL,
  71. NB_RORDERS,
  72. };
  73. typedef struct V360Context {
  74. const AVClass *class;
  75. int in, out;
  76. int interp;
  77. int width, height;
  78. char *in_forder;
  79. char *out_forder;
  80. char *in_frot;
  81. char *out_frot;
  82. char *rorder;
  83. int in_cubemap_face_order[6];
  84. int out_cubemap_direction_order[6];
  85. int in_cubemap_face_rotation[6];
  86. int out_cubemap_face_rotation[6];
  87. int rotation_order[3];
  88. float in_pad, out_pad;
  89. float yaw, pitch, roll;
  90. int ih_flip, iv_flip;
  91. int h_flip, v_flip, d_flip;
  92. int in_transpose, out_transpose;
  93. float h_fov, v_fov;
  94. float flat_range[3];
  95. float input_mirror_modifier[2];
  96. int planewidth[4], planeheight[4];
  97. int inplanewidth[4], inplaneheight[4];
  98. int uv_linesize[4];
  99. int nb_planes;
  100. int nb_allocated;
  101. uint16_t *u[4], *v[4];
  102. int16_t *ker[4];
  103. unsigned map[4];
  104. int (*remap_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
  105. void (*remap_line)(uint8_t *dst, int width, const uint8_t *src, ptrdiff_t in_linesize,
  106. const uint16_t *u, const uint16_t *v, const int16_t *ker);
  107. } V360Context;
  108. void ff_v360_init(V360Context *s, int depth);
  109. void ff_v360_init_x86(V360Context *s, int depth);
  110. #endif /* AVFILTER_V360_H */