Showing the changes to libavfilter (1 of 2 files). Show all
Unified · Split
| @@ -48,7 +48,7 @@ enum Projections { · 47 unmodified lines | ||
| 48 | 48 | EQUIANGULAR, |
| 49 | 49 | FLAT, |
| 50 | 50 | DUAL_FISHEYE, |
| 51 | − FACEBOOK, | |
| 51 | + BARREL, | |
| 52 | 52 | CUBEMAP_1_6, |
| 53 | 53 | NB_PROJECTIONS, |
| 54 | 54 | }; |
| @@ -139,7 +139,8 @@ static const AVOption v360_options[] = { · 84 unmodified lines | ||
| 139 | 139 | { "c6x1", "cubemap6x1", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_6_1}, 0, 0, FLAGS, "in" }, |
| 140 | 140 | { "eac", "equi-angular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIANGULAR}, 0, 0, FLAGS, "in" }, |
| 141 | 141 | { "dfisheye", "dual fisheye", 0, AV_OPT_TYPE_CONST, {.i64=DUAL_FISHEYE}, 0, 0, FLAGS, "in" }, |
| 142 | − { "fb", "facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64=FACEBOOK}, 0, 0, FLAGS, "in" }, | |
| 142 | + { "barrel", "barrel facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64=BARREL}, 0, 0, FLAGS, "in" }, | |
| 143 | + { "fb", "barrel facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64=BARREL}, 0, 0, FLAGS, "in" }, | |
| 143 | 144 | { "c1x6", "cubemap1x6", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_1_6}, 0, 0, FLAGS, "in" }, |
| 144 | 145 | { "output", "set output projection", OFFSET(out), AV_OPT_TYPE_INT, {.i64=CUBEMAP_3_2}, 0, NB_PROJECTIONS-1, FLAGS, "out" }, |
| 145 | 146 | { "e", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIRECTANGULAR}, 0, 0, FLAGS, "out" }, |
| @@ -147,7 +148,8 @@ static const AVOption v360_options[] = { · 1 unmodified line | ||
| 147 | 148 | { "c6x1", "cubemap6x1", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_6_1}, 0, 0, FLAGS, "out" }, |
| 148 | 149 | { "eac", "equi-angular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIANGULAR}, 0, 0, FLAGS, "out" }, |
| 149 | 150 | { "flat", "regular video", 0, AV_OPT_TYPE_CONST, {.i64=FLAT}, 0, 0, FLAGS, "out" }, |
| 150 | − { "fb", "facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64=FACEBOOK}, 0, 0, FLAGS, "out" }, | |
| 151 | + { "barrel", "barrel facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64=BARREL}, 0, 0, FLAGS, "out" }, | |
| 152 | + { "fb", "barrel facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64=BARREL}, 0, 0, FLAGS, "out" }, | |
| 151 | 153 | { "c1x6", "cubemap1x6", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_1_6}, 0, 0, FLAGS, "out" }, |
| 152 | 154 | { "interp", "set interpolation method", OFFSET(interp), AV_OPT_TYPE_INT, {.i64=BILINEAR}, 0, NB_INTERP_METHODS-1, FLAGS, "interp" }, |
| 153 | 155 | { "near", "nearest neighbour", 0, AV_OPT_TYPE_CONST, {.i64=NEAREST}, 0, 0, FLAGS, "interp" }, |
| @@ -1759,7 +1761,7 @@ static void xyz_to_dfisheye(const V360Context *s, · 1605 unmodified lines | ||
| 1759 | 1761 | } |
| 1760 | 1762 | |
| 1761 | 1763 | /** |
| 1762 | − * Calculate 3D coordinates on sphere for corresponding frame position in facebook's format. | |
| 1764 | + * Calculate 3D coordinates on sphere for corresponding frame position in barrel facebook's format. | |
| 1763 | 1765 | * |
| 1764 | 1766 | * @param s filter context |
| 1765 | 1767 | * @param i horizontal position on frame [0, height) |
| @@ -1768,9 +1770,9 @@ static void xyz_to_dfisheye(const V360Context *s, · 2 unmodified lines | ||
| 1768 | 1770 | * @param height frame height |
| 1769 | 1771 | * @param vec coordinates on sphere |
| 1770 | 1772 | */ |
| 1771 | −static void fb_to_xyz(const V360Context *s, | |
| 1772 | − int i, int j, int width, int height, | |
| 1773 | − float *vec) | |
| 1773 | +static void barrel_to_xyz(const V360Context *s, | |
| 1774 | + int i, int j, int width, int height, | |
| 1775 | + float *vec) | |
| 1774 | 1776 | { |
| 1775 | 1777 | const float scale = 0.99f; |
| 1776 | 1778 | float l_x, l_y, l_z; |
| @@ -1834,7 +1836,7 @@ static void fb_to_xyz(const V360Context *s, · 57 unmodified lines | ||
| 1834 | 1836 | } |
| 1835 | 1837 | |
| 1836 | 1838 | /** |
| 1837 | − * Calculate frame position in facebook's format for corresponding 3D coordinates on sphere. | |
| 1839 | + * Calculate frame position in barrel facebook's format for corresponding 3D coordinates on sphere. | |
| 1838 | 1840 | * |
| 1839 | 1841 | * @param s filter context |
| 1840 | 1842 | * @param vec coordinates on sphere |
| @@ -1845,9 +1847,9 @@ static void fb_to_xyz(const V360Context *s, · 4 unmodified lines | ||
| 1845 | 1847 | * @param du horizontal relative coordinate |
| 1846 | 1848 | * @param dv vertical relative coordinate |
| 1847 | 1849 | */ |
| 1848 | −static void xyz_to_fb(const V360Context *s, | |
| 1849 | − const float *vec, int width, int height, | |
| 1850 | − uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) | |
| 1850 | +static void xyz_to_barrel(const V360Context *s, | |
| 1851 | + const float *vec, int width, int height, | |
| 1852 | + uint16_t us[4][4], uint16_t vs[4][4], float *du, float *dv) | |
| 1851 | 1853 | { |
| 1852 | 1854 | const float scale = 0.99f; |
| 1853 | 1855 | |
| @@ -2054,8 +2056,8 @@ static int config_output(AVFilterLink *outlink) · 200 unmodified lines | ||
| 2054 | 2056 | wf = inlink->w; |
| 2055 | 2057 | hf = inlink->h; |
| 2056 | 2058 | break; |
| 2057 | − case FACEBOOK: | |
| 2058 | − in_transform = xyz_to_fb; | |
| 2059 | + case BARREL: | |
| 2060 | + in_transform = xyz_to_barrel; | |
| 2059 | 2061 | err = 0; |
| 2060 | 2062 | wf = inlink->w / 5.f * 4.f; |
| 2061 | 2063 | hf = inlink->h; |
| @@ -2109,8 +2111,8 @@ static int config_output(AVFilterLink *outlink) · 47 unmodified lines | ||
| 2109 | 2111 | case DUAL_FISHEYE: |
| 2110 | 2112 | av_log(ctx, AV_LOG_ERROR, "Dual fisheye format is not accepted as output.\n"); |
| 2111 | 2113 | return AVERROR(EINVAL); |
| 2112 | − case FACEBOOK: | |
| 2113 | − out_transform = fb_to_xyz; | |
| 2114 | + case BARREL: | |
| 2115 | + out_transform = barrel_to_xyz; | |
| 2114 | 2116 | err = 0; |
| 2115 | 2117 | w = roundf(wf / 4.f * 5.f); |
| 2116 | 2118 | h = roundf(hf); |