Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
524254f8
Commit
524254f8
authored
Oct 20, 2005
by
Scott Caudle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates spectrometer visualization. some optimization tweaks and additional features.
parent
46d8d47a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
30 deletions
+15
-30
modules/visualization/visual/effects.c
modules/visualization/visual/effects.c
+5
-22
modules/visualization/visual/visual.c
modules/visualization/visual/visual.c
+10
-8
No files found.
modules/visualization/visual/effects.c
View file @
524254f8
...
...
@@ -396,11 +396,6 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
}
p_buffs
=
p_s16_buff
;
//i_nb_bands = config_GetInt ( p_aout, "visual-nbbands" );
//i_separ = config_GetInt( p_aout, "visual-separ" );
//i_amp = config_GetInt ( p_aout, "visual-amp" );
//i_peak = config_GetInt ( p_aout, "visual-peaks" );
/* previous 4 vars changed.. using them as `spect' variables */
i_original
=
config_GetInt
(
p_aout
,
"spect-show-original"
);
i_nb_bands
=
config_GetInt
(
p_aout
,
"spect-nbbands"
);
i_separ
=
config_GetInt
(
p_aout
,
"spect-separ"
);
...
...
@@ -420,12 +415,10 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
}
else
{
i_nb_bands
=
80
;
if
(
i_nb_bands
>
80
)
i_nb_bands
=
80
;
xscale
=
xscale2
;
}
i_nb_bands
*=
i_sections
;
/* whoops, dont malloc the following memory for all the duplicated bands..
-only the original 20 or 80 will be fine */
if
(
!
p_effect
->
p_data
)
{
...
...
@@ -446,13 +439,13 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
peaks
=
(
int
*
)
p_effect
->
p_data
;
}
height
=
(
int
*
)
malloc
(
i_nb_bands
*
sizeof
(
int
)
);
if
(
!
height
)
{
msg_Err
(
p_aout
,
"Out of memory"
);
return
-
1
;
}
/* Convert the buffer to int16_t */
/* Pasted from float32tos16.c */
for
(
i
=
p_buffer
->
i_nb_samples
*
p_effect
->
i_nb_chans
;
i
--
;
)
...
...
@@ -482,6 +475,8 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
for
(
i
=
0
;
i
<
FFT_BUFFER_SIZE
;
i
++
)
p_dest
[
i
]
=
(
(
int
)
sqrt
(
p_output
[
i
+
1
]
)
)
>>
8
;
i_nb_bands
*=
i_sections
;
for
(
i
=
0
;
i
<
i_nb_bands
/
i_sections
;
i
++
)
{
/* We search the maximum on one scale */
...
...
@@ -660,24 +655,20 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
y
/=
2
;
*
(
p_picture
->
p
[
1
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
1
].
i_pitch
-
p_picture
->
p
[
1
].
i_pitch
)
=
0
;
/* U(R,G,B); */
if
(
0x04
*
(
i_line
+
k
)
-
0x0f
>
0
)
{
if
(
0x04
*
(
i_line
+
k
)
-
0x0f
<
0xff
)
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
(
0x04
*
(
i_line
+
k
)
)
-
(
color1
-
1
);
/* -V(R,G,B); */
else
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
255
;
/* V(R,G,B); */
}
else
{
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
color1
;
/* V(R,G,B); */
}
}
...
...
@@ -705,24 +696,20 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
y
/=
2
;
*
(
p_picture
->
p
[
1
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
1
].
i_pitch
-
p_picture
->
p
[
1
].
i_pitch
)
=
0
;
/* U(R,G,B); */
if
(
0x04
*
i_line
-
0x0f
>
0
)
{
if
(
0x04
*
i_line
-
0x0f
<
0xff
)
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
(
0x04
*
i_line
)
-
(
color1
-
1
);
/* -V(R,G,B); */
else
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
255
;
/* V(R,G,B); */
}
else
{
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
color1
;
/* V(R,G,B); */
}
}
...
...
@@ -755,24 +742,20 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
y
/=
2
;
*
(
p_picture
->
p
[
1
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
1
].
i_pitch
-
p_picture
->
p
[
1
].
i_pitch
)
=
0
;
if
(
0x04
*
i_line
-
0x0f
>
0
)
{
if
(
0x04
*
i_line
-
0x0f
<
0xff
)
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
(
0x04
*
i_line
)
-
(
color1
-
1
);
else
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
255
;
}
else
{
*
(
p_picture
->
p
[
2
].
p_pixels
+
x
+
y
*
p_picture
->
p
[
2
].
i_pitch
-
p_picture
->
p
[
2
].
i_pitch
)
=
color1
;
}
}
...
...
modules/visualization/visual/visual.c
View file @
524254f8
...
...
@@ -51,6 +51,8 @@
#define NBBANDS_TEXT N_( "Number of bands" )
#define NBBANDS_LONGTEXT N_( \
"Number of bands used by spectrum analyzer, should be 20 or 80." )
#define SPNBBANDS_LONGTEXT N_( \
"Number of bands used by the spectrOmeter, from 20 to 80." )
#define SEPAR_TEXT N_( "Band separator" )
#define SEPAR_LONGTEXT N_( \
...
...
@@ -125,27 +127,27 @@ vlc_module_begin();
add_bool
(
"visual-peaks"
,
VLC_TRUE
,
NULL
,
PEAKS_TEXT
,
PEAKS_LONGTEXT
,
VLC_TRUE
);
set_section
(
N_
(
"Spectrometer"
)
,
NULL
);
add_bool
(
"spect-show-original"
,
VLC_
TRU
E
,
NULL
,
add_bool
(
"spect-show-original"
,
VLC_
FALS
E
,
NULL
,
ORIG_TEXT
,
ORIG_LONGTEXT
,
VLC_TRUE
);
add_bool
(
"spect-show-base"
,
VLC_TRUE
,
NULL
,
BASE_TEXT
,
BASE_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-radius"
,
2
2
,
NULL
,
add_integer
(
"spect-radius"
,
4
2
,
NULL
,
RADIUS_TEXT
,
RADIUS_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-sections"
,
2
,
NULL
,
add_integer
(
"spect-sections"
,
3
,
NULL
,
SECT_TEXT
,
SECT_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-color"
,
16
,
NULL
,
add_integer
(
"spect-color"
,
80
,
NULL
,
COLOR1_TEXT
,
COLOR1_LONGTEXT
,
VLC_TRUE
);
add_bool
(
"spect-show-bands"
,
VLC_TRUE
,
NULL
,
BANDS_TEXT
,
BANDS_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-nbbands"
,
80
,
NULL
,
NBBANDS_TEXT
,
NBBANDS_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-nbbands"
,
32
,
NULL
,
NBBANDS_TEXT
,
SP
NBBANDS_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-separ"
,
1
,
NULL
,
SEPAR_TEXT
,
SEPAR_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-amp"
,
3
,
NULL
,
add_integer
(
"spect-amp"
,
8
,
NULL
,
AMP_TEXT
,
AMP_LONGTEXT
,
VLC_TRUE
);
add_bool
(
"spect-show-peaks"
,
VLC_TRUE
,
NULL
,
PEAKS_TEXT
,
PEAKS_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-peak-width"
,
1
,
NULL
,
add_integer
(
"spect-peak-width"
,
6
1
,
NULL
,
PEAK_WIDTH_TEXT
,
PEAK_WIDTH_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"spect-peak-height"
,
1
,
NULL
,
PEAK_HEIGHT_TEXT
,
PEAK_HEIGHT_LONGTEXT
,
VLC_TRUE
);
...
...
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