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
4e17efd8
Commit
4e17efd8
authored
Jan 18, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_showfreqs/showspectrum: rename skip_samples to hop_size
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
0f88b3f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
avf_showfreqs.c
libavfilter/avf_showfreqs.c
+5
-5
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+5
-5
No files found.
libavfilter/avf_showfreqs.c
View file @
4e17efd8
...
@@ -53,7 +53,7 @@ typedef struct ShowFreqsContext {
...
@@ -53,7 +53,7 @@ typedef struct ShowFreqsContext {
float
**
avg_data
;
float
**
avg_data
;
float
*
window_func_lut
;
float
*
window_func_lut
;
float
overlap
;
float
overlap
;
int
skip_samples
;
int
hop_size
;
int
nb_channels
;
int
nb_channels
;
int
nb_freq
;
int
nb_freq
;
int
win_size
;
int
win_size
;
...
@@ -205,8 +205,8 @@ static int config_output(AVFilterLink *outlink)
...
@@ -205,8 +205,8 @@ static int config_output(AVFilterLink *outlink)
ff_generate_window_func
(
s
->
window_func_lut
,
s
->
win_size
,
s
->
win_func
,
&
overlap
);
ff_generate_window_func
(
s
->
window_func_lut
,
s
->
win_size
,
s
->
win_func
,
&
overlap
);
if
(
s
->
overlap
==
1
.)
if
(
s
->
overlap
==
1
.)
s
->
overlap
=
overlap
;
s
->
overlap
=
overlap
;
s
->
skip_samples
=
(
1
.
-
s
->
overlap
)
*
s
->
win_size
;
s
->
hop_size
=
(
1
.
-
s
->
overlap
)
*
s
->
win_size
;
if
(
s
->
skip_samples
<
1
)
{
if
(
s
->
hop_size
<
1
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"overlap %f too big
\n
"
,
s
->
overlap
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"overlap %f too big
\n
"
,
s
->
overlap
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
...
@@ -434,14 +434,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -434,14 +434,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
}
fin
->
pts
=
s
->
pts
;
fin
->
pts
=
s
->
pts
;
s
->
pts
+=
s
->
skip_samples
;
s
->
pts
+=
s
->
hop_size
;
ret
=
av_audio_fifo_peek
(
s
->
fifo
,
(
void
**
)
fin
->
extended_data
,
s
->
win_size
);
ret
=
av_audio_fifo_peek
(
s
->
fifo
,
(
void
**
)
fin
->
extended_data
,
s
->
win_size
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
fail
;
goto
fail
;
ret
=
plot_freqs
(
inlink
,
fin
);
ret
=
plot_freqs
(
inlink
,
fin
);
av_frame_free
(
&
fin
);
av_frame_free
(
&
fin
);
av_audio_fifo_drain
(
s
->
fifo
,
s
->
skip_samples
);
av_audio_fifo_drain
(
s
->
fifo
,
s
->
hop_size
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
fail
;
goto
fail
;
}
}
...
...
libavfilter/avf_showspectrum.c
View file @
4e17efd8
...
@@ -74,7 +74,7 @@ typedef struct {
...
@@ -74,7 +74,7 @@ typedef struct {
double
win_scale
;
double
win_scale
;
float
overlap
;
float
overlap
;
float
gain
;
float
gain
;
int
skip_samples
;
int
hop_size
;
float
*
combine_buffer
;
///< color combining buffer (3 * h items)
float
*
combine_buffer
;
///< color combining buffer (3 * h items)
AVAudioFifo
*
fifo
;
AVAudioFifo
*
fifo
;
int64_t
pts
;
int64_t
pts
;
...
@@ -367,8 +367,8 @@ static int config_output(AVFilterLink *outlink)
...
@@ -367,8 +367,8 @@ static int config_output(AVFilterLink *outlink)
ff_generate_window_func
(
s
->
window_func_lut
,
s
->
win_size
,
s
->
win_func
,
&
overlap
);
ff_generate_window_func
(
s
->
window_func_lut
,
s
->
win_size
,
s
->
win_func
,
&
overlap
);
if
(
s
->
overlap
==
1
)
if
(
s
->
overlap
==
1
)
s
->
overlap
=
overlap
;
s
->
overlap
=
overlap
;
s
->
skip_samples
=
(
1
.
-
s
->
overlap
)
*
s
->
win_size
;
s
->
hop_size
=
(
1
.
-
s
->
overlap
)
*
s
->
win_size
;
if
(
s
->
skip_samples
<
1
)
{
if
(
s
->
hop_size
<
1
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"overlap %f too big
\n
"
,
s
->
overlap
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"overlap %f too big
\n
"
,
s
->
overlap
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
...
@@ -805,7 +805,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
...
@@ -805,7 +805,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
}
}
fin
->
pts
=
s
->
pts
;
fin
->
pts
=
s
->
pts
;
s
->
pts
+=
s
->
skip_samples
;
s
->
pts
+=
s
->
hop_size
;
ret
=
av_audio_fifo_peek
(
s
->
fifo
,
(
void
**
)
fin
->
extended_data
,
s
->
win_size
);
ret
=
av_audio_fifo_peek
(
s
->
fifo
,
(
void
**
)
fin
->
extended_data
,
s
->
win_size
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
fail
;
goto
fail
;
...
@@ -820,7 +820,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
...
@@ -820,7 +820,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
ret
=
plot_spectrum_column
(
inlink
,
fin
);
ret
=
plot_spectrum_column
(
inlink
,
fin
);
av_frame_free
(
&
fin
);
av_frame_free
(
&
fin
);
av_audio_fifo_drain
(
s
->
fifo
,
s
->
skip_samples
);
av_audio_fifo_drain
(
s
->
fifo
,
s
->
hop_size
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
fail
;
goto
fail
;
}
}
...
...
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