Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
15133c6a
Commit
15133c6a
authored
Jan 19, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_v360: replace rest of roundf() with lrintf()
parent
3bf28d40
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
+42
-42
vf_v360.c
libavfilter/vf_v360.c
+42
-42
No files found.
libavfilter/vf_v360.c
View file @
15133c6a
...
...
@@ -345,8 +345,8 @@ void ff_v360_init(V360Context *s, int depth)
static
void
nearest_kernel
(
float
du
,
float
dv
,
const
XYRemap
*
rmap
,
int16_t
*
u
,
int16_t
*
v
,
int16_t
*
ker
)
{
const
int
i
=
round
f
(
dv
)
+
1
;
const
int
j
=
round
f
(
du
)
+
1
;
const
int
i
=
lrint
f
(
dv
)
+
1
;
const
int
j
=
lrint
f
(
du
)
+
1
;
u
[
0
]
=
rmap
->
u
[
i
][
j
];
v
[
0
]
=
rmap
->
v
[
i
][
j
];
...
...
@@ -1277,8 +1277,8 @@ static void xyz_to_cube3x2(const V360Context *s,
new_ewi
=
ceilf
(
ew
*
(
u_face
+
1
))
-
u_shift
;
new_ehi
=
ceilf
(
eh
*
(
v_face
+
1
))
-
v_shift
;
new_ui
=
av_clip
(
round
f
(
0
.
5
f
*
new_ewi
*
(
uf
+
1
.
f
)),
0
,
new_ewi
-
1
);
new_vi
=
av_clip
(
round
f
(
0
.
5
f
*
new_ehi
*
(
vf
+
1
.
f
)),
0
,
new_ehi
-
1
);
new_ui
=
av_clip
(
lrint
f
(
0
.
5
f
*
new_ewi
*
(
uf
+
1
.
f
)),
0
,
new_ewi
-
1
);
new_vi
=
av_clip
(
lrint
f
(
0
.
5
f
*
new_ehi
*
(
vf
+
1
.
f
)),
0
,
new_ehi
-
1
);
}
us
[
i
+
1
][
j
+
1
]
=
u_shift
+
new_ui
;
...
...
@@ -1417,8 +1417,8 @@ static void xyz_to_cube1x6(const V360Context *s,
v_shift
=
ceilf
(
eh
*
face
);
new_ehi
=
ceilf
(
eh
*
(
face
+
1
))
-
v_shift
;
new_ui
=
av_clip
(
round
f
(
0
.
5
f
*
ewi
*
(
uf
+
1
.
f
)),
0
,
ewi
-
1
);
new_vi
=
av_clip
(
round
f
(
0
.
5
f
*
new_ehi
*
(
vf
+
1
.
f
)),
0
,
new_ehi
-
1
);
new_ui
=
av_clip
(
lrint
f
(
0
.
5
f
*
ewi
*
(
uf
+
1
.
f
)),
0
,
ewi
-
1
);
new_vi
=
av_clip
(
lrint
f
(
0
.
5
f
*
new_ehi
*
(
vf
+
1
.
f
)),
0
,
new_ehi
-
1
);
}
us
[
i
+
1
][
j
+
1
]
=
new_ui
;
...
...
@@ -1495,8 +1495,8 @@ static void xyz_to_cube6x1(const V360Context *s,
u_shift
=
ceilf
(
ew
*
face
);
new_ewi
=
ceilf
(
ew
*
(
face
+
1
))
-
u_shift
;
new_ui
=
av_clip
(
round
f
(
0
.
5
f
*
new_ewi
*
(
uf
+
1
.
f
)),
0
,
new_ewi
-
1
);
new_vi
=
av_clip
(
round
f
(
0
.
5
f
*
ehi
*
(
vf
+
1
.
f
)),
0
,
ehi
-
1
);
new_ui
=
av_clip
(
lrint
f
(
0
.
5
f
*
new_ewi
*
(
uf
+
1
.
f
)),
0
,
new_ewi
-
1
);
new_vi
=
av_clip
(
lrint
f
(
0
.
5
f
*
ehi
*
(
vf
+
1
.
f
)),
0
,
ehi
-
1
);
}
us
[
i
+
1
][
j
+
1
]
=
u_shift
+
new_ui
;
...
...
@@ -2995,104 +2995,104 @@ static int config_output(AVFilterLink *outlink)
case
EQUIRECTANGULAR
:
s
->
out_transform
=
equirect_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
);
break
;
case
CUBEMAP_3_2
:
s
->
out_transform
=
cube3x2_to_xyz
;
prepare_out
=
prepare_cube_out
;
w
=
round
f
(
wf
/
4
.
f
*
3
.
f
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
/
4
.
f
*
3
.
f
);
h
=
lrint
f
(
hf
);
break
;
case
CUBEMAP_1_6
:
s
->
out_transform
=
cube1x6_to_xyz
;
prepare_out
=
prepare_cube_out
;
w
=
round
f
(
wf
/
4
.
f
);
h
=
round
f
(
hf
*
3
.
f
);
w
=
lrint
f
(
wf
/
4
.
f
);
h
=
lrint
f
(
hf
*
3
.
f
);
break
;
case
CUBEMAP_6_1
:
s
->
out_transform
=
cube6x1_to_xyz
;
prepare_out
=
prepare_cube_out
;
w
=
round
f
(
wf
/
2
.
f
*
3
.
f
);
h
=
round
f
(
hf
/
2
.
f
);
w
=
lrint
f
(
wf
/
2
.
f
*
3
.
f
);
h
=
lrint
f
(
hf
/
2
.
f
);
break
;
case
EQUIANGULAR
:
s
->
out_transform
=
eac_to_xyz
;
prepare_out
=
prepare_eac_out
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
/
8
.
f
*
9
.
f
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
/
8
.
f
*
9
.
f
);
break
;
case
FLAT
:
s
->
out_transform
=
flat_to_xyz
;
prepare_out
=
prepare_flat_out
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
);
break
;
case
DUAL_FISHEYE
:
s
->
out_transform
=
dfisheye_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
);
break
;
case
BARREL
:
s
->
out_transform
=
barrel_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
/
4
.
f
*
5
.
f
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
/
4
.
f
*
5
.
f
);
h
=
lrint
f
(
hf
);
break
;
case
STEREOGRAPHIC
:
s
->
out_transform
=
stereographic_to_xyz
;
prepare_out
=
prepare_stereographic_out
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
*
2
.
f
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
*
2
.
f
);
break
;
case
MERCATOR
:
s
->
out_transform
=
mercator_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
*
2
.
f
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
*
2
.
f
);
break
;
case
BALL
:
s
->
out_transform
=
ball_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
*
2
.
f
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
*
2
.
f
);
break
;
case
HAMMER
:
s
->
out_transform
=
hammer_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
);
break
;
case
SINUSOIDAL
:
s
->
out_transform
=
sinusoidal_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
);
break
;
case
FISHEYE
:
s
->
out_transform
=
fisheye_to_xyz
;
prepare_out
=
prepare_fisheye_out
;
w
=
round
f
(
wf
*
0
.
5
f
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
*
0
.
5
f
);
h
=
lrint
f
(
hf
);
break
;
case
PANNINI
:
s
->
out_transform
=
pannini_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
);
break
;
case
CYLINDRICAL
:
s
->
out_transform
=
cylindrical_to_xyz
;
prepare_out
=
prepare_cylindrical_out
;
w
=
round
f
(
wf
);
h
=
round
f
(
hf
*
0
.
5
f
);
w
=
lrint
f
(
wf
);
h
=
lrint
f
(
hf
*
0
.
5
f
);
break
;
case
PERSPECTIVE
:
s
->
out_transform
=
perspective_to_xyz
;
prepare_out
=
NULL
;
w
=
round
f
(
wf
/
2
.
f
);
h
=
round
f
(
hf
);
w
=
lrint
f
(
wf
/
2
.
f
);
h
=
lrint
f
(
hf
);
break
;
default
:
av_log
(
ctx
,
AV_LOG_ERROR
,
"Specified output format is not handled.
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment