Mercurial > hg > audiodb
comparison index.cpp @ 426:4a22a0bdf9a9 api-inversion
Deal with audioDB::UnitNorm
Deal with it by removing it completely, that is. New inline function
audiodb_l2norm_buffer(), replacing the three instances of that
functionality dotted throughout the code.
author | mas01cr |
---|---|
date | Wed, 24 Dec 2008 10:55:20 +0000 |
parents | d65410f4bb85 |
children | adaa6a688a04 |
comparison
equal
deleted
inserted
replaced
425:d65410f4bb85 | 426:4a22a0bdf9a9 |
---|---|
10 // Date: 23 June 2008 | 10 // Date: 23 June 2008 |
11 // | 11 // |
12 // 19th August 2008 - added O2_FLAG_LARGE_ADB support | 12 // 19th August 2008 - added O2_FLAG_LARGE_ADB support |
13 | 13 |
14 #include "audioDB.h" | 14 #include "audioDB.h" |
15 | 15 #include "audioDB-internals.h" |
16 | 16 |
17 /************************* LSH point index to audioDB conversion *****************/ | 17 /************************* LSH point index to audioDB conversion *****************/ |
18 Uns32T audioDB::index_to_trackID(Uns32T lshID, Uns32T nPntBits){ | 18 Uns32T audioDB::index_to_trackID(Uns32T lshID, Uns32T nPntBits){ |
19 assert(nPntBits); | 19 assert(nPntBits); |
20 return lshID>>nPntBits; | 20 return lshID>>nPntBits; |
308 | 308 |
309 // Allocate and calculate the l2norm sequence | 309 // Allocate and calculate the l2norm sequence |
310 *sNormpp = new double[trackTable[trackID]]; | 310 *sNormpp = new double[trackTable[trackID]]; |
311 assert(*sNormpp); | 311 assert(*sNormpp); |
312 *snPtrp = *sNormpp; | 312 *snPtrp = *sNormpp; |
313 unitNorm(fvp, dbH->dim, trackTable[trackID], *sNormpp); | 313 audiodb_l2norm_buffer(fvp, dbH->dim, trackTable[trackID], *sNormpp); |
314 sequence_sum(*sNormpp, trackTable[trackID], sequenceLength); | 314 sequence_sum(*sNormpp, trackTable[trackID], sequenceLength); |
315 sequence_sqrt(*sNormpp, trackTable[trackID], sequenceLength); | 315 sequence_sqrt(*sNormpp, trackTable[trackID], sequenceLength); |
316 } | 316 } |
317 } | 317 } |
318 | 318 |