X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=compress.c;h=936ddc3afe2cf5449d03109aac87925818a3739b;hp=b4e4c40a7a1663c95b38cdbada69715c519da5dc;hb=4c80bf4a2082c4922094f7e8ce75193edb6be80f;hpb=a8a78f935dcefa8a7fcda8dae80bca64fe39d632 diff --git a/compress.c b/compress.c index b4e4c40a..936ddc3a 100644 --- a/compress.c +++ b/compress.c @@ -25,6 +25,7 @@ #include "para.h" #include "compress_filter.cmdline.h" #include "list.h" +#include "sched.h" #include "filter.h" #include "string.h" @@ -67,8 +68,8 @@ static ssize_t compress(char *inbuf, size_t inbuf_len, struct filter_node *fn) >> gain_shift; if (unlikely(adjusted_sample > 32767)) { adjusted_sample = 32767; - pcd->current_gain = (pcd->current_gain + - (1 << pcd->conf->inertia_arg)) / 2; + pcd->current_gain = (3 * pcd->current_gain + + (1 << pcd->conf->inertia_arg)) / 4; pcd->peak = 0; } else if (adjusted_sample > pcd->peak) @@ -78,8 +79,8 @@ static ssize_t compress(char *inbuf, size_t inbuf_len, struct filter_node *fn) >> gain_shift); if (unlikely(adjusted_sample < -32768)) { adjusted_sample = -32768; - pcd->current_gain = (pcd->current_gain + - (1 << pcd->conf->inertia_arg)) / 2; + pcd->current_gain = (3 * pcd->current_gain + + (1 << pcd->conf->inertia_arg)) / 4; pcd->peak = 0; } else if (-adjusted_sample > pcd->peak)