comparison data/model/PowerOfSqrtTwoZoomConstraint.cpp @ 377:166c22eff678

* Ensure waveforms are strictly correct even when using a non-power-of-two non-power-of-sqrt-two block size with cacheing off and painting only small areas at a time
author Chris Cannam
date Thu, 07 Feb 2008 15:25:05 +0000
parents 3a13b0d4934e
children d7f3dfe6f9a4
comparison
equal deleted inserted replaced
376:ab24af1271e9 377:166c22eff678
73 base = (((unsigned int)((1 << minCachePower) * sqrt(2) + 0.01)) 73 base = (((unsigned int)((1 << minCachePower) * sqrt(2) + 0.01))
74 << (power - minCachePower)); 74 << (power - minCachePower));
75 } 75 }
76 76
77 // std::cerr << "Testing base " << base << std::endl; 77 // std::cerr << "Testing base " << base << std::endl;
78 if (base >= blockSize) { 78
79 if (base == blockSize) {
80 result = base;
81 break;
82 }
83
84 if (base > blockSize) {
79 if (dir == RoundNearest) { 85 if (dir == RoundNearest) {
80 if (base - blockSize < blockSize - prevBase) { 86 if (base - blockSize < blockSize - prevBase) {
81 dir = RoundUp; 87 dir = RoundUp;
82 } else { 88 } else {
83 dir = RoundDown; 89 dir = RoundDown;