summaryrefslogtreecommitdiff
path: root/libswresample/resample_template.c
Commit message (Collapse)AuthorAge
* swr: reindent.Ronald S. Bultje2014-06-16
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add prototypes for resample dsp functionsJames Almer2014-06-15
| | | | | | | | Should fix compilation failures with MSVC and any other compiler without inline asm support. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: split out DSP functions.Ronald S. Bultje2014-06-14
| | | | | | | | | | DSP bits of swri_resample go into their own mini-DSP functions; DSP init goes from a per-call branch in multiple_resample to a proper DSP init routine; x86 bits go into x86/; swri_resample() moves out of resample_template.c into resample.c because it's independent of DSP code or sample type; multiple_resample() is simplified. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: handle initial negative sample index outside DSP function.Ronald S. Bultje2014-06-14
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: remove unnecessary assignment.Ronald S. Bultje2014-06-14
| | | | | | | | I don't see dst_incr/dst_incr_frac ever being changed from their initial value (which is the inverse of this operation), so it seems to me that this is a no-op. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: handle 64bit overflow check in multiple_resample().Ronald S. Bultje2014-06-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: move compensation_distance handling to swri_resample caller.Ronald S. Bultje2014-06-02
| | | | | | | | | | | I think there's an off-by-one in terms of the switchpoint where we switch from dst_incr to ideal_dst_incr, I don't think that's a massive issue, but just be aware of that. It's probably trivial to prevent but I don't care. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> I could not reproduce any off by 1 error, results are bit exact (michael)
* swr/resample_template: prevent end_index from overflowing and add check for ↵Michael Niedermayer2014-06-02
| | | | | | delta_frac overflow Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Rewrite main resampling loop (common and linear).Ronald S. Bultje2014-06-02
| | | | | | | | | | | | | | | | | This removes a branch at a performance-sensitive point (in the middle of the loop). In fate-swr-resample-s32p-8000-2626, this makes the code about 10% faster. It also simplifies the loops, allowing us to rewrite it in yasm at some later point. The compensation_distance != 0 code and index < 0 code are still kind of hairy. For compensation_distance != 0, this should likely be handled in the caller, so that it calls swri_resample twice (once until the dst_incr switch-point, and once with the remainder of the samples). For index < 0, the code should probably be rewritten to break out of the loop once sample_index >= 0, and then resume (e.g. as a tail-call) to the common or linear resampling loops. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: add swri_resample_float_avxJames Almer2014-05-16
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: add swri_resample_double_sse2James Almer2014-04-25
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample/resample_template: try to consider src_size more exactlyMichael Niedermayer2014-04-15
| | | | | | | This should avoid slight differences in the output causes by input size alignment differences between archs Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample/resample: simplify index/consumed calculation for the filter = 1 caseMichael Niedermayer2014-04-14
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample/resample: Fix fractional part of index in the filter_size = 1 ↵Michael Niedermayer2014-04-14
| | | | | | filters = 1 case Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample/resample: sse float linear interpolationJames Almer2014-03-24
| | | | | | | About two times faster Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample/resample: mmx2/sse2 int16 linear interpolationJames Almer2014-03-24
| | | | | | | About three times faster Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: add swri_resample_float_sseJames Almer2014-03-20
| | | | | | | At least two times faster than the C version. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: reuse COMMON_CORE asm where possibleJames Almer2014-03-18
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: change COMMON_CORE_INT16 asm from SSSE3 to SSE2James Almer2014-03-18
| | | | | | | | | pshuf+paddd is slightly faster than phaddd. The real gain is in pre-ssse3 processors like AMD K8 and K10, which get a big boost in performance compared to the mmxext version Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/resample: fix integer overflow, add missing castMichael Niedermayer2013-02-04
| | | | | | The effects of this are limited to numeric errors in the output Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* resample: remove disabled debug codeMichael Niedermayer2012-12-06
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/resample: move templating parameters to template itself.Clément Bœsch2012-11-15
| | | | | | | | | It has various benefits such as allowing some refactoring, clarifying the code in the inclusion part, and making the template understandable in standalone. This commit is based on the templating method used by Justin Ruggles for libavresample.
* swr: move if() block into the only branch where it can be true.Michael Niedermayer2012-11-15
| | | | | | This should make the code a tiny tiny bit faster. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: reorder/redesign operations to avoid integer overflow.Michael Niedermayer2012-11-15
| | | | | | | This fixes a out of array read. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: MMX2 & SSSE3 int16 resample coreMichael Niedermayer2012-06-28
| | | | | | about 4 times faster Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: introduce filter_alloc in preparation of SIMD resample optimisationsMichael Niedermayer2012-06-19
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/resample: optimize C code for the most common caseMichael Niedermayer2012-06-19
| | | | | | 15% speedup Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* resample_template: use av_assertMichael Niedermayer2012-06-06
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: support float & int32 in the resamplerMichael Niedermayer2012-04-10
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>