Mercurial > hg > audiodb
comparison index.cpp @ 447:b75c1e826058 api-inversion
LESS VERBOSITY
Tracing the API as currently implemented will be a little bit of a pain;
there won't be any terribly easy way to get helpful diagnostics, and our
error codes aren't very helpful. But it's clearly wrong to have a
verbosity flag lurking, so we have to zap the messages.
author | mas01cr |
---|---|
date | Wed, 24 Dec 2008 10:56:49 +0000 |
parents | 6ac898b19656 |
children | f3b0ddc1ead0 |
comparison
equal
deleted
inserted
replaced
446:6ac898b19656 | 447:b75c1e826058 |
---|---|
601 | 601 |
602 if(audiodb_query_spec_qpointers(adb, spec, &query_data, &query, &qpointers)) { | 602 if(audiodb_query_spec_qpointers(adb, spec, &query_data, &query, &qpointers)) { |
603 error("failed to set up qpointers"); | 603 error("failed to set up qpointers"); |
604 } | 604 } |
605 | 605 |
606 VERB_LOG(1, "retrieving tracks..."); | |
607 | |
608 // query vector index | 606 // query vector index |
609 Uns32T Nq = (qpointers.nvectors>O2_MAXTRACKLEN?O2_MAXTRACKLEN:qpointers.nvectors) - sequenceLength + 1; | 607 Uns32T Nq = (qpointers.nvectors>O2_MAXTRACKLEN?O2_MAXTRACKLEN:qpointers.nvectors) - sequenceLength + 1; |
610 vv = index_initialize_shingles(Nq); // allocate memory to copy query vectors to shingles | 608 vv = index_initialize_shingles(Nq); // allocate memory to copy query vectors to shingles |
611 VERB_LOG(1, "Nq=%d", Nq); | 609 |
612 // Construct shingles from query features | 610 // Construct shingles from query features |
613 for( Uns32T pointID = 0 ; pointID < Nq ; pointID++ ) | 611 for( Uns32T pointID = 0 ; pointID < Nq ; pointID++ ) |
614 index_make_shingle(vv, pointID, query, dbH->dim, sequenceLength); | 612 index_make_shingle(vv, pointID, query, dbH->dim, sequenceLength); |
615 | 613 |
616 // Normalize query vectors | 614 // Normalize query vectors |
617 Uns32T numVecsAboveThreshold = index_norm_shingles( vv, qpointers.l2norm, qpointers.power ); | 615 Uns32T numVecsAboveThreshold = index_norm_shingles( vv, qpointers.l2norm, qpointers.power ); |
618 VERB_LOG(1, "Nq'=%d\n", numVecsAboveThreshold); | |
619 | 616 |
620 // Nq contains number of inspected points in query file, | 617 // Nq contains number of inspected points in query file, |
621 // numVecsAboveThreshold is number of points with power >= absolute_threshold | 618 // numVecsAboveThreshold is number of points with power >= absolute_threshold |
622 double* qpp = qpointers.power; // Keep original qpPtr for possible exact evaluation | 619 double* qpp = qpointers.power; // Keep original qpPtr for possible exact evaluation |
623 if(usingQueryPoint && numVecsAboveThreshold){ | 620 if(usingQueryPoint && numVecsAboveThreshold){ |