Commit 78a9bed9 authored by Monty Montgomery's avatar Monty Montgomery

Fix a relapping bug when eq is inactive


git-svn-id: https://svn.xiph.org/trunk/postfish@5852 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent d997451b
......@@ -255,18 +255,26 @@ static void feedback_work(double *peak,double *rms,
}
}
static void lap_work(double *work,double *lap,double *out,freq_state *f){
static void lap_work(double *work,double *lap,double *out,freq_state *f,int bypass){
double *workoff=work+f->blocksize/2;
int i,j;
/* lap and out */
if(out)
for(i=0;i<f->blocksize/2;i++)
out[i]=lap[i]+workoff[i]*f->window[i];
for(i=f->blocksize/2,j=0;i<f->blocksize;i++)
lap[j++]=workoff[i]*f->window[i];
if(bypass){
if(out)
for(i=0;i<f->blocksize/2;i++)
out[i]=lap[i]+workoff[i]*f->window[i]*f->window[i];
for(i=f->blocksize/2,j=0;i<f->blocksize;i++)
lap[j++]=workoff[i]*f->window[i]*f->window[i];
}else{
if(out)
for(i=0;i<f->blocksize/2;i++)
out[i]=lap[i]+workoff[i]*f->window[i];
for(i=f->blocksize/2,j=0;i<f->blocksize;i++)
lap[j++]=workoff[i]*f->window[i];
}
}
......@@ -311,7 +319,7 @@ time_linkage *freq_read(time_linkage *in, freq_state *f,
feedback_work(peak,rms,feedback_peak[i],feedback_rms[i]);
drft_backward(&f->fft,work);
}
lap_work(work,f->lap[i],0,f);
lap_work(work,f->lap[i],0,f,bypass);
blocks++;
memset(f->cache[i],0,sizeof(**f->cache)*input_size);
......@@ -343,7 +351,7 @@ time_linkage *freq_read(time_linkage *in, freq_state *f,
feedback_work(peak,rms,feedback_peak[i],feedback_rms[i]);
drft_backward(&f->fft,work);
}
lap_work(work,f->lap[i],f->out.data[i]+j,f);
lap_work(work,f->lap[i],f->out.data[i]+j,f,bypass);
blocks++;
}
......@@ -358,7 +366,7 @@ time_linkage *freq_read(time_linkage *in, freq_state *f,
feedback_work(peak,rms,feedback_peak[i],feedback_rms[i]);
drft_backward(&f->fft,work);
}
lap_work(work,f->lap[i],f->out.data[i]+j,f);
lap_work(work,f->lap[i],f->out.data[i]+j,f,bypass);
blocks++;
f->cache[i]=in->data[i];
......
......@@ -44,6 +44,7 @@ int main(int argc, char **argv){
/* set up filter chains */
if(declip_load())exit(1);
if(eq_load())exit(1);
if(compand_load())exit(1);
/* look at stdout... do we have a file or device? */
if(!isatty(STDOUT_FILENO)){
......
......@@ -84,6 +84,7 @@ static void action_zero(GtkWidget *widget,postfish_mainpanel *p){
multibar_reset(MULTIBAR(p->outbar));
clippanel_reset();
eqpanel_reset();
compandpanel_reset();
}
static void action_end(GtkWidget *widget,postfish_mainpanel *p){
......@@ -98,6 +99,7 @@ static void action_end(GtkWidget *widget,postfish_mainpanel *p){
multibar_reset(MULTIBAR(p->outbar));
clippanel_reset();
eqpanel_reset();
compandpanel_reset();
}
static void action_bb(GtkWidget *widget,postfish_mainpanel *p){
......@@ -890,6 +892,7 @@ static gboolean feedback_process(postfish_mainpanel *panel){
pull_input_feedback(NULL,NULL,NULL);
clippanel_feedback(0);
eqpanel_feedback(0);
compandpanel_feedback(0);
pull_output_feedback(NULL,NULL);
......@@ -935,6 +938,7 @@ static gboolean feedback_process(postfish_mainpanel *panel){
clippanel_feedback(1);
eqpanel_feedback(1);
compandpanel_feedback(1);
}
}
......
......@@ -30,6 +30,7 @@
#include "output.h"
#include "declip.h"
#include "eq.h"
#include "compand.h"
extern int input_size;
sig_atomic_t playback_active=0;
......@@ -54,6 +55,7 @@ void pipeline_reset(){
input_reset(); /* clear any persistent lapping state */
declip_reset(); /* clear any persistent lapping state */
eq_reset(); /* clear any persistent lapping state */
compand_reset(); /* clear any persistent lapping state */
output_reset(); /* clear any persistent lapping state */
}
......@@ -229,6 +231,8 @@ void *playback_thread(void *dummy){
result|=link->samples;
link=eq_read(link);
result|=link->samples;
link=compand_read(link);
result|=link->samples;
if(!result)break;
/************/
......
#define VERSION "$Id: version.h,v 1.36 2004/02/20 06:06:00 xiphmont Exp $ "
/* DO NOT EDIT: Automated versioning hack [Fri Feb 20 01:04:55 EST 2004] */
#define VERSION "$Id: version.h,v 1.37 2004/02/20 06:43:32 xiphmont Exp $ "
/* DO NOT EDIT: Automated versioning hack [Fri Feb 20 01:37:20 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