Mercurial > hg > match-vamp
annotate src/Path.h @ 246:aac9ad4064ea subsequence tip
Fix incorrect handling of silent tail in the non-subsequence MATCH phase; some debug output changes
author | Chris Cannam |
---|---|
date | Fri, 24 Jul 2020 14:29:55 +0100 |
parents | 39fe8728e1ca |
children |
rev | line source |
---|---|
cannam@0 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
cannam@0 | 2 |
cannam@0 | 3 /* |
cannam@0 | 4 Vamp feature extraction plugin using the MATCH audio alignment |
cannam@0 | 5 algorithm. |
cannam@0 | 6 |
cannam@0 | 7 Centre for Digital Music, Queen Mary, University of London. |
Chris@236 | 8 Copyright (c) 2007-2020 Simon Dixon, Chris Cannam, and Queen Mary |
Chris@230 | 9 University of London, Copyright (c) 2014-2015 Tido GmbH. |
cannam@0 | 10 |
cannam@0 | 11 This program is free software; you can redistribute it and/or |
cannam@0 | 12 modify it under the terms of the GNU General Public License as |
cannam@0 | 13 published by the Free Software Foundation; either version 2 of the |
cannam@0 | 14 License, or (at your option) any later version. See the file |
cannam@0 | 15 COPYING included with this distribution for more information. |
cannam@0 | 16 */ |
cannam@0 | 17 |
cannam@0 | 18 #ifndef _PATH_H_ |
cannam@0 | 19 #define _PATH_H_ |
cannam@0 | 20 |
cannam@0 | 21 #include <vector> |
cannam@0 | 22 |
cannam@0 | 23 class Path |
cannam@0 | 24 { |
cannam@0 | 25 public: |
cannam@0 | 26 Path() { } |
cannam@0 | 27 |
cannam@0 | 28 /** Smooths an alignment path.<BR> |
cannam@0 | 29 * Consider the path as a sequence of horizontal (H), vertical (V) and |
cannam@0 | 30 * diagonal (D) steps. The smoothing consists of 2 rewrite rules:<BR> |
cannam@0 | 31 * HnDmVn / Dm+n (where m is less than MAX_RUN_LENGTH)<BR> |
cannam@0 | 32 * VnDmHn / Dm+n (where m is less than MAX_RUN_LENGTH)<BR> |
cannam@0 | 33 * The new path is written over the old path. Note that the end points of |
cannam@0 | 34 * each application of a rewrite rule do not change. |
cannam@0 | 35 * @return the length of the new path |
cannam@0 | 36 */ |
cannam@0 | 37 int smooth(std::vector<int> &x, std::vector<int> &y, int length); |
cannam@0 | 38 |
cannam@0 | 39 protected: |
cannam@0 | 40 static const int MAX_RUN_LENGTH = 50; |
cannam@0 | 41 |
Chris@188 | 42 std::vector<int> m_val; |
Chris@188 | 43 std::vector<int> m_len; |
cannam@0 | 44 }; |
cannam@0 | 45 |
cannam@0 | 46 #endif |
cannam@0 | 47 |