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
54e75fa8
Commit
54e75fa8
authored
Oct 03, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parameterized equalizer: audio filter2
parent
260dcf6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
modules/audio_filter/param_eq.c
modules/audio_filter/param_eq.c
+16
-20
No files found.
modules/audio_filter/param_eq.c
View file @
54e75fa8
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
...
@@ -45,13 +46,12 @@ static void CalcPeakEQCoeffs( float, float, float, float, float * );
...
@@ -45,13 +46,12 @@ static void CalcPeakEQCoeffs( float, float, float, float, float * );
static
void
CalcShelfEQCoeffs
(
float
,
float
,
float
,
int
,
float
,
float
*
);
static
void
CalcShelfEQCoeffs
(
float
,
float
,
float
,
int
,
float
,
float
*
);
static
void
ProcessEQ
(
const
float
*
,
float
*
,
float
*
,
unsigned
,
unsigned
,
static
void
ProcessEQ
(
const
float
*
,
float
*
,
float
*
,
unsigned
,
unsigned
,
const
float
*
,
unsigned
);
const
float
*
,
unsigned
);
static
void
DoWork
(
aout_instance_t
*
,
aout_filter_t
*
,
static
block_t
*
DoWork
(
filter_t
*
,
block_t
*
);
aout_buffer_t
*
,
aout_buffer_t
*
);
vlc_module_begin
()
vlc_module_begin
()
set_description
(
N_
(
"Parametric Equalizer"
)
)
set_description
(
N_
(
"Parametric Equalizer"
)
)
set_shortname
(
N_
(
"Parametric Equalizer"
)
)
set_shortname
(
N_
(
"Parametric Equalizer"
)
)
set_capability
(
"audio filter"
,
0
)
set_capability
(
"audio filter
2
"
,
0
)
set_category
(
CAT_AUDIO
)
set_category
(
CAT_AUDIO
)
set_subcategory
(
SUBCAT_AUDIO_AFILTER
)
set_subcategory
(
SUBCAT_AUDIO_AFILTER
)
...
@@ -83,7 +83,7 @@ vlc_module_end ()
...
@@ -83,7 +83,7 @@ vlc_module_end ()
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
*****************************************************************************/
*****************************************************************************/
struct
aout_
filter_sys_t
struct
filter_sys_t
{
{
/* Filter static config */
/* Filter static config */
float
f_lowf
,
f_lowgain
;
float
f_lowf
,
f_lowgain
;
...
@@ -95,7 +95,6 @@ struct aout_filter_sys_t
...
@@ -95,7 +95,6 @@ struct aout_filter_sys_t
float
coeffs
[
5
*
5
];
float
coeffs
[
5
*
5
];
/* State */
/* State */
float
*
p_state
;
float
*
p_state
;
};
};
...
@@ -106,10 +105,10 @@ struct aout_filter_sys_t
...
@@ -106,10 +105,10 @@ struct aout_filter_sys_t
*****************************************************************************/
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
p_this
)
static
int
Open
(
vlc_object_t
*
p_this
)
{
{
aout_filter_t
*
p_filter
=
(
aout_
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
aout_
filter_sys_t
*
p_sys
;
filter_sys_t
*
p_sys
;
bool
b_fit
=
true
;
bool
b_fit
=
true
;
int
i_samplerate
;
unsigned
i_samplerate
;
if
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FL32
||
if
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FL32
||
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
)
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
)
...
@@ -132,11 +131,12 @@ static int Open( vlc_object_t *p_this )
...
@@ -132,11 +131,12 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
p_filter
->
pf_do_work
=
DoWork
;
p_filter
->
b_in_place
=
true
;
/* Allocate structure */
/* Allocate structure */
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
aout_filter_sys_t
)
);
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
!
p_sys
)
return
VLC_EGENERIC
;
p_filter
->
pf_audio_filter
=
DoWork
;
p_sys
->
f_lowf
=
config_GetFloat
(
p_this
,
"param-eq-lowf"
);
p_sys
->
f_lowf
=
config_GetFloat
(
p_this
,
"param-eq-lowf"
);
p_sys
->
f_lowgain
=
config_GetFloat
(
p_this
,
"param-eq-lowgain"
);
p_sys
->
f_lowgain
=
config_GetFloat
(
p_this
,
"param-eq-lowgain"
);
...
@@ -175,7 +175,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -175,7 +175,7 @@ static int Open( vlc_object_t *p_this )
static
void
Close
(
vlc_object_t
*
p_this
)
static
void
Close
(
vlc_object_t
*
p_this
)
{
{
aout_filter_t
*
p_filter
=
(
aout_
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
free
(
p_filter
->
p_sys
->
p_state
);
free
(
p_filter
->
p_sys
->
p_state
);
free
(
p_filter
->
p_sys
);
free
(
p_filter
->
p_sys
);
}
}
...
@@ -185,17 +185,13 @@ static void Close( vlc_object_t *p_this )
...
@@ -185,17 +185,13 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************
*****************************************************************************
*
*
*****************************************************************************/
*****************************************************************************/
static
void
DoWork
(
aout_instance_t
*
p_aout
,
aout_filter_t
*
p_filter
,
static
block_t
*
DoWork
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
aout_buffer_t
*
p_in_buf
,
aout_buffer_t
*
p_out_buf
)
{
{
VLC_UNUSED
(
p_aout
);
ProcessEQ
(
(
float
*
)
p_in_buf
->
p_buffer
,
(
float
*
)
p_in_buf
->
p_buffer
,
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_buffer
=
p_in_buf
->
i_buffer
;
ProcessEQ
(
(
float
*
)
p_in_buf
->
p_buffer
,
(
float
*
)
p_out_buf
->
p_buffer
,
p_filter
->
p_sys
->
p_state
,
p_filter
->
p_sys
->
p_state
,
p_filter
->
fmt_in
.
audio
.
i_channels
,
p_in_buf
->
i_nb_samples
,
p_filter
->
fmt_in
.
audio
.
i_channels
,
p_in_buf
->
i_nb_samples
,
p_filter
->
p_sys
->
coeffs
,
5
);
p_filter
->
p_sys
->
coeffs
,
5
);
return
p_in_buf
;
}
}
/*
/*
...
...
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