summaryrefslogtreecommitdiff
path: root/libswresample/swresample.c
Commit message (Collapse)AuthorAgeFilesLines
* swr: check that the context for swr_convert() has been initializedMichael Niedermayer2014-02-241-0/+5
| | | | | Reviewed-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: add swr_is_initialized()Michael Niedermayer2014-02-241-0/+4
| | | | | | Idea-from/based-on: 7e86c27b4ee9e5a3fbe6cf5249b9d918b2a5e731 Reviewed-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: factorize clear_context() outMichael Niedermayer2014-02-221-26/+20
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavu,lavc,lswr: do not hardcode AV_SAMPLE_FMT_NB value when setting sample ↵Stefano Sabatini2013-12-261-6/+6
| | | | | | | | | | | | format max value The constant may change in libavutil but the library may be compiled against an older version, thus rejecting a value which is otherwise supported by the new libavutil. INT_MAX is used here to denote the max allowed value for a sample format. The opt-test code is changed to provide a valid reference example.
* swresample: use the internal buffer for resampling the last few samplesMichael Niedermayer2013-12-041-2/+7
| | | | | | | Fixes out of array read Fixes Ticket3193 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lswr/swresample: convert ocl and icl options to AV_OPT_TYPE_CHANNEL_LAYOUTStefano Sabatini2013-10-171-4/+4
| | | | | Improve interface flexibility. In particular makes it possible to set channel layout through symbolic names using the av_opt_set() interface.
* swresample: replace 2 av_free() by av_freep()Michael Niedermayer2013-09-161-1/+1
| | | | | | avoids leaving stale pointers in memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: Make rematrix maxvalue user settableMichael Niedermayer2013-07-221-0/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cosmetics: Fix "dont" "wont" "doesnt" typosTimothy Gu2013-06-291-2/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: dont treat 32 and 24 as equal in simple copy checkMichael Niedermayer2013-06-051-1/+2
| | | | | | Fixes dithering from 32 to 24 bit Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: set flags & description and add documentation for output_sample_bitsPaul B Mahol2013-06-041-1/+1
| | | | | | Allows users to actually use such option. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* swr: Fix dithering of s16 with SIMDMichael Niedermayer2013-06-041-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: make the default of nopts for first_pts actually workMichael Niedermayer2013-02-251-1/+6
| | | | | | Fixes Ticket2210 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: support a seperate output sample bits.Michael Niedermayer2013-02-241-0/+1
| | | | | | This avoids user apps having to mangle dither scale. for pcm24 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add duplicate cutoff for compatibilityMichael Niedermayer2013-02-241-0/+4
| | | | | | | | Based on commit 50f4337a2fd3b571b38c9475981e36405d1ca1e1 Author: Justin Ruggles <justin.ruggles@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: check channel layouts before using them.Michael Niedermayer2013-02-131-0/+10
| | | | | | | Fixes out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: Dont use floats for S32->S32 when possibleMichael Niedermayer2013-02-041-0/+5
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: reorder init code to make rematrix status available earlierMichael Niedermayer2013-02-041-27/+27
| | | | | | | This also makes some other fields available earlier which may be usefull one day Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: limit phase_shift to a less insane value.Michael Niedermayer2013-01-271-1/+1
| | | | | | | This prevents potential crashes and out of memory issues if the user manually sets such insane values. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: support first_ptsMichael Niedermayer2013-01-211-1/+10
| | | | | Trolled-by: Daemon404 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: fix handling of timestamps that cause multiple drops or silence injectionsMichael Niedermayer2013-01-131-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: limit buffer size for silence injectionMichael Niedermayer2013-01-131-0/+7
| | | | | | This reduces memory usage for unreasonable large silence injections Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: limit buffer size for discarding.Michael Niedermayer2013-01-131-5/+8
| | | | | | | This prevents insane memory usage in case of insane input values. Untested due to lack of a testcase that causes such insane allocation Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: move silence buffer to context to avoid per use malloc/freeMichael Niedermayer2013-01-131-9/+8
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: move buffer used to discard sample to contextMichael Niedermayer2013-01-131-6/+5
| | | | | | | | This avoids the need to allocate & free to repeatly Fixes Ticket2122 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: check that allocation of in/out_convert succeededMichael Niedermayer2013-01-101-0/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: Use a temporary buffer for dither/Noise shaping when the input is read onlyMichael Niedermayer2013-01-101-14/+17
| | | | | | This avoids copying the input Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add seperate in/out pointers to the noise shaping codeMichael Niedermayer2013-01-101-4/+4
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: rename dither_pos to noise_posMichael Niedermayer2013-01-101-6/+6
| | | | | | THis more closely matches what the field represents Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: fix the noise sample type for noise shapingMichael Niedermayer2013-01-091-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: split swri_dither_init() outMichael Niedermayer2013-01-091-1/+3
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: remove unused variableMichael Niedermayer2013-01-091-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: move dither related fields to their own contextMichael Niedermayer2013-01-091-24/+24
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: update copyright years of a few files iam working onMichael Niedermayer2013-01-091-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: Implement Noise shaping ditherMichael Niedermayer2013-01-091-13/+29
| | | | | | | | | | | | | | | The following variants are implemented: lipshitz noise shaping dither shibata noise shaping dither low shibata noise shaping dither high shibata noise shaping dither f-weighted noise shaping dither modified-e-weighted noise shaping dither improved-e-weighted noise shaping dither Data tables taken from SOX Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: use SIMD for ditheringMichael Niedermayer2013-01-091-3/+14
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: fix assertion failure if dither is used without the preout buffer ↵Michael Niedermayer2013-01-081-0/+5
| | | | | | differing from in Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lswr: Improve default resampler's default parametersAlexander Strasser2013-01-041-1/+1
| | | | | | | | | | | | | | After making some blind tests on a small collection of music samples for home usage. It turned out that the default cutoff was too low. The impact of filter_size was not clearly distinguishable (the results were on the edge) with the music samples but turned out to be clearly audible in some synthetic samples. Thanks to Daniel for helping out with the listening tests. Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
* lswr: improve rematrixing error message.Nicolas George2012-12-311-1/+5
| | | | | Report channel layout/count for insufficiently determined rematrixing.
* docs: add soxr documentationRob Sykes2012-12-271-6/+8
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: support -async X as a simple way to do what ffmpeg -async X didMichael Niedermayer2012-12-251-0/+10
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: Add SOX resampler supportRob Sykes2012-12-111-2/+9
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add a lowpass default so that each Resampler can have its own default.Rob Sykes2012-12-111-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: move flush into ResamplerMichael Niedermayer2012-12-111-18/+6
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: make realloc_audio() available outside swresample.cMichael Niedermayer2012-12-111-11/+11
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: Add API to make resample engine selectable.Rob Sykes2012-12-111-5/+43
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lswr/swresample: use AV_OPT_TYPE_SAMPLE_FMT for sample format optionsStefano Sabatini2012-12-031-6/+6
| | | | Improve usability and robustness.
* swr: set default channel count options to 0.Clément Bœsch2012-11-191-4/+4
| | | | | | If not set, they will be defined using the channel layout setting, which is much more convenient when using swr_alloc() instead of swr_alloc_set_opts().
* Replace rest of libavutil/audioconvert.h with libavutil/channel_layout.hPaul B Mahol2012-11-131-1/+1
| | | | | | Also remove it in once case when it is not needed. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lswr/swresample: adopt globally consistent rules for options help messageStefano Sabatini2012-11-031-55/+62
| | | | | | | | | The help text tells what the option does, not what the accepted parameter is. Thus convert strings of the kind: Bikeshed Color to set bikeshed color