only compute filter when opt_afc is enabled

Change-Id: Icc42a70b07600267ccfad3969b738b3b4a606a61
changes/89/29389/6
wbokslag 2 months ago
parent 79560cbf86
commit 6108c35f74
  1. 9
      src/float_to_bits.c

@ -81,13 +81,11 @@ int main(int argc, char **argv)
int fd, fd_out, opt;
int opt_verbose = 0;
int opt_afc = 0;
float filter = 0;
float filter_val = 0.0001;
float filter_goal = 0;
int sym;
while ((opt = getopt(argc, argv, "vaf:F:")) != -1) {
switch (opt) {
case 'v':
@ -141,11 +139,10 @@ int main(int argc, char **argv)
rc /= sizeof(*fl);
int i;
for (i = 0; i < rc; ++i) {
if ((fl[i] > -MAXVAL) && (fl[i] < MAXVAL)) {
filter = filter * (1.0 - filter_val) + (fl[i] - filter_goal) * filter_val;
}
if (opt_afc) {
if ((fl[i] > -MAXVAL) && (fl[i] < MAXVAL)) {
filter = filter * (1.0 - filter_val) + (fl[i] - filter_goal) * filter_val;
}
sym = process_sym_fl(fl[i]-filter);
} else {
sym = process_sym_fl(fl[i]);

Loading…
Cancel
Save