aboutsummaryrefslogtreecommitdiff
path: root/peakval_port.c
diff options
context:
space:
mode:
authorBill Yi <byi@google.com>2015-06-23 13:53:11 -0700
committerBill Yi <byi@google.com>2015-06-23 13:53:11 -0700
commit4e213d510f437769f8a28578dd4f786fb7d16c44 (patch)
tree0d5cbd5a7eee87b3dca5820d282ef618a7e25991 /peakval_port.c
downloadfec-4e213d510f437769f8a28578dd4f786fb7d16c44.tar.gz
Initial codenougat-mr1-arc
Diffstat (limited to 'peakval_port.c')
-rw-r--r--peakval_port.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/peakval_port.c b/peakval_port.c
new file mode 100644
index 0000000..07ab316
--- /dev/null
+++ b/peakval_port.c
@@ -0,0 +1,16 @@
+/* Portable C version of peakval
+ * Copyright 2004 Phil Karn, KA9Q
+ */
+#include <stdlib.h>
+#include "fec.h"
+int peakval_port(signed short *b,int len){
+ int peak = 0;
+ int a,i;
+
+ for(i=0;i<len;i++){
+ a = abs(b[i]);
+ if(a > peak)
+ peak = a;
+ }
+ return peak;
+}