summaryrefslogtreecommitdiffstats
path: root/gst/cutter/filter.func
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2001-12-22 23:27:31 +0000
committerAndy Wingo <wingo@pobox.com>2001-12-22 23:27:31 +0000
commit185612aae3b8acae2b32e0e6561691a7c640cd0d (patch)
tree7cd1990c3df5c63f402f3e0bdf6b51b3ed58fc41 /gst/cutter/filter.func
parent87dab192cf5792f847a22e0c3e9afe78553739b5 (diff)
Initial revision
Original commit message from CVS: Initial revision
Diffstat (limited to 'gst/cutter/filter.func')
-rw-r--r--gst/cutter/filter.func16
1 files changed, 16 insertions, 0 deletions
diff --git a/gst/cutter/filter.func b/gst/cutter/filter.func
new file mode 100644
index 00000000..bdbe5663
--- /dev/null
+++ b/gst/cutter/filter.func
@@ -0,0 +1,16 @@
+{
+ guint j;
+ register double squaresum = 0.0;
+
+ /*
+ * process data here
+ * input sample data enters in *in_data as 8 or 16 bit data
+ * samples for left and right channel are interleaved
+ */
+
+ for (j = 0; j < num_samples; j++)
+ squaresum += data[j] * data[j];
+
+ return (squaresum / (float) num_samples);
+}
+