diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2011-03-19 16:26:47 +0100 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2011-03-20 11:35:38 +0000 |
commit | 55936640a198877b3906a425d218b4a02f39f673 (patch) | |
tree | 11d05d4c0e139c79930844b57b331d46aa6dc898 /src/modules/echo-cancel/adrian-aec.c | |
parent | b759aff8063424db2bba9a97f336aad675f7883a (diff) |
Get rid of some warnings
Mostly warnings about unused stuff.
Furthermore, the first hunk is a fix for the change in 177948a6.
Finally, comment in AEC_dtd was translated and the code simplified slightly.
CC module_bluetooth_device_la-module-bluetooth-device.lo
modules/bluetooth/module-bluetooth-device.c: In function ‘a2dp_process_render’:
modules/bluetooth/module-bluetooth-device.c:1335:30: warning: pointer targets in passing argument 6 of ‘sbc_encode’
differ in signedness [-Wpointer-sign]
../src/modules/bluetooth/sbc/sbc.h:92:9: note: expected ‘ssize_t *’ but argument is of type ‘size_t *’
CC module_rygel_media_server_la-module-rygel-media-server.lo
modules/module-rygel-media-server.c:383:13: warning: ‘append_property_dict_entry_object_array’ defined but not used [-Wunused-function]
CC module_echo_cancel_la-adrian-aec.lo
modules/echo-cancel/adrian-aec.h:360:15: warning: ‘AEC_getambient’ defined but not used [-Wunused-function]
modules/echo-cancel/adrian-aec.h:368:14: warning: ‘AEC_setgain’ defined but not used [-Wunused-function]
modules/echo-cancel/adrian-aec.h:374:14: warning: ‘AEC_setaes’ defined but not used [-Wunused-function]
modules/echo-cancel/adrian-aec.h:377:16: warning: ‘AEC_max_dotp_xf_xf’ declared ‘static’ but never defined [-Wunused-function]
CC module_echo_cancel_la-module-echo-cancel.lo
modules/echo-cancel/module-echo-cancel.c: In function ‘time_callback’:
modules/echo-cancel/module-echo-cancel.c:266:12: warning: variable ‘fs’ set but not used [-Wunused-but-set-variable]
CC module-virtual-sink.lo
modules/module-virtual-sink.c: In function ‘sink_input_pop_cb’:
modules/module-virtual-sink.c:206:15: warning: variable ‘current_latency’ set but not used [-Wunused-but-set-variable]
Diffstat (limited to 'src/modules/echo-cancel/adrian-aec.c')
-rw-r--r-- | src/modules/echo-cancel/adrian-aec.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/modules/echo-cancel/adrian-aec.c b/src/modules/echo-cancel/adrian-aec.c index 6793e59d..04b31e91 100644 --- a/src/modules/echo-cancel/adrian-aec.c +++ b/src/modules/echo-cancel/adrian-aec.c @@ -107,8 +107,7 @@ AEC* AEC_init(int RATE, int have_vector) // mapped to 1.0 with a limited linear function. static float AEC_dtd(AEC *a, REAL d, REAL x) { - float stepsize; - float ratio, M; + float ratio, stepsize; // fast near-end and far-end average a->dfast += ALPHAFAST * (fabsf(d) - a->dfast); @@ -129,16 +128,13 @@ static float AEC_dtd(AEC *a, REAL d, REAL x) // ratio of NFRs ratio = (a->dfast * a->xslow) / (a->dslow * a->xfast); - // begrenzte lineare Kennlinie - M = (STEPY2 - STEPY1) / (STEPX2 - STEPX1); - if (ratio < STEPX1) { + // Linear interpolation with clamping at the limits + if (ratio < STEPX1) stepsize = STEPY1; - } else if (ratio > STEPX2) { + else if (ratio > STEPX2) stepsize = STEPY2; - } else { - // Punktrichtungsform einer Geraden - stepsize = M * (ratio - STEPX1) + STEPY1; - } + else + stepsize = STEPY1 + (STEPY2 - STEPY1) * (ratio - STEPX1) / (STEPX2 - STEPX1); return stepsize; } |