comparison audioio/PhaseVocoderTimeStretcher.cpp @ 137:006c90387f40

* Fix many compile warnings, remove some debug output
author Chris Cannam
date Mon, 30 Apr 2007 13:36:23 +0000
parents f3516e520652
children 7310316bf74b
comparison
equal deleted inserted replaced
136:37c26877ca5f 137:006c90387f40
161 if (m_wlen < 2048) m_wlen = 2048; 161 if (m_wlen < 2048) m_wlen = 2048;
162 } 162 }
163 m_n1 = lrintf(m_n2 / m_ratio); 163 m_n1 = lrintf(m_n2 / m_ratio);
164 if (m_n1 == 0) { 164 if (m_n1 == 0) {
165 m_n1 = 1; 165 m_n1 = 1;
166 m_n2 = m_ratio; 166 m_n2 = lrintf(m_ratio);
167 } 167 }
168 } 168 }
169 169
170 m_transientThreshold = lrintf(m_wlen / 4.5); 170 m_transientThreshold = lrintf(m_wlen / 4.5);
171 171
376 // std::cerr << "ratio for last 10: " <<last10num << "/" << (10 * m_n1) << " = " << float(last10num) / float(10 * m_n1) << " (should be " << m_ratio << ")" << std::endl; 376 // std::cerr << "ratio for last 10: " <<last10num << "/" << (10 * m_n1) << " = " << float(last10num) / float(10 * m_n1) << " (should be " << m_ratio << ")" << std::endl;
377 377
378 if (m_totalCount > 50 && m_transientCount < m_totalCount) { 378 if (m_totalCount > 50 && m_transientCount < m_totalCount) {
379 379
380 int fixed = lrintf(m_transientCount * m_n1); 380 int fixed = lrintf(m_transientCount * m_n1);
381 int squashy = m_n2sum - fixed;
382 381
383 int idealTotal = lrintf(m_totalCount * m_n1 * m_ratio); 382 int idealTotal = lrintf(m_totalCount * m_n1 * m_ratio);
384 int idealSquashy = idealTotal - fixed; 383 int idealSquashy = idealTotal - fixed;
385 384
386 int squashyCount = m_totalCount - m_transientCount; 385 int squashyCount = m_totalCount - m_transientCount;
540 539
541 // if (count > m_transientThreshold && 540 // if (count > m_transientThreshold &&
542 // count > m_prevTransientScore * 1.2) { 541 // count > m_prevTransientScore * 1.2) {
543 if (count > m_prevTransientScore && 542 if (count > m_prevTransientScore &&
544 count > m_transientThreshold && 543 count > m_transientThreshold &&
545 count - m_prevTransientScore > m_wlen / 20) { 544 count - m_prevTransientScore > int(m_wlen) / 20) {
546 isTransient = true; 545 isTransient = true;
547 546
548 547
549 std::cerr << "isTransient (count = " << count << ", prev = " << m_prevTransientScore << ", diff = " << count - m_prevTransientScore << ", ratio = " << (m_totalCount > 0 ? (float (m_n2sum) / float(m_totalCount * m_n1)) : 1.f) << ", ideal = " << m_ratio << ")" << std::endl; 548 std::cerr << "isTransient (count = " << count << ", prev = " << m_prevTransientScore << ", diff = " << count - m_prevTransientScore << ", ratio = " << (m_totalCount > 0 ? (float (m_n2sum) / float(m_totalCount * m_n1)) : 1.f) << ", ideal = " << m_ratio << ")" << std::endl;
550 // } else { 549 // } else {