summaryrefslogtreecommitdiff
path: root/libswresample/rematrix.c
Commit message (Collapse)AuthorAge
* swresample/rematrix: handle 22.2 as a 9 channel layoutJan Ekström2020-08-18
| | | | | | | | | | | This is as far as 22.2 follows the same channel order as WaveFormatExtensible's channel mask (and the AV_CH_* defines). After LFE2 the side channels would follow, but that offset of one stops us from utilizing them without further tweaks. This change was verified by using swresample to downmix to 5.1, and then feeding that to WASAPI.
* swresample/rematrix: treat 22.2 as 5.1 (back) when mixingJan Ekström2020-08-04
| | | | | | | | | Only this sub-set of channels actually follows the bit mask order in the official 22.2 channel mapping. Additionally, the 5.1 channels are there for backwards compatibility with the previous system. This enables the utilization of 22.2 content until a proper down/up matrix is added into swresample.
* swresample/matrix: switch internal clean_layout function to not drop high bitsJan Ekström2020-08-04
| | | | | | These bits are utilized by channel layouts such as 22.2. If those are dropped, the returned channel layout is no longer a match against the AV_CH_LAYOUT define when returned from this function.
* swresample: Use channel count in rematrix initializationMarcin Gorzel2018-07-26
| | | | | | | | 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 <michael@niedermayer.cc>
* swresample/rematrix: fix update of channel matrix if input or output layout ↵Tobias Rapp2018-02-19
| | | | | | | | | 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 <t.rapp@noa-archive.com>
* lswr/rematrix: Support s32p.Carl Eugen Hoyos2017-11-01
| | | | Fixes ticket #6785.
* build: Generalize yasm/nasm-related variable namesDiego Biurrun2017-06-21
| | | | | | | | None of them are specific to the YASM assembler. (Cherry-picked from libav commit 39e208f4d4756367c7cd2d581847e0c1b8a429c1) Signed-off-by: James Almer <jamrial@gmail.com>
* lswr/rematrix: Remove an aggressive loop optimization.Carl Eugen Hoyos2017-02-25
| | | | | 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-26
| | | | | | Fixes Ticket #5897. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swresample: Add swr_build_matrix()Michael Niedermayer2016-09-27
| | | | | | | API and Doxy documentation is taken from avresample_build_matrix() Fixes: Ticket5780 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swresample: Use double and float for matrixes for best quality and speedMichael Niedermayer2016-09-27
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swresample/rematrix: Use clipping s16 rematrixing if overflows are possibleMichael Niedermayer2016-05-15
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swresample/rematrix: Use error diffusion to avoid error in the DC component ↵Michael Niedermayer2016-05-15
| | | | | | | | | | | 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 <michael@niedermayer.cc>
* swresample: slightly nicer debug output for auto matrixwm42015-10-15
| | | | This is the matrix that will be used for up/downmixing.
* libswresample/rematrix: Check for malloc errorsMichael Niedermayer2015-06-04
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: Allow reinitialization without ever setting channel layoutsMichael Niedermayer2015-04-12
|
* swresample/x86/rematrix_init: Check av_malloc* return codes, forward errorsMichael Niedermayer2015-02-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libswresample: move condition to start of loop.Reimar Döffinger2014-09-07
| | | | | | | | | 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 <Reimar.Doeffinger@gmx.de>
* Remove pointless if.Reimar Döffinger2014-09-07
| | | | | | A branch to avoid some calculation seems unlikely to have any benefits. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* libswresample: Avoid needlessly large on-stack array.Reimar Döffinger2014-09-07
| | | | | | | | 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 <Reimar.Doeffinger@gmx.de>
* swresample: fix AV_CH_LAYOUT_STEREO_DOWNMIX inputMichael Niedermayer2014-04-24
| | | | | | Fixes Ticket 3542 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lswr: fix assert failure on unknown layouts.Nicolas George2013-11-03
|
* swr/rematrix: Fix handling of AV_CH_LAYOUT_STEREO_DOWNMIX outputMichael Niedermayer2013-08-20
| | | | | | | | | | 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 <michaelni@gmx.at>
* swr: clean layouts before checking sanityMichael Niedermayer2013-08-20
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: fix negative rematrix volumnsMichael Niedermayer2013-07-22
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample: Make rematrix maxvalue user settableMichael Niedermayer2013-07-22
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add native_simd_oneMichael Niedermayer2013-06-04
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swresample/rematrix: add S32 mixing codeMichael Niedermayer2013-06-04
| | | | | | Needed for dithering S32 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/rematrix: use av_calloc()Michael Niedermayer2013-04-15
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/rematrix: move templating parameters to template itself.Clément Bœsch2012-11-15
|
* Replace rest of libavutil/audioconvert.h with libavutil/channel_layout.hPaul B Mahol2012-11-13
| | | | | | Also remove it in once case when it is not needed. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* swr/rematrix: fix C99 left shift overflowMichael Niedermayer2012-10-14
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add av_cold to init/free functionsMichael Niedermayer2012-09-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/auto_matrix: treat a single channel as mono instead of failingMichael Niedermayer2012-09-08
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/auto_matrix: treat stereo downmix like stereo.Michael Niedermayer2012-09-08
| | | | | Based on code by John Stebbins Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/auto_matrix: add clean layout functionMichael Niedermayer2012-09-08
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr/auto_matrix: move layouts to local variablesMichael Niedermayer2012-09-08
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Add Dolby/DPLII downmix support to libswresampleMichael Niedermayer2012-09-07
| | | | | | Based on code by John Stebbins <jstebbins.hb@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: update rematrix coeffs to match AC-3Michael Niedermayer2012-09-07
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: fix warning: passing argument 2 of s->mix_any_f from incompatible ↵Michael Niedermayer2012-07-02
| | | | | | pointer type Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: fix mix* related function pointer warningsMichael Niedermayer2012-07-02
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lswr/rematrix: specify explicitly the name of the unsupported channel layoutsStefano Sabatini2012-06-21
| | | | Help debugging.
* swr: mix_2_1_int16_mmx/sseMichael Niedermayer2012-06-12
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: mix_1_1 int16 MMXMichael Niedermayer2012-06-12
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: SIMD rematrixing and SSE/AVX mix_1_1 floatMichael Niedermayer2012-06-12
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add native matrix for SIMDMichael Niedermayer2012-06-12
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: skip memset(0) in rematrix when the array is known to be already 0Michael Niedermayer2012-06-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: 5.1->stereo double, float and s16Michael Niedermayer2012-06-08
| | | | | | 2.5 times faster than the generic code Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add all in one rematrixing function ptrMichael Niedermayer2012-06-08
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* swr: add inrermediate sample type for rematrixingMichael Niedermayer2012-06-08
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>