Sign in
android
/
platform
/
external
/
fec
/
refs/heads/android13-frc-adbd-release
/
.
/
peakval_port.c
blob: 07ab31696abe0a1db88150028aea7d920271dd78 [
file
] [
log
] [
blame
] [
edit
]
/* 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
;
}