20#ifndef RESID_EXTFILT_H
21#define RESID_EXTFILT_H
23#include "resid-config.h"
60 void enable_filter(
bool enable);
63 void clock(cycle_count delta_t,
short Vi);
91#if RESID_INLINING || defined(RESID_EXTFILT_CC)
97void ExternalFilter::clock(
short Vi)
100 if (unlikely(!enabled)) {
112 int dVlp = w0lp_1_s7*int((
unsigned(Vi) << 11) -
unsigned(Vlp)) >> 7;
113 int dVhp = w0hp_1_s17*(Vlp - Vhp) >> 17;
122void ExternalFilter::clock(cycle_count delta_t,
short Vi)
125 if (unlikely(!enabled)) {
134 cycle_count delta_t_flt = 8;
137 if (unlikely(delta_t < delta_t_flt)) {
138 delta_t_flt = delta_t;
146 int dVlp = (w0lp_1_s7*delta_t_flt >> 3)*((Vi << 11) - Vlp) >> 4;
147 int dVhp = (w0hp_1_s17*delta_t_flt >> 3)*(Vlp - Vhp) >> 14;
151 delta_t -= delta_t_flt;
160int ExternalFilter::output()
162 return (Vlp - Vhp) >> 11;