Commit 7e90e987 authored by Monty Montgomery's avatar Monty Montgomery

Although the code was accounting for this, the accounting was
insufficient; round off error meant that a declip operation with the
trigger set at 1.0 would not trigger properly on positive overrange.

While I was at it, I fixed the positive trigger offset to properly
correct for input word size and not blindly assume 16 bits/

Monty


git-svn-id: https://svn.xiph.org/trunk/postfish@5841 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 896967bc
......@@ -31,6 +31,7 @@
extern int input_rate;
extern int input_ch;
extern int input_size;
extern int inbytes;
/* accessed only in playback thread/setup */
static drft_lookup fft;
......@@ -133,7 +134,7 @@ int declip_setblock(int n){
int declip_settrigger(double trigger,int ch){
if(ch<0 || ch>=input_ch)return -1;
pthread_mutex_lock(&master_mutex);
chtrigger[ch]=trigger-(1./32768);
chtrigger[ch]=trigger-(1./(1<<(inbytes*8-1)))-(1./(1<<(inbytes*8-2)));
pthread_mutex_unlock(&master_mutex);
return 0;
}
......
......@@ -34,7 +34,7 @@ int seekable;
int input_rate;
int input_ch;
static int inbytes;
int inbytes;
static int signp;
int input_size;
......
#define VERSION "$Id: version.h,v 1.32 2004/02/19 00:49:37 xiphmont Exp $ "
/* DO NOT EDIT: Automated versioning hack [Wed Feb 18 19:47:18 EST 2004] */
#define VERSION "$Id: version.h,v 1.33 2004/02/19 08:32:28 xiphmont Exp $ "
/* DO NOT EDIT: Automated versioning hack [Thu Feb 19 02:48:46 EST 2004] */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment