Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
8742a0a8
Commit
8742a0a8
authored
Mar 28, 2012
by
Mark Nauwelaerts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audiofx: more adjustment to changed semantics of audiofilter _setup method
parent
2ed647a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
gst/audiofx/audiochebband.c
gst/audiofx/audiochebband.c
+3
-4
gst/audiofx/audiocheblimit.c
gst/audiofx/audiocheblimit.c
+5
-7
No files found.
gst/audiofx/audiochebband.c
View file @
8742a0a8
...
...
@@ -209,12 +209,11 @@ gst_audio_cheb_band_init (GstAudioChebBand * filter)
static
void
generate_biquad_coefficients
(
GstAudioChebBand
*
filter
,
gint
p
,
gdouble
*
b0
,
gdouble
*
b1
,
gdouble
*
b2
,
gdouble
*
b3
,
gint
p
,
gint
rate
,
gdouble
*
b0
,
gdouble
*
b1
,
gdouble
*
b2
,
gdouble
*
b3
,
gdouble
*
b4
,
gdouble
*
a1
,
gdouble
*
a2
,
gdouble
*
a3
,
gdouble
*
a4
)
{
gint
np
=
filter
->
poles
/
2
;
gdouble
ripple
=
filter
->
ripple
;
gint
rate
=
GST_AUDIO_FILTER_RATE
(
filter
);
/* pole location in s-plane */
gdouble
rp
,
ip
;
...
...
@@ -452,8 +451,8 @@ generate_coefficients (GstAudioChebBand * filter, const GstAudioInfo * info)
gdouble
*
ta
=
g_new0
(
gdouble
,
np
+
5
);
gdouble
*
tb
=
g_new0
(
gdouble
,
np
+
5
);
generate_biquad_coefficients
(
filter
,
p
,
&
b0
,
&
b1
,
&
b2
,
&
b3
,
&
b4
,
&
a1
,
&
a2
,
&
a3
,
&
a4
);
generate_biquad_coefficients
(
filter
,
p
,
rate
,
&
b0
,
&
b1
,
&
b2
,
&
b3
,
&
b4
,
&
a1
,
&
a2
,
&
a3
,
&
a4
);
memcpy
(
ta
,
a
,
sizeof
(
gdouble
)
*
(
np
+
5
));
memcpy
(
tb
,
b
,
sizeof
(
gdouble
)
*
(
np
+
5
));
...
...
gst/audiofx/audiocheblimit.c
View file @
8742a0a8
...
...
@@ -201,7 +201,7 @@ gst_audio_cheb_limit_init (GstAudioChebLimit * filter)
static
void
generate_biquad_coefficients
(
GstAudioChebLimit
*
filter
,
gint
p
,
gdouble
*
b0
,
gdouble
*
b1
,
gdouble
*
b2
,
gint
p
,
gint
rate
,
gdouble
*
b0
,
gdouble
*
b1
,
gdouble
*
b2
,
gdouble
*
a1
,
gdouble
*
a2
)
{
gint
np
=
filter
->
poles
;
...
...
@@ -320,8 +320,7 @@ generate_biquad_coefficients (GstAudioChebLimit * filter,
*/
{
gdouble
k
,
d
;
gdouble
omega
=
2
.
0
*
G_PI
*
(
filter
->
cutoff
/
GST_AUDIO_FILTER_RATE
(
filter
));
gdouble
omega
=
2
.
0
*
G_PI
*
(
filter
->
cutoff
/
rate
);
if
(
filter
->
mode
==
MODE_LOW_PASS
)
k
=
sin
((
1
.
0
-
omega
)
/
2
.
0
)
/
sin
((
1
.
0
+
omega
)
/
2
.
0
);
...
...
@@ -408,7 +407,7 @@ generate_coefficients (GstAudioChebLimit * filter, const GstAudioInfo * info)
gdouble
*
ta
=
g_new0
(
gdouble
,
np
+
3
);
gdouble
*
tb
=
g_new0
(
gdouble
,
np
+
3
);
generate_biquad_coefficients
(
filter
,
p
,
&
b0
,
&
b1
,
&
b2
,
&
a1
,
&
a2
);
generate_biquad_coefficients
(
filter
,
p
,
rate
,
&
b0
,
&
b1
,
&
b2
,
&
a1
,
&
a2
);
memcpy
(
ta
,
a
,
sizeof
(
gdouble
)
*
(
np
+
3
));
memcpy
(
tb
,
b
,
sizeof
(
gdouble
)
*
(
np
+
3
));
...
...
@@ -466,8 +465,7 @@ generate_coefficients (GstAudioChebLimit * filter, const GstAudioInfo * info)
#ifndef GST_DISABLE_GST_DEBUG
{
gdouble
wc
=
2
.
0
*
G_PI
*
(
filter
->
cutoff
/
GST_AUDIO_FILTER_RATE
(
filter
));
gdouble
wc
=
2
.
0
*
G_PI
*
(
filter
->
cutoff
/
rate
);
gdouble
zr
=
cos
(
wc
),
zi
=
sin
(
wc
);
GST_LOG_OBJECT
(
filter
,
"%.2f dB gain @ %d Hz"
,
...
...
@@ -478,7 +476,7 @@ generate_coefficients (GstAudioChebLimit * filter, const GstAudioInfo * info)
GST_LOG_OBJECT
(
filter
,
"%.2f dB gain @ %d Hz"
,
20
.
0
*
log10
(
gst_audio_fx_base_iir_filter_calculate_gain
(
a
,
np
+
1
,
b
,
np
+
1
,
-
1
.
0
,
0
.
0
)),
GST_AUDIO_FILTER_RATE
(
filter
)
/
2
);
np
+
1
,
-
1
.
0
,
0
.
0
)),
rate
);
}
}
...
...
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