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
d6951e59
Commit
d6951e59
authored
Dec 20, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_sofalizer: add framesize option
parent
d06aae73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
filters.texi
doc/filters.texi
+5
-0
af_sofalizer.c
libavfilter/af_sofalizer.c
+4
-2
No files found.
doc/filters.texi
View file @
d6951e59
...
...
@@ -4506,6 +4506,11 @@ Descriptions with unrecognised channel names are ignored.
@item lfegain
Set custom gain for LFE channels. Value is in dB. Default is 0.
@item framesize
Set custom frame size in number of samples. Default is 1024.
Allowed range is from 1024 to 96000. Only used if option @samp{type}
is set to @var{freq}.
@end table
@subsection Examples
...
...
libavfilter/af_sofalizer.c
View file @
d6951e59
...
...
@@ -92,6 +92,7 @@ typedef struct SOFAlizerContext {
float
elevation
;
/* elevation of virtual loudspeakers (in deg.) */
float
radius
;
/* distance virtual loudspeakers to listener (in metres) */
int
type
;
/* processing type */
int
framesize
;
/* size of buffer */
VirtualSpeaker
vspkrpos
[
64
];
...
...
@@ -662,7 +663,7 @@ static int load_data(AVFilterContext *ctx, int azim, int elev, float radius, int
/* buffer length is longest IR plus max. delay -> next power of 2
(32 - count leading zeros gives required exponent) */
s
->
buffer_length
=
1
<<
(
32
-
ff_clz
(
n_max
));
s
->
n_fft
=
n_fft
=
1
<<
(
32
-
ff_clz
(
n_max
+
s
ample_rat
e
));
s
->
n_fft
=
n_fft
=
1
<<
(
32
-
ff_clz
(
n_max
+
s
->
framesiz
e
));
if
(
s
->
type
==
FREQUENCY_DOMAIN
)
{
av_fft_end
(
s
->
fft
[
0
]);
...
...
@@ -823,7 +824,7 @@ static int config_input(AVFilterLink *inlink)
if
(
s
->
type
==
FREQUENCY_DOMAIN
)
{
inlink
->
partial_buf_size
=
inlink
->
min_samples
=
inlink
->
max_samples
=
inlink
->
sample_rat
e
;
inlink
->
max_samples
=
s
->
framesiz
e
;
}
/* gain -3 dB per channel, -6 dB to get LFE on a similar level */
...
...
@@ -881,6 +882,7 @@ static const AVOption sofalizer_options[] = {
{
"freq"
,
"frequency domain"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
.
flags
=
FLAGS
,
"type"
},
{
"speakers"
,
"set speaker custom positions"
,
OFFSET
(
speakers_pos
),
AV_OPT_TYPE_STRING
,
{.
str
=
0
},
0
,
0
,
.
flags
=
FLAGS
},
{
"lfegain"
,
"set lfe gain"
,
OFFSET
(
lfe_gain
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
9
,
9
,
.
flags
=
FLAGS
},
{
"framesize"
,
"set frame size"
,
OFFSET
(
framesize
),
AV_OPT_TYPE_INT
,
{.
i64
=
1024
},
1024
,
96000
,
.
flags
=
FLAGS
},
{
NULL
}
};
...
...
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