/*---------------------------------------------------------------------------*/
/*
  File: slec.h

  Line echo canceller.
*/
/*---------------------------------------------------------------------------*/

#ifndef SLEC_H_
#define SLEC_H_

#include "sparslec.h"

#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
NAMESPACE_BEGIN

#define SLEC_MAX_PREDELAY_SIZE      2048

typedef struct softdsp_lec_s
{
    word state;
    word predelay_size;
    word predelay_read_pos;
    word predelay_write_pos;
    short predelay_sample_buffer[SLEC_MAX_PREDELAY_SIZE];

    t_sparse_lec ec;
} t_softdsp_lec;

void softdsp_lec_init(t_softdsp_lec *p_lec, word options, word span_samples, word predelay_samples, word sparse_span_samples);
void softdsp_lec_flush(t_softdsp_lec *p_lec);
void softdsp_lec_s_exec(t_softdsp_lec *p_lec, const short *sin_samples, short *sout_samples, word sample_count);
void softdsp_lec_r_exec(t_softdsp_lec *p_lec, const short *rin_samples, word sample_count);


NAMESPACE_END
/*---------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif

#endif

/*---------------------------------------------------------------------------*/
