src/audio/SDL_audiocvt.c
changeset 11611 4ad5d0fccc9f
parent 11596 9d8ea0382c52
child 11631 150b925ddfbb
equal deleted inserted replaced
11610:6dea196ecbcb 11611:4ad5d0fccc9f
   513             /* !!! FIXME: do both wings in one loop */
   513             /* !!! FIXME: do both wings in one loop */
   514             for (j = 0; (filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) {
   514             for (j = 0; (filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) {
   515                 const int srcframe = srcindex - j;
   515                 const int srcframe = srcindex - j;
   516                 /* !!! FIXME: we can bubble this conditional out of here by doing a pre loop. */
   516                 /* !!! FIXME: we can bubble this conditional out of here by doing a pre loop. */
   517                 const float insample = (srcframe < 0) ? lpadding[((paddinglen + srcframe) * chans) + chan] : inbuf[(srcframe * chans) + chan];
   517                 const float insample = (srcframe < 0) ? lpadding[((paddinglen + srcframe) * chans) + chan] : inbuf[(srcframe * chans) + chan];
   518                 outsample += (insample * (ResamplerFilter[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation1 * ResamplerFilterDifference[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)])));
   518                 outsample += (float)(insample * (ResamplerFilter[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation1 * ResamplerFilterDifference[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)])));
   519             }
   519             }
   520 
   520 
   521             for (j = 0; (filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) {
   521             for (j = 0; (filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) {
   522                 const int srcframe = srcindex + 1 + j;
   522                 const int srcframe = srcindex + 1 + j;
   523                 /* !!! FIXME: we can bubble this conditional out of here by doing a post loop. */
   523                 /* !!! FIXME: we can bubble this conditional out of here by doing a post loop. */
   524                 const float insample = (srcframe >= inframes) ? rpadding[((srcframe - inframes) * chans) + chan] : inbuf[(srcframe * chans) + chan];
   524                 const float insample = (srcframe >= inframes) ? rpadding[((srcframe - inframes) * chans) + chan] : inbuf[(srcframe * chans) + chan];
   525                 outsample += (insample * (ResamplerFilter[filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation2 * ResamplerFilterDifference[filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)])));
   525                 outsample += (float)(insample * (ResamplerFilter[filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation2 * ResamplerFilterDifference[filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)])));
   526             }
   526             }
   527             *(dst++) = outsample;
   527             *(dst++) = outsample;
   528         }
   528         }
   529 
   529 
   530         outtime += outtimeincr;
   530         outtime += outtimeincr;