diff --git a/miniaudio.h b/miniaudio.h index 3d1203d1..414ce09a 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -60352,7 +60352,6 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r /* Slow path. Need LPF. */ ma_int32* pLPF = MA_LINEAR_RESAMPLER_GET_LPF_STATE_S32(pResampler, 0); - #if 1 /* If there's a cached frame we need to process it. */ if (inTimeInt == 0) { MA_ASSERT(pResampler->cachedFrameCount <= 1); /* There is at most one cached frame. */ @@ -60660,53 +60659,6 @@ static ma_result ma_linear_resampler_process_pcm_frames_s16_upsample(ma_linear_r *pFrameCountOut = framesProcessedOut; return MA_SUCCESS; - #else - while (framesProcessedOut < frameCountOut) { - /* Before interpolating we need to load the buffers. */ - while (pResampler->inTimeInt > 0 && frameCountIn > framesProcessedIn) { - ma_uint32 iChannel; - - for (iChannel = 0; iChannel < channels; iChannel += 1) { - pResampler->x0.s16[iChannel] = pResampler->x1.s16[iChannel]; - pResampler->x1.s16[iChannel] = pFramesInS16[iChannel]; - } - pFramesInS16 += channels; - - framesProcessedIn += 1; - pResampler->inTimeInt -= 1; - } - - if (pResampler->inTimeInt > 0) { - break; /* Ran out of input data. */ - } - - /* Getting here means the frames have been loaded and we can generate the next output frame. */ - if (pFramesOutS16 != NULL) { - MA_ASSERT(pResampler->inTimeInt == 0); - ma_linear_resampler_interpolate_frame_s16(pResampler, invSampleRateOut, pFramesOutS16); - - /* Filter. */ - ma_linear_resampler_filter_s16(pResampler, pFramesOutS16); - - pFramesOutS16 += channels; - } - - framesProcessedOut += 1; - - /* Advance time forward. */ - pResampler->inTimeInt += pResampler->inAdvanceInt; - pResampler->inTimeFrac += pResampler->inAdvanceFrac; - if (pResampler->inTimeFrac >= pResampler->sampleRateOut) { - pResampler->inTimeFrac -= pResampler->sampleRateOut; - pResampler->inTimeInt += 1; - } - } - - *pFrameCountIn = framesProcessedIn; - *pFrameCountOut = framesProcessedOut; - - return MA_SUCCESS; - #endif } } @@ -60844,7 +60796,6 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r /*printf("UP %u\n", pResampler->inTimeInt);*/ - #if 1 /* If there's a cached frame we need to process it. */ if (inTimeInt == 0) { MA_ASSERT(pResampler->cachedFrameCount <= 1); /* There is at most one cached frame. */ @@ -61152,53 +61103,6 @@ static ma_result ma_linear_resampler_process_pcm_frames_f32_upsample(ma_linear_r *pFrameCountOut = framesProcessedOut; return MA_SUCCESS; - #else - while (framesProcessedOut < frameCountOut) { - /* Before interpolating we need to load the buffers. */ - while (pResampler->inTimeInt > 0 && frameCountIn > framesProcessedIn) { - ma_uint32 iChannel; - - for (iChannel = 0; iChannel < channels; iChannel += 1) { - pResampler->x0.f32[iChannel] = pResampler->x1.f32[iChannel]; - pResampler->x1.f32[iChannel] = pFramesInF32[iChannel]; - } - pFramesInF32 += channels; - - framesProcessedIn += 1; - pResampler->inTimeInt -= 1; - } - - if (pResampler->inTimeInt > 0) { - break; /* Ran out of input data. */ - } - - /* Getting here means the frames have been loaded and we can generate the next output frame. */ - if (pFramesOutF32 != NULL) { - MA_ASSERT(pResampler->inTimeInt == 0); - ma_linear_resampler_interpolate_frame_f32(pResampler, invSampleRateOut, pFramesOutF32); - - /* Filter. */ - ma_linear_resampler_filter_f32(pResampler, pFramesOutF32); - - pFramesOutF32 += channels; - } - - framesProcessedOut += 1; - - /* Advance time forward. */ - pResampler->inTimeInt += pResampler->inAdvanceInt; - pResampler->inTimeFrac += pResampler->inAdvanceFrac; - if (pResampler->inTimeFrac >= pResampler->sampleRateOut) { - pResampler->inTimeFrac -= pResampler->sampleRateOut; - pResampler->inTimeInt += 1; - } - } - - *pFrameCountIn = framesProcessedIn; - *pFrameCountOut = framesProcessedOut; - - return MA_SUCCESS; - #endif } }