Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
23cd7b25
Commit
23cd7b25
authored
Feb 08, 2014
by
Ron Wright
Committed by
Jean-Baptiste Kempf
Feb 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glspectrum: use FFT Windowing
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
cf024724
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
modules/visualization/Modules.am
modules/visualization/Modules.am
+2
-1
modules/visualization/glspectrum.c
modules/visualization/glspectrum.c
+15
-0
No files found.
modules/visualization/Modules.am
View file @
23cd7b25
...
...
@@ -17,4 +17,5 @@ visualization_LTLIBRARIES += libvisual_plugin.la
SOURCES_vsxu = vsxu.cpp cyclic_buffer.h
SOURCES_glspectrum = glspectrum.c visual/fft.c visual/fft.h
SOURCES_glspectrum = glspectrum.c visual/fft.c visual/fft.h \
visual/window.c visual/window.h visual/window_presets.h
modules/visualization/glspectrum.c
View file @
23cd7b25
...
...
@@ -40,6 +40,7 @@
#include <math.h>
#include "visual/fft.h"
#include "visual/window.h"
/*****************************************************************************
...
...
@@ -94,6 +95,9 @@ struct filter_sys_t
/* Window size */
int
i_width
;
int
i_height
;
/* FFT window parameters */
window_param
wind_param
;
};
...
...
@@ -135,6 +139,9 @@ static int Open(vlc_object_t * p_this)
p_sys
->
f_rotationAngle
=
0
;
p_sys
->
f_rotationIncrement
=
ROTATION_INCREMENT
;
/* Fetch the FFT window parameters */
window_get_param
(
VLC_OBJECT
(
p_filter
),
&
p_sys
->
wind_param
);
/* Create the FIFO for the audio data. */
p_sys
->
fifo
=
block_FifoNew
();
if
(
p_sys
->
fifo
==
NULL
)
...
...
@@ -425,6 +432,7 @@ static void *Thread( void *p_data )
36
,
47
,
62
,
82
,
107
,
141
,
184
,
255
};
fft_state
*
p_state
=
NULL
;
/* internal FFT data */
DEFINE_WIND_CONTEXT
(
wind_ctx
);
/* internal window data */
unsigned
i
,
j
;
float
p_output
[
FFT_BUFFER_SIZE
];
/* Raw FFT Result */
...
...
@@ -471,6 +479,11 @@ static void *Thread( void *p_data )
msg_Err
(
p_filter
,
"unable to initialize FFT transform"
);
goto
release
;
}
if
(
!
window_init
(
FFT_BUFFER_SIZE
,
&
p_sys
->
wind_param
,
&
wind_ctx
))
{
msg_Err
(
p_filter
,
"unable to initialize FFT window"
);
goto
release
;
}
p_buffs
=
p_s16_buff
;
for
(
i
=
0
;
i
<
FFT_BUFFER_SIZE
;
i
++
)
{
...
...
@@ -481,6 +494,7 @@ static void *Thread( void *p_data )
if
(
p_buffs
>=
&
p_s16_buff
[
block
->
i_nb_samples
*
p_sys
->
i_channels
])
p_buffs
=
p_s16_buff
;
}
window_scale_in_place
(
p_buffer1
,
&
wind_ctx
);
fft_perform
(
p_buffer1
,
p_output
,
p_state
);
for
(
i
=
0
;
i
<
FFT_BUFFER_SIZE
;
++
i
)
...
...
@@ -532,6 +546,7 @@ static void *Thread( void *p_data )
}
release:
window_close
(
&
wind_ctx
);
fft_close
(
p_state
);
block_Release
(
block
);
vlc_restorecancel
(
canc
);
...
...
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