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.

114 lines
2.5KB

  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. NB_PROJECTIONS,
  33. };
  34. enum InterpMethod {
  35. NEAREST,
  36. BILINEAR,
  37. BICUBIC,
  38. LANCZOS,
  39. NB_INTERP_METHODS,
  40. };
  41. enum Faces {
  42. TOP_LEFT,
  43. TOP_MIDDLE,
  44. TOP_RIGHT,
  45. BOTTOM_LEFT,
  46. BOTTOM_MIDDLE,
  47. BOTTOM_RIGHT,
  48. NB_FACES,
  49. };
  50. enum Direction {
  51. RIGHT, ///< Axis +X
  52. LEFT, ///< Axis -X
  53. UP, ///< Axis +Y
  54. DOWN, ///< Axis -Y
  55. FRONT, ///< Axis -Z
  56. BACK, ///< Axis +Z
  57. NB_DIRECTIONS,
  58. };
  59. enum Rotation {
  60. ROT_0,
  61. ROT_90,
  62. ROT_180,
  63. ROT_270,
  64. NB_ROTATIONS,
  65. };
  66. typedef struct V360Context {
  67. const AVClass *class;
  68. int in, out;
  69. int interp;
  70. int width, height;
  71. char* in_forder;
  72. char* out_forder;
  73. char* in_frot;
  74. char* out_frot;
  75. int in_cubemap_face_order[6];
  76. int out_cubemap_direction_order[6];
  77. int in_cubemap_face_rotation[6];
  78. int out_cubemap_face_rotation[6];
  79. float in_pad, out_pad;
  80. float yaw, pitch, roll;
  81. int h_flip, v_flip, d_flip;
  82. float h_fov, v_fov;
  83. float flat_range[3];
  84. int planewidth[4], planeheight[4];
  85. int inplanewidth[4], inplaneheight[4];
  86. int nb_planes;
  87. uint16_t *u[4], *v[4];
  88. int16_t *ker[4];
  89. int (*remap_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
  90. void (*remap_line)(uint8_t *dst, int width, const uint8_t *src, ptrdiff_t in_linesize,
  91. const uint16_t *u, const uint16_t *v, const int16_t *ker);
  92. } V360Context;
  93. void ff_v360_init(V360Context *s, int depth);
  94. void ff_v360_init_x86(V360Context *s, int depth);
  95. #endif /* AVFILTER_V360_H */