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
a06d7035
Commit
a06d7035
authored
Sep 07, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_v360: support transposed input/output
parent
12b909ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
5 deletions
+26
-5
filters.texi
doc/filters.texi
+6
-0
v360.h
libavfilter/v360.h
+1
-0
vf_v360.c
libavfilter/vf_v360.c
+19
-5
No files found.
doc/filters.texi
View file @
a06d7035
...
...
@@ -18084,6 +18084,12 @@ Default value is @b{@samp{ypr}}.
@item d_flip
Flip the output video horizontally/vertically/in-depth. Boolean values.
@item in_trans
Set if input video is transposed. Boolean value, by default disabled.
@item out_trans
Set if output video needs to be transposed. Boolean value, by default disabled.
@end table
@subsection Examples
...
...
libavfilter/v360.h
View file @
a06d7035
...
...
@@ -99,6 +99,7 @@ typedef struct V360Context {
float
yaw
,
pitch
,
roll
;
int
h_flip
,
v_flip
,
d_flip
;
int
in_transpose
,
out_transpose
;
float
h_fov
,
v_fov
;
float
flat_range
[
3
];
...
...
libavfilter/vf_v360.c
View file @
a06d7035
...
...
@@ -93,9 +93,11 @@ static const AVOption v360_options[] = {
{
"rorder"
,
"rotation order"
,
OFFSET
(
rorder
),
AV_OPT_TYPE_STRING
,
{.
str
=
"ypr"
},
0
,
0
,
FLAGS
,
"rorder"
},
{
"h_fov"
,
"horizontal field of view"
,
OFFSET
(
h_fov
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
90
.
f
},
0
.
f
,
180
.
f
,
FLAGS
,
"h_fov"
},
{
"v_fov"
,
"vertical field of view"
,
OFFSET
(
v_fov
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
45
.
f
},
0
.
f
,
90
.
f
,
FLAGS
,
"v_fov"
},
{
"h_flip"
,
"flip video horizontally"
,
OFFSET
(
h_flip
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"h_flip"
},
{
"v_flip"
,
"flip video vertically"
,
OFFSET
(
v_flip
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"v_flip"
},
{
"d_flip"
,
"flip video indepth"
,
OFFSET
(
d_flip
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"d_flip"
},
{
"h_flip"
,
"flip out video horizontally"
,
OFFSET
(
h_flip
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"h_flip"
},
{
"v_flip"
,
"flip out video vertically"
,
OFFSET
(
v_flip
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"v_flip"
},
{
"d_flip"
,
"flip out video indepth"
,
OFFSET
(
d_flip
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"d_flip"
},
{
"in_trans"
,
"transpose video input"
,
OFFSET
(
in_transpose
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"in_transpose"
},
{
"out_trans"
,
"transpose video output"
,
OFFSET
(
out_transpose
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
,
"out_transpose"
},
{
NULL
}
};
...
...
@@ -2165,6 +2167,12 @@ static int config_output(AVFilterLink *outlink)
}
else
if
(
s
->
width
>
0
||
s
->
height
>
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Both width and height values should be specified.
\n
"
);
return
AVERROR
(
EINVAL
);
}
else
{
if
(
s
->
out_transpose
)
FFSWAP
(
int
,
w
,
h
);
if
(
s
->
in_transpose
)
FFSWAP
(
int
,
w
,
h
);
}
s
->
planeheight
[
1
]
=
s
->
planeheight
[
2
]
=
FF_CEIL_RSHIFT
(
h
,
desc
->
log2_chroma_h
);
...
...
@@ -2223,10 +2231,16 @@ static int config_output(AVFilterLink *outlink)
uint16_t
*
v
=
s
->
v
[
p
]
+
(
j
*
width
+
i
)
*
elements
;
int16_t
*
ker
=
s
->
ker
[
p
]
+
(
j
*
width
+
i
)
*
elements
;
out_transform
(
s
,
i
,
j
,
width
,
height
,
vec
);
if
(
s
->
out_transpose
)
out_transform
(
s
,
j
,
i
,
height
,
width
,
vec
);
else
out_transform
(
s
,
i
,
j
,
width
,
height
,
vec
);
rotate
(
rot_mat
,
vec
);
mirror
(
mirror_modifier
,
vec
);
in_transform
(
s
,
vec
,
in_width
,
in_height
,
r_tmp
.
u
,
r_tmp
.
v
,
&
du
,
&
dv
);
if
(
s
->
in_transpose
)
in_transform
(
s
,
vec
,
in_height
,
in_width
,
r_tmp
.
v
,
r_tmp
.
u
,
&
du
,
&
dv
);
else
in_transform
(
s
,
vec
,
in_width
,
in_height
,
r_tmp
.
u
,
r_tmp
.
v
,
&
du
,
&
dv
);
calculate_kernel
(
du
,
dv
,
&
r_tmp
,
u
,
v
,
ker
);
}
}
...
...
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