2 * Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
3 * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "ardour/iec2ppmdsp.h"
23 float Iec2ppmdsp::_w1;
24 float Iec2ppmdsp::_w2;
25 float Iec2ppmdsp::_w3;
28 Iec2ppmdsp::Iec2ppmdsp (void)
35 Iec2ppmdsp::~Iec2ppmdsp (void) {}
38 Iec2ppmdsp::process (float const* p, int n)
42 z1 = _z1 > 20 ? 20 : (_z1 < 0 ? 0 : _z1);
43 z2 = _z2 > 20 ? 20 : (_z2 < 0 ? 0 : _z2);
52 if (t > z1) z1 += _w1 * (t - z1);
53 if (t > z2) z2 += _w2 * (t - z2);
55 if (t > z1) z1 += _w1 * (t - z1);
56 if (t > z2) z2 += _w2 * (t - z2);
58 if (t > z1) z1 += _w1 * (t - z1);
59 if (t > z2) z2 += _w2 * (t - z2);
61 if (t > z1) z1 += _w1 * (t - z1);
62 if (t > z2) z2 += _w2 * (t - z2);
73 Iec2ppmdsp::read (void)
87 Iec2ppmdsp::init (float fsamp)
91 _w3 = 1.0f - 4.0f / fsamp;