| @@ -211,7 +211,7 @@ static int query_formats(AVFilterContext *ctx) · 210 unmodified lines |
| 211 | 211 | #define DEFINE_REMAP1_LINE(bits, div) \ |
| 212 | 212 | static void remap1_##bits##bit_line_c(uint8_t *dst, int width, const uint8_t *const src, \ |
| 213 | 213 | ptrdiff_t in_linesize, \ |
| 214 | | − const uint16_t *const u, const uint16_t *const v, \ |
| 214 | + const int16_t *const u, const int16_t *const v, \ |
| 215 | 215 | const int16_t *const ker) \ |
| 216 | 216 | { \ |
| 217 | 217 | const uint##bits##_t *const s = (const uint##bits##_t *const)src; \ |
| @@ -260,8 +260,8 @@ static int remap##ws##_##bits##bit_slice(AVFilterContext *ctx, void *arg, int jo · 42 unmodified lines |
| 260 | 260 | const int slice_end = (height * (jobnr + 1)) / nb_jobs; \ |
| 261 | 261 | \ |
| 262 | 262 | for (int y = slice_start; y < slice_end; y++) { \ |
| 263 | | − const uint16_t *const u = s->u[map] + y * uv_linesize * ws * ws; \ |
| 264 | | − const uint16_t *const v = s->v[map] + y * uv_linesize * ws * ws; \ |
| 263 | + const int16_t *const u = s->u[map] + y * uv_linesize * ws * ws; \ |
| 264 | + const int16_t *const v = s->v[map] + y * uv_linesize * ws * ws; \ |
| 265 | 265 | const int16_t *const ker = s->ker[map] + y * uv_linesize * ws * ws; \ |
| 266 | 266 | \ |
| 267 | 267 | s->remap_line(dst + y * out_linesize, width, src, in_linesize, u, v, ker); \ |
| @@ -282,7 +282,7 @@ DEFINE_REMAP(4, 16) · 14 unmodified lines |
| 282 | 282 | #define DEFINE_REMAP_LINE(ws, bits, div) \ |
| 283 | 283 | static void remap##ws##_##bits##bit_line_c(uint8_t *dst, int width, const uint8_t *const src, \ |
| 284 | 284 | ptrdiff_t in_linesize, \ |
| 285 | | − const uint16_t *const u, const uint16_t *const v, \ |
| 285 | + const int16_t *const u, const int16_t *const v, \ |
| 286 | 286 | const int16_t *const ker) \ |
| 287 | 287 | { \ |
| 288 | 288 | const uint##bits##_t *const s = (const uint##bits##_t *const)src; \ |
| @@ -291,8 +291,8 @@ static void remap##ws##_##bits##bit_line_c(uint8_t *dst, int width, const uint8_ · 2 unmodified lines |
| 291 | 291 | in_linesize /= div; \ |
| 292 | 292 | \ |
| 293 | 293 | for (int x = 0; x < width; x++) { \ |
| 294 | | − const uint16_t *const uu = u + x * ws * ws; \ |
| 295 | | − const uint16_t *const vv = v + x * ws * ws; \ |
| 294 | + const int16_t *const uu = u + x * ws * ws; \ |
| 295 | + const int16_t *const vv = v + x * ws * ws; \ |
| 296 | 296 | const int16_t *const kker = ker + x * ws * ws; \ |
| 297 | 297 | int tmp = 0; \ |
| 298 | 298 | \ |
| @@ -343,7 +343,7 @@ void ff_v360_init(V360Context *s, int depth) · 44 unmodified lines |
| 343 | 343 | * @param ker ker remap data |
| 344 | 344 | */ |
| 345 | 345 | static void nearest_kernel(float du, float dv, const XYRemap *rmap, |
| 346 | | − uint16_t *u, uint16_t *v, int16_t *ker) |
| 346 | + int16_t *u, int16_t *v, int16_t *ker) |
| 347 | 347 | { |
| 348 | 348 | const int i = roundf(dv) + 1; |
| 349 | 349 | const int j = roundf(du) + 1; |
| @@ -363,7 +363,7 @@ static void nearest_kernel(float du, float dv, const XYRemap *rmap, · 13 unmodified lines |
| 363 | 363 | * @param ker ker remap data |
| 364 | 364 | */ |
| 365 | 365 | static void bilinear_kernel(float du, float dv, const XYRemap *rmap, |
| 366 | | − uint16_t *u, uint16_t *v, int16_t *ker) |
| 366 | + int16_t *u, int16_t *v, int16_t *ker) |
| 367 | 367 | { |
| 368 | 368 | for (int i = 0; i < 2; i++) { |
| 369 | 369 | for (int j = 0; j < 2; j++) { |
| @@ -406,7 +406,7 @@ static inline void calculate_bicubic_coeffs(float t, float *coeffs) · 36 unmodified lines |
| 406 | 406 | * @param ker ker remap data |
| 407 | 407 | */ |
| 408 | 408 | static void bicubic_kernel(float du, float dv, const XYRemap *rmap, |
| 409 | | − uint16_t *u, uint16_t *v, int16_t *ker) |
| 409 | + int16_t *u, int16_t *v, int16_t *ker) |
| 410 | 410 | { |
| 411 | 411 | float du_coeffs[4]; |
| 412 | 412 | float dv_coeffs[4]; |
| @@ -459,7 +459,7 @@ static inline void calculate_lanczos_coeffs(float t, float *coeffs) · 46 unmodified lines |
| 459 | 459 | * @param ker ker remap data |
| 460 | 460 | */ |
| 461 | 461 | static void lanczos_kernel(float du, float dv, const XYRemap *rmap, |
| 462 | | − uint16_t *u, uint16_t *v, int16_t *ker) |
| 462 | + int16_t *u, int16_t *v, int16_t *ker) |
| 463 | 463 | { |
| 464 | 464 | float du_coeffs[4]; |
| 465 | 465 | float dv_coeffs[4]; |
| @@ -501,7 +501,7 @@ static void calculate_spline16_coeffs(float t, float *coeffs) · 35 unmodified lines |
| 501 | 501 | * @param ker ker remap data |
| 502 | 502 | */ |
| 503 | 503 | static void spline16_kernel(float du, float dv, const XYRemap *rmap, |
| 504 | | − uint16_t *u, uint16_t *v, int16_t *ker) |
| 504 | + int16_t *u, int16_t *v, int16_t *ker) |
| 505 | 505 | { |
| 506 | 506 | float du_coeffs[4]; |
| 507 | 507 | float dv_coeffs[4]; |
| @@ -554,7 +554,7 @@ static void calculate_gaussian_coeffs(float t, float *coeffs) · 46 unmodified lines |
| 554 | 554 | * @param ker ker remap data |
| 555 | 555 | */ |
| 556 | 556 | static void gaussian_kernel(float du, float dv, const XYRemap *rmap, |
| 557 | | − uint16_t *u, uint16_t *v, int16_t *ker) |
| 557 | + int16_t *u, int16_t *v, int16_t *ker) |
| 558 | 558 | { |
| 559 | 559 | float du_coeffs[4]; |
| 560 | 560 | float dv_coeffs[4]; |
| @@ -1212,7 +1212,7 @@ static void cube3x2_to_xyz(const V360Context *s, · 651 unmodified lines |
| 1212 | 1212 | */ |
| 1213 | 1213 | static void xyz_to_cube3x2(const V360Context *s, |
| 1214 | 1214 | const float *vec, int width, int height, |
| 1215 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1215 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1216 | 1216 | { |
| 1217 | 1217 | const float scalew = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_width / 3.f) : 1.f - s->in_pad; |
| 1218 | 1218 | const float scaleh = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_height / 2.f) : 1.f - s->in_pad; |
| @@ -1363,7 +1363,7 @@ static void cube6x1_to_xyz(const V360Context *s, · 144 unmodified lines |
| 1363 | 1363 | */ |
| 1364 | 1364 | static void xyz_to_cube1x6(const V360Context *s, |
| 1365 | 1365 | const float *vec, int width, int height, |
| 1366 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1366 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1367 | 1367 | { |
| 1368 | 1368 | const float scalew = s->fin_pad > 0 ? 1.f - (float)(s->fin_pad) / s->in_width : 1.f - s->in_pad; |
| 1369 | 1369 | const float scaleh = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_height / 6.f) : 1.f - s->in_pad; |
| @@ -1441,7 +1441,7 @@ static void xyz_to_cube1x6(const V360Context *s, · 71 unmodified lines |
| 1441 | 1441 | */ |
| 1442 | 1442 | static void xyz_to_cube6x1(const V360Context *s, |
| 1443 | 1443 | const float *vec, int width, int height, |
| 1444 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1444 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1445 | 1445 | { |
| 1446 | 1446 | const float scalew = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_width / 6.f) : 1.f - s->in_pad; |
| 1447 | 1447 | const float scaleh = s->fin_pad > 0 ? 1.f - (float)(s->fin_pad) / s->in_height : 1.f - s->in_pad; |
| @@ -1588,7 +1588,7 @@ static void stereographic_to_xyz(const V360Context *s, · 140 unmodified lines |
| 1588 | 1588 | */ |
| 1589 | 1589 | static void xyz_to_stereographic(const V360Context *s, |
| 1590 | 1590 | const float *vec, int width, int height, |
| 1591 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1591 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1592 | 1592 | { |
| 1593 | 1593 | const float x = av_clipf(vec[0] / (1.f - vec[1]), -1.f, 1.f) * s->input_mirror_modifier[0]; |
| 1594 | 1594 | const float y = av_clipf(vec[2] / (1.f - vec[1]), -1.f, 1.f) * s->input_mirror_modifier[1]; |
| @@ -1625,7 +1625,7 @@ static void xyz_to_stereographic(const V360Context *s, · 30 unmodified lines |
| 1625 | 1625 | */ |
| 1626 | 1626 | static void xyz_to_equirect(const V360Context *s, |
| 1627 | 1627 | const float *vec, int width, int height, |
| 1628 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1628 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1629 | 1629 | { |
| 1630 | 1630 | const float phi = atan2f(vec[0], -vec[2]) * s->input_mirror_modifier[0]; |
| 1631 | 1631 | const float theta = asinf(-vec[1]) * s->input_mirror_modifier[1]; |
| @@ -1662,7 +1662,7 @@ static void xyz_to_equirect(const V360Context *s, · 30 unmodified lines |
| 1662 | 1662 | */ |
| 1663 | 1663 | static void xyz_to_mercator(const V360Context *s, |
| 1664 | 1664 | const float *vec, int width, int height, |
| 1665 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1665 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1666 | 1666 | { |
| 1667 | 1667 | const float phi = atan2f(vec[0], -vec[2]) * s->input_mirror_modifier[0]; |
| 1668 | 1668 | const float theta = -vec[1] * s->input_mirror_modifier[1]; |
| @@ -1727,7 +1727,7 @@ static void mercator_to_xyz(const V360Context *s, · 58 unmodified lines |
| 1727 | 1727 | */ |
| 1728 | 1728 | static void xyz_to_ball(const V360Context *s, |
| 1729 | 1729 | const float *vec, int width, int height, |
| 1730 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1730 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1731 | 1731 | { |
| 1732 | 1732 | const float l = hypotf(vec[0], vec[1]); |
| 1733 | 1733 | const float r = sqrtf(1.f + vec[2]) / M_SQRT2; |
| @@ -1833,7 +1833,7 @@ static void hammer_to_xyz(const V360Context *s, · 99 unmodified lines |
| 1833 | 1833 | */ |
| 1834 | 1834 | static void xyz_to_hammer(const V360Context *s, |
| 1835 | 1835 | const float *vec, int width, int height, |
| 1836 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1836 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1837 | 1837 | { |
| 1838 | 1838 | const float theta = atan2f(vec[0], -vec[2]) * s->input_mirror_modifier[0]; |
| 1839 | 1839 | |
| @@ -1902,7 +1902,7 @@ static void sinusoidal_to_xyz(const V360Context *s, · 62 unmodified lines |
| 1902 | 1902 | */ |
| 1903 | 1903 | static void xyz_to_sinusoidal(const V360Context *s, |
| 1904 | 1904 | const float *vec, int width, int height, |
| 1905 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 1905 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 1906 | 1906 | { |
| 1907 | 1907 | const float theta = asinf(-vec[1]) * s->input_mirror_modifier[1]; |
| 1908 | 1908 | const float phi = atan2f(vec[0], -vec[2]) * s->input_mirror_modifier[0] * cosf(theta); |
| @@ -2128,7 +2128,7 @@ static void eac_to_xyz(const V360Context *s, · 219 unmodified lines |
| 2128 | 2128 | */ |
| 2129 | 2129 | static void xyz_to_eac(const V360Context *s, |
| 2130 | 2130 | const float *vec, int width, int height, |
| 2131 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 2131 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 2132 | 2132 | { |
| 2133 | 2133 | const float pixel_pad = 2; |
| 2134 | 2134 | const float u_pad = pixel_pad / width; |
| @@ -2436,7 +2436,7 @@ static void dfisheye_to_xyz(const V360Context *s, · 301 unmodified lines |
| 2436 | 2436 | */ |
| 2437 | 2437 | static void xyz_to_dfisheye(const V360Context *s, |
| 2438 | 2438 | const float *vec, int width, int height, |
| 2439 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 2439 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 2440 | 2440 | { |
| 2441 | 2441 | const float scale = 1.f - s->in_pad; |
| 2442 | 2442 | |
| @@ -2558,7 +2558,7 @@ static void barrel_to_xyz(const V360Context *s, · 115 unmodified lines |
| 2558 | 2558 | */ |
| 2559 | 2559 | static void xyz_to_barrel(const V360Context *s, |
| 2560 | 2560 | const float *vec, int width, int height, |
| 2561 | | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) |
| 2561 | + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) |
| 2562 | 2562 | { |
| 2563 | 2563 | const float scale = 0.99f; |
| 2564 | 2564 | |
| @@ -2757,8 +2757,8 @@ static av_always_inline int v360_slice(AVFilterContext *ctx, void *arg, int jobn · 192 unmodified lines |
| 2757 | 2757 | |
| 2758 | 2758 | for (int j = slice_start; j < slice_end; j++) { |
| 2759 | 2759 | for (int i = 0; i < width; i++) { |
| 2760 | | − uint16_t *u = s->u[p] + (j * uv_linesize + i) * s->elements; |
| 2761 | | − uint16_t *v = s->v[p] + (j * uv_linesize + i) * s->elements; |
| 2760 | + int16_t *u = s->u[p] + (j * uv_linesize + i) * s->elements; |
| 2761 | + int16_t *v = s->v[p] + (j * uv_linesize + i) * s->elements; |
| 2762 | 2762 | int16_t *ker = s->ker[p] + (j * uv_linesize + i) * s->elements; |
| 2763 | 2763 | |
| 2764 | 2764 | if (s->out_transpose) |
| @@ -2807,43 +2807,43 @@ static int config_output(AVFilterLink *outlink) · 42 unmodified lines |
| 2807 | 2807 | s->calculate_kernel = nearest_kernel; |
| 2808 | 2808 | s->remap_slice = depth <= 8 ? remap1_8bit_slice : remap1_16bit_slice; |
| 2809 | 2809 | s->elements = 1; |
| 2810 | | − sizeof_uv = sizeof(uint16_t) * s->elements; |
| 2810 | + sizeof_uv = sizeof(int16_t) * s->elements; |
| 2811 | 2811 | sizeof_ker = 0; |
| 2812 | 2812 | break; |
| 2813 | 2813 | case BILINEAR: |
| 2814 | 2814 | s->calculate_kernel = bilinear_kernel; |
| 2815 | 2815 | s->remap_slice = depth <= 8 ? remap2_8bit_slice : remap2_16bit_slice; |
| 2816 | 2816 | s->elements = 2 * 2; |
| 2817 | | − sizeof_uv = sizeof(uint16_t) * s->elements; |
| 2818 | | − sizeof_ker = sizeof(uint16_t) * s->elements; |
| 2817 | + sizeof_uv = sizeof(int16_t) * s->elements; |
| 2818 | + sizeof_ker = sizeof(int16_t) * s->elements; |
| 2819 | 2819 | break; |
| 2820 | 2820 | case BICUBIC: |
| 2821 | 2821 | s->calculate_kernel = bicubic_kernel; |
| 2822 | 2822 | s->remap_slice = depth <= 8 ? remap4_8bit_slice : remap4_16bit_slice; |
| 2823 | 2823 | s->elements = 4 * 4; |
| 2824 | | − sizeof_uv = sizeof(uint16_t) * s->elements; |
| 2825 | | − sizeof_ker = sizeof(uint16_t) * s->elements; |
| 2824 | + sizeof_uv = sizeof(int16_t) * s->elements; |
| 2825 | + sizeof_ker = sizeof(int16_t) * s->elements; |
| 2826 | 2826 | break; |
| 2827 | 2827 | case LANCZOS: |
| 2828 | 2828 | s->calculate_kernel = lanczos_kernel; |
| 2829 | 2829 | s->remap_slice = depth <= 8 ? remap4_8bit_slice : remap4_16bit_slice; |
| 2830 | 2830 | s->elements = 4 * 4; |
| 2831 | | − sizeof_uv = sizeof(uint16_t) * s->elements; |
| 2832 | | − sizeof_ker = sizeof(uint16_t) * s->elements; |
| 2831 | + sizeof_uv = sizeof(int16_t) * s->elements; |
| 2832 | + sizeof_ker = sizeof(int16_t) * s->elements; |
| 2833 | 2833 | break; |
| 2834 | 2834 | case SPLINE16: |
| 2835 | 2835 | s->calculate_kernel = spline16_kernel; |
| 2836 | 2836 | s->remap_slice = depth <= 8 ? remap4_8bit_slice : remap4_16bit_slice; |
| 2837 | 2837 | s->elements = 4 * 4; |
| 2838 | | − sizeof_uv = sizeof(uint16_t) * s->elements; |
| 2839 | | − sizeof_ker = sizeof(uint16_t) * s->elements; |
| 2838 | + sizeof_uv = sizeof(int16_t) * s->elements; |
| 2839 | + sizeof_ker = sizeof(int16_t) * s->elements; |
| 2840 | 2840 | break; |
| 2841 | 2841 | case GAUSSIAN: |
| 2842 | 2842 | s->calculate_kernel = gaussian_kernel; |
| 2843 | 2843 | s->remap_slice = depth <= 8 ? remap4_8bit_slice : remap4_16bit_slice; |
| 2844 | 2844 | s->elements = 4 * 4; |
| 2845 | | − sizeof_uv = sizeof(uint16_t) * s->elements; |
| 2846 | | − sizeof_ker = sizeof(uint16_t) * s->elements; |
| 2845 | + sizeof_uv = sizeof(int16_t) * s->elements; |
| 2846 | + sizeof_ker = sizeof(int16_t) * s->elements; |
| 2847 | 2847 | break; |
| 2848 | 2848 | default: |
| 2849 | 2849 | av_assert0(0); |