diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2007-08-12 15:41:57 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2007-08-12 15:41:57 +0000 |
commit | cadec287af6a6279887168ce7b16a659fef75b89 (patch) | |
tree | e2cb8b3dd32474b2247d683a9de6617eb7a78ea0 /gst/filter | |
parent | 0cbaaf092923aead941dadb6728d64cd554d1d2b (diff) | |
download | gst-plugins-bad-cadec287af6a6279887168ce7b16a659fef75b89.tar.gz gst-plugins-bad-cadec287af6a6279887168ce7b16a659fef75b89.tar.bz2 gst-plugins-bad-cadec287af6a6279887168ce7b16a659fef75b89.zip |
gst/filter/: Improve debugging a bit.
Original commit message from CVS:
* gst/filter/gstbpwsinc.c: (bpwsinc_build_kernel):
* gst/filter/gstlpwsinc.c: (lpwsinc_build_kernel):
Improve debugging a bit.
Diffstat (limited to 'gst/filter')
-rw-r--r-- | gst/filter/gstbpwsinc.c | 17 | ||||
-rw-r--r-- | gst/filter/gstlpwsinc.c | 9 |
2 files changed, 15 insertions, 11 deletions
diff --git a/gst/filter/gstbpwsinc.c b/gst/filter/gstbpwsinc.c index f2bfda74..d9690b6c 100644 --- a/gst/filter/gstbpwsinc.c +++ b/gst/filter/gstbpwsinc.c @@ -338,8 +338,6 @@ bpwsinc_build_kernel (GstBPWSinc * self) return; } - self->have_kernel = TRUE; - /* Clamp frequencies */ self->lower_frequency = CLAMP (self->lower_frequency, 0.0, @@ -354,10 +352,13 @@ bpwsinc_build_kernel (GstBPWSinc * self) self->upper_frequency = tmp; } - /* fill the lp kernel */ - GST_DEBUG ("bpwsinc: initializing LP kernel of length %d with cut-off %f", - len, self->lower_frequency); + GST_DEBUG ("bpwsinc: initializing filter kernel of length %d " + "with lower frequency %.2lf Hz " + ", upper frequency %.2lf Hz for mode %s", + len, self->lower_frequency, self->upper_frequency, + (self->mode == MODE_BAND_PASS) ? "band-pass" : "band-reject"); + /* fill the lp kernel */ w = 2 * M_PI * (self->lower_frequency / GST_AUDIO_FILTER (self)->format.rate); kernel_lp = g_new (gdouble, len); for (i = 0; i < len; ++i) { @@ -383,9 +384,6 @@ bpwsinc_build_kernel (GstBPWSinc * self) kernel_lp[i] /= sum; /* fill the hp kernel */ - GST_DEBUG ("bpwsinc: initializing HP kernel of length %d with cut-off %f", - len, self->upper_frequency); - w = 2 * M_PI * (self->upper_frequency / GST_AUDIO_FILTER (self)->format.rate); kernel_hp = g_new (gdouble, len); for (i = 0; i < len; ++i) { @@ -438,9 +436,10 @@ bpwsinc_build_kernel (GstBPWSinc * self) /* set up the residue memory space */ if (self->residue) g_free (self->residue); - self->residue = g_new0 (gdouble, len * GST_AUDIO_FILTER (self)->format.channels); + + self->have_kernel = TRUE; } /* GstAudioFilter vmethod implementations */ diff --git a/gst/filter/gstlpwsinc.c b/gst/filter/gstlpwsinc.c index 55daaf7b..50d0c0f9 100644 --- a/gst/filter/gstlpwsinc.c +++ b/gst/filter/gstlpwsinc.c @@ -319,9 +319,7 @@ lpwsinc_build_kernel (GstLPWSinc * self) gint len = 0; gdouble w; - /* fill the kernel */ len = self->kernel_length; - GST_DEBUG ("lpwsinc: initializing filter kernel of length %d", len); if (GST_AUDIO_FILTER (self)->format.rate == 0) { GST_DEBUG ("rate not set yet"); @@ -337,6 +335,13 @@ lpwsinc_build_kernel (GstLPWSinc * self) self->frequency = CLAMP (self->frequency, 0.0, GST_AUDIO_FILTER (self)->format.rate / 2); + GST_DEBUG ("lpwsinc: initializing filter kernel of length %d " + "with cutoff %.2lf Hz " + "for mode %s", + len, self->frequency, + (self->mode == MODE_LOW_PASS) ? "low-pass" : "high-pass"); + + /* fill the kernel */ w = 2 * M_PI * (self->frequency / GST_AUDIO_FILTER (self)->format.rate); if (self->kernel) |