Home | History | Annotate | Download | only in sonic

Lines Matching refs:period

525         for(int period = minPeriod; period <= maxPeriod; period++) {
527 for(int i = 0; i < period; i++) {
529 short pVal = samples[position + period + i];
535 if(diff*bestPeriod < minDiff*period) {
537 bestPeriod = period;
539 if(diff*worstPeriod > maxDiff*period) {
541 worstPeriod = period;
550 // approximated by the previous pitch period estimate. Try to detect this case.
552 int period,
562 // Got a reasonable match this period
566 // Mismatch is not that much greater this period
577 // Find the pitch period. This is a critical step, and we may have to try
588 int period, retPeriod;
595 period = findPitchPeriodInRange(samples, position, minPeriod, maxPeriod, minDiff, maxDiff);
598 period = findPitchPeriodInRange(downSampleBuffer, 0, minPeriod/skip,
601 period *= skip;
602 int minP = period - (skip << 2);
603 int maxP = period + (skip << 2);
611 period = findPitchPeriodInRange(samples, position, minP, maxP, minDiff, maxDiff);
614 period = findPitchPeriodInRange(downSampleBuffer, 0, minP, maxP, minDiff, maxDiff);
618 if(prevPeriodBetter(period, minDiff, maxDiff, preferNewPeriod)) {
621 retPeriod = period;
624 prevPeriod = period;
718 int period, newPeriod, separation;
726 period = findPitchPeriod(pitchBuffer, position, false);
727 newPeriod = (int)(period/pitch);
731 position, pitchBuffer, position + period - newPeriod);
733 separation = newPeriod - period;
734 overlapAddWithSeparation(period, numChannels, separation, outputBuffer, numOutputSamples,
738 position += period;
804 // Skip over a pitch period, and copy period/speed samples to the output
809 int period)
814 newSamples = (int)(period/(speed - 1.0f));
816 newSamples = period;
817 remainingInputToCopy = (int)(period*(2.0f - speed)/(speed - 1.0f));
821 samples, position + period);
826 // Insert a pitch period, and determine how much input to copy directly.
831 int period)
836 newSamples = (int)(period*speed/(1.0f - speed));
838 newSamples = period;
839 remainingInputToCopy = (int)(period*(2.0f*speed - 1.0f)/(1.0f - speed));
841 enlargeOutputBufferIfNeeded(period + newSamples);
842 move(outputBuffer, numOutputSamples, samples, position, period);
843 overlapAdd(newSamples, numChannels, outputBuffer, numOutputSamples + period, samples,
844 position + period, samples, position);
845 numOutputSamples += period + newSamples;
855 int position = 0, period, newSamples;
865 period = findPitchPeriod(inputBuffer, position, true);
867 newSamples = skipPitchPeriod(inputBuffer, position, speed, period);
868 position += period + newSamples;
870 newSamples = insertPitchPeriod(inputBuffer, position, speed, period);