History

avfilter/vf_v360: rename fb format to barrel

Paul B Mahol committed 7 years ago

Commit 30f44641 parent cae29822 files · +18 −15Browse files

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/vf_v360.c+17−15
@@ -48,7 +48,7 @@ enum Projections { · 47 unmodified lines
4848 EQUIANGULAR,
4949 FLAT,
5050 DUAL_FISHEYE,
51− FACEBOOK,
51+ BARREL,
5252 CUBEMAP_1_6,
5353 NB_PROJECTIONS,
5454 };
@@ -139,7 +139,8 @@ static const AVOption v360_options[] = { · 84 unmodified lines
139139 { "c6x1", "cubemap6x1", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_6_1}, 0, 0, FLAGS, "in" },
140140 { "eac", "equi-angular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIANGULAR}, 0, 0, FLAGS, "in" },
141141 { "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" },
143144 { "c1x6", "cubemap1x6", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_1_6}, 0, 0, FLAGS, "in" },
144145 { "output", "set output projection", OFFSET(out), AV_OPT_TYPE_INT, {.i64=CUBEMAP_3_2}, 0, NB_PROJECTIONS-1, FLAGS, "out" },
145146 { "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
147148 { "c6x1", "cubemap6x1", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_6_1}, 0, 0, FLAGS, "out" },
148149 { "eac", "equi-angular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIANGULAR}, 0, 0, FLAGS, "out" },
149150 { "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" },
151153 { "c1x6", "cubemap1x6", 0, AV_OPT_TYPE_CONST, {.i64=CUBEMAP_1_6}, 0, 0, FLAGS, "out" },
152154 { "interp", "set interpolation method", OFFSET(interp), AV_OPT_TYPE_INT, {.i64=BILINEAR}, 0, NB_INTERP_METHODS-1, FLAGS, "interp" },
153155 { "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
17591761 }
17601762
17611763 /**
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.
17631765 *
17641766 * @param s filter context
17651767 * @param i horizontal position on frame [0, height)
@@ -1768,9 +1770,9 @@ static void xyz_to_dfisheye(const V360Context *s, · 2 unmodified lines
17681770 * @param height frame height
17691771 * @param vec coordinates on sphere
17701772 */
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)
17741776 {
17751777 const float scale = 0.99f;
17761778 float l_x, l_y, l_z;
@@ -1834,7 +1836,7 @@ static void fb_to_xyz(const V360Context *s, · 57 unmodified lines
18341836 }
18351837
18361838 /**
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.
18381840 *
18391841 * @param s filter context
18401842 * @param vec coordinates on sphere
@@ -1845,9 +1847,9 @@ static void fb_to_xyz(const V360Context *s, · 4 unmodified lines
18451847 * @param du horizontal relative coordinate
18461848 * @param dv vertical relative coordinate
18471849 */
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)
18511853 {
18521854 const float scale = 0.99f;
18531855
@@ -2054,8 +2056,8 @@ static int config_output(AVFilterLink *outlink) · 200 unmodified lines
20542056 wf = inlink->w;
20552057 hf = inlink->h;
20562058 break;
2057− case FACEBOOK:
2058− in_transform = xyz_to_fb;
2059+ case BARREL:
2060+ in_transform = xyz_to_barrel;
20592061 err = 0;
20602062 wf = inlink->w / 5.f * 4.f;
20612063 hf = inlink->h;
@@ -2109,8 +2111,8 @@ static int config_output(AVFilterLink *outlink) · 47 unmodified lines
21092111 case DUAL_FISHEYE:
21102112 av_log(ctx, AV_LOG_ERROR, "Dual fisheye format is not accepted as output.\n");
21112113 return AVERROR(EINVAL);
2112− case FACEBOOK:
2113− out_transform = fb_to_xyz;
2114+ case BARREL:
2115+ out_transform = barrel_to_xyz;
21142116 err = 0;
21152117 w = roundf(wf / 4.f * 5.f);
21162118 h = roundf(hf);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t