]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/v360.h
avfilter/vf_ssim: remove unnecessary check
[ffmpeg] / libavfilter / v360.h
index 50ed91ed89334f18704ec08379c0cbbbcc1d2f76..87770664a359e801073cddef528b08635de0ec84 100644 (file)
@@ -41,14 +41,31 @@ enum Projections {
     STEREOGRAPHIC,
     MERCATOR,
     BALL,
+    HAMMER,
+    SINUSOIDAL,
+    FISHEYE,
+    PANNINI,
+    CYLINDRICAL,
+    PERSPECTIVE,
+    TETRAHEDRON,
+    BARREL_SPLIT,
+    TSPYRAMID,
+    HEQUIRECTANGULAR,
+    EQUISOLID,
+    ORTHOGRAPHIC,
+    OCTAHEDRON,
     NB_PROJECTIONS,
 };
 
 enum InterpMethod {
     NEAREST,
     BILINEAR,
+    LAGRANGE9,
     BICUBIC,
     LANCZOS,
+    SPLINE16,
+    GAUSSIAN,
+    MITCHELL,
     NB_INTERP_METHODS,
 };
 
@@ -88,15 +105,22 @@ enum RotationOrder {
 };
 
 typedef struct XYRemap {
-    uint16_t u[4][4];
-    uint16_t v[4][4];
+    int16_t u[4][4];
+    int16_t v[4][4];
     float ker[4][4];
 } XYRemap;
 
+typedef struct SliceXYRemap {
+    int16_t *u[2], *v[2];
+    int16_t *ker[2];
+    uint8_t *mask;
+} SliceXYRemap;
+
 typedef struct V360Context {
     const AVClass *class;
     int in, out;
     int interp;
+    int alpha;
     int width, height;
     char *in_forder;
     char *out_forder;
@@ -113,6 +137,7 @@ typedef struct V360Context {
     int in_stereo, out_stereo;
 
     float in_pad, out_pad;
+    int fin_pad, fout_pad;
 
     float yaw, pitch, roll;
 
@@ -121,13 +146,17 @@ typedef struct V360Context {
     int in_transpose, out_transpose;
 
     float h_fov, v_fov, d_fov;
-    float flat_range[3];
+    float ih_fov, iv_fov, id_fov;
+    float flat_range[2];
+    float iflat_range[2];
 
-    float rot_mat[3][3];
+    float rot_quaternion[2][4];
 
-    float input_mirror_modifier[2];
     float output_mirror_modifier[3];
 
+    int in_width, in_height;
+    int out_width, out_height;
+
     int pr_width[4], pr_height[4];
 
     int in_offset_w[4], in_offset_h[4];
@@ -139,26 +168,28 @@ typedef struct V360Context {
     int nb_planes;
     int nb_allocated;
     int elements;
+    int mask_size;
+    int max_value;
+    int nb_threads;
 
-    uint16_t *u[4], *v[4];
-    int16_t *ker[4];
+    SliceXYRemap *slice_remap;
     unsigned map[4];
 
-    void (*in_transform)(const struct V360Context *s,
-                         const float *vec, int width, int height,
-                         uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv);
+    int (*in_transform)(const struct V360Context *s,
+                        const float *vec, int width, int height,
+                        int16_t us[4][4], int16_t vs[4][4], float *du, float *dv);
 
-    void (*out_transform)(const struct V360Context *s,
-                          int i, int j, int width, int height,
-                          float *vec);
+    int (*out_transform)(const struct V360Context *s,
+                         int i, int j, int width, int height,
+                         float *vec);
 
     void (*calculate_kernel)(float du, float dv, const XYRemap *rmap,
-                             uint16_t *u, uint16_t *v, int16_t *ker);
+                             int16_t *u, int16_t *v, int16_t *ker);
 
     int (*remap_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
 
-    void (*remap_line)(uint8_t *dst, int width, const uint8_t *src, ptrdiff_t in_linesize,
-                       const uint16_t *u, const uint16_t *v, const int16_t *ker);
+    void (*remap_line)(uint8_t *dst, int width, const uint8_t *const src, ptrdiff_t in_linesize,
+                       const int16_t *const u, const int16_t *const v, const int16_t *const ker);
 } V360Context;
 
 void ff_v360_init(V360Context *s, int depth);