summaryrefslogtreecommitdiffstats
path: root/libswresample/rematrix.c
Commit message (Collapse)AuthorAgeFilesLines
* swresample: Use channel count in rematrix initializationMarcin Gorzel2018-07-261-2/+2
| | | | | | | | Rematrixing supports up to 64 channels. However, there is only a limited number of channel layouts defined. Since the in/out channel count is currently obtained from the channel layout, for undefined layouts (e.g. for 9, 10, 11 channels etc.) the rematrixing fails. This patch changes rematrix init methods to use in (used) and out channel count directly instead of computing it from channel layout. Signed-off-by: Michael Niedermayer <[email protected]>
* swresample/rematrix: fix update of channel matrix if input or output layout ↵Tobias Rapp2018-02-191-2/+4
| | | | | | | | | is undefined Prefer direct in/out channel count values over channel layout, when available. Fixes a pan filter bug (ticket #6790). Signed-off-by: Tobias Rapp <[email protected]>
* lswr/rematrix: Support s32p.Carl Eugen Hoyos2017-11-011-5/+14
| | | | Fixes ticket #6785.
* build: Generalize yasm/nasm-related variable namesDiego Biurrun2017-06-211-1/+1
| | | | | | | | None of them are specific to the YASM assembler. (Cherry-picked from libav commit 39e208f4d4756367c7cd2d581847e0c1b8a429c1) Signed-off-by: James Almer <[email protected]>
* lswr/rematrix: Remove an aggressive loop optimization.Carl Eugen Hoyos2017-02-251-3/+4
| | | | | Fixes undefined behaviour and a gcc warning: libswresample/rematrix.c:376:47: warning: iteration 64 invokes undefined behavior
* swresample/rematrix: Fix float part of swr_set_matrix()Vodyannikov Aleksandr2016-10-261-4/+2
| | | | | | Fixes Ticket #5897. Signed-off-by: Michael Niedermayer <[email protected]>
* swresample: Add swr_build_matrix()Michael Niedermayer2016-09-271-71/+86
| | | | | | | API and Doxy documentation is taken from avresample_build_matrix() Fixes: Ticket5780 Signed-off-by: Michael Niedermayer <[email protected]>
* swresample: Use double and float for matrixes for best quality and speedMichael Niedermayer2016-09-271-1/+10
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swresample/rematrix: Use clipping s16 rematrixing if overflows are possibleMichael Niedermayer2016-05-151-3/+16
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swresample/rematrix: Use error diffusion to avoid error in the DC component ↵Michael Niedermayer2016-05-151-3/+9
| | | | | | | | | | | of the matrix This fixes the sum of the integer coefficients ending up summing to a value larger than the value representing unity. This issue occurs with qN0.dts when converting to stereo Signed-off-by: Michael Niedermayer <[email protected]>
* swresample: slightly nicer debug output for auto matrixwm42015-10-151-2/+7
| | | | This is the matrix that will be used for up/downmixing.
* libswresample/rematrix: Check for malloc errorsMichael Niedermayer2015-06-041-0/+8
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swresample: Allow reinitialization without ever setting channel layoutsMichael Niedermayer2015-04-121-2/+2
|
* swresample/x86/rematrix_init: Check av_malloc* return codes, forward errorsMichael Niedermayer2015-02-091-1/+2
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* libswresample: move condition to start of loop.Reimar Döffinger2014-09-071-4/+6
| | | | | | | | | This avoids several issue like calculating sum/maxcoef incorrectly due to adding up matrix entries that will be overwritten, as well as out-of-range writes to s->matrix if the maximum allowed number of channels is used. Signed-off-by: Reimar Döffinger <[email protected]>
* Remove pointless if.Reimar Döffinger2014-09-071-3/+1
| | | | | | A branch to avoid some calculation seems unlikely to have any benefits. Signed-off-by: Reimar Döffinger <[email protected]>
* libswresample: Avoid needlessly large on-stack array.Reimar Döffinger2014-09-071-5/+9
| | | | | | | | We only actually need to use a tiny part of it. Unfortunately we seem to have no real test coverage on the code, so this is a bit risky. Signed-off-by: Reimar Döffinger <[email protected]>
* swresample: fix AV_CH_LAYOUT_STEREO_DOWNMIX inputMichael Niedermayer2014-04-241-0/+5
| | | | | | Fixes Ticket 3542 Signed-off-by: Michael Niedermayer <[email protected]>
* lswr: fix assert failure on unknown layouts.Nicolas George2013-11-031-2/+2
|
* swr/rematrix: Fix handling of AV_CH_LAYOUT_STEREO_DOWNMIX outputMichael Niedermayer2013-08-201-3/+5
| | | | | | | | | | Fixes Ticket2859 Note, testcases related to the downmix channels are welcome. (id like to make sure this is working correctly now, as obviously it didnt work before ...) Signed-off-by: Michael Niedermayer <[email protected]>
* swr: clean layouts before checking sanityMichael Niedermayer2013-08-201-1/+2
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swresample: fix negative rematrix volumnsMichael Niedermayer2013-07-221-1/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swresample: Make rematrix maxvalue user settableMichael Niedermayer2013-07-221-2/+11
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add native_simd_oneMichael Niedermayer2013-06-041-0/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swresample/rematrix: add S32 mixing codeMichael Niedermayer2013-06-041-0/+15
| | | | | | Needed for dithering S32 Signed-off-by: Michael Niedermayer <[email protected]>
* swr/rematrix: use av_calloc()Michael Niedermayer2013-04-151-3/+3
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr/rematrix: move templating parameters to template itself.Clément Bœsch2012-11-151-33/+8
|
* 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 <[email protected]>
* swr/rematrix: fix C99 left shift overflowMichael Niedermayer2012-10-141-1/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add av_cold to init/free functionsMichael Niedermayer2012-09-091-3/+3
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr/auto_matrix: treat a single channel as mono instead of failingMichael Niedermayer2012-09-081-0/+7
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr/auto_matrix: treat stereo downmix like stereo.Michael Niedermayer2012-09-081-0/+2
| | | | | Based on code by John Stebbins Signed-off-by: Michael Niedermayer <[email protected]>
* swr/auto_matrix: add clean layout functionMichael Niedermayer2012-09-081-1/+9
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr/auto_matrix: move layouts to local variablesMichael Niedermayer2012-09-081-35/+37
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* Add Dolby/DPLII downmix support to libswresampleMichael Niedermayer2012-09-071-6/+42
| | | | | | Based on code by John Stebbins <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* swr: update rematrix coeffs to match AC-3Michael Niedermayer2012-09-071-2/+7
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: fix warning: passing argument 2 of s->mix_any_f from incompatible ↵Michael Niedermayer2012-07-021-1/+1
| | | | | | pointer type Signed-off-by: Michael Niedermayer <[email protected]>
* swr: fix mix* related function pointer warningsMichael Niedermayer2012-07-021-9/+9
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* lswr/rematrix: specify explicitly the name of the unsupported channel layoutsStefano Sabatini2012-06-211-2/+5
| | | | Help debugging.
* swr: mix_2_1_int16_mmx/sseMichael Niedermayer2012-06-121-1/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: mix_1_1 int16 MMXMichael Niedermayer2012-06-121-1/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: SIMD rematrixing and SSE/AVX mix_1_1 floatMichael Niedermayer2012-06-121-2/+20
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add native matrix for SIMDMichael Niedermayer2012-06-121-0/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: skip memset(0) in rematrix when the array is known to be already 0Michael Niedermayer2012-06-091-1/+2
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: 5.1->stereo double, float and s16Michael Niedermayer2012-06-081-0/+3
| | | | | | 2.5 times faster than the generic code Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add all in one rematrixing function ptrMichael Niedermayer2012-06-081-0/+7
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add inrermediate sample type for rematrixingMichael Niedermayer2012-06-081-0/+5
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add double precision support to the rematrix codeMichael Niedermayer2012-05-021-0/+30
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: add lfe_mix_levelJustin Ruggles2012-05-021-0/+11
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* swr: update side to back mixing.Justin Ruggles2012-05-021-2/+9
| | | | Signed-off-by: Michael Niedermayer <[email protected]>