Commit Graph

478 Commits

Author SHA1 Message Date
Michael Niedermayer 7ff8f9a604 swr: Remember previously set int_sample_format from user
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4325b2fea)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer de943a3460 swresample/swresample: Cleanup on init failure.
This avoids leaks if the user doest call swr_close() after a failed init

Found-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3f87f7545)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Ganesh Ajjanagadde 3dc303a051 swresample/dither: check memory allocation
check memory allocation in swri_get_dither()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 196b885a5f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer fd989ff9ca swresample: Check the return value of resampler->init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 02915602d9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Rainer Hochecker 63d484c342 swr: fix alignment issue caused by 8ch sse functions
Fix crash when doing 8 ch conversion from apps compiled with MSVS
Thanks to Ronald for giving this hint:
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-May/173049.html

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit adb7372f74)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer 41b15817ce swresample/swresample-test: Randomly wipe out channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff50b1b13b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer 07ea57c5bb swresample: Check channel layouts and channels against each other and print human readable error messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c77bb5f23)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer 84fedd3be7 swresample: Allow reinitialization without ever setting channel layouts
(cherry picked from commit 80a28c7509)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer 74fb9df48b swresample: Allow reinitialization without ever setting channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d7b9cb2f7a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
James Almer 2a6d16ba5f x86/swr: add missing alignment check to pack_6ch functions
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5f14f9e984)
2015-02-12 15:43:43 -03:00
Michael Niedermayer 1e366c15ed swresample/dither: Cleanup number suffixes
The <<31 case needs LL

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c77cc2c176)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer 9f8cdd520b Add FFMPEG_VERSION into the binary libs
This simplifies identifying from which revision a binary of a lib came from

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 649c158e8c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:56 +01:00
Rob Sykes 9783d5bfda swresample/soxr_resample: fix error handling
Fixes CID1257659

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b6f225374)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-13 22:20:16 +01:00
James Almer edff061fb0 x86/swr: add ff_float_to_int32_a_avx2
13797 decicycles in ff_float_to_int32_a_sse2, 32768 runs, 0 skips
8603 decicycles in ff_float_to_int32_a_avx2, 32766 runs, 2 skips

Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2014-11-07 15:01:35 -03:00
James Almer b385c4c6a3 x86/swr: replace sse4 instructions in pack_6ch with sse ones
There's no benefit from using blendps here except on CPUs with AVX, where
it's faster than shufps according to Intel's documentation.
As such, rename the sse4 functions to sse/sse2 and use shufps instead.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2014-11-06 20:54:00 -03:00
Michael Niedermayer e4f8a973aa swresample: Fix swr_drop_output so it does not flush the buffers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-04 17:17:23 +01:00
Michael Niedermayer f6bb2cd1b0 swresample/resample: fix invert_initial_buffer() after flush
Fixes: asan_heap-uaf_2071250_7_139.ogg
Fixes: assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-16 22:35:27 +02:00
Michael Niedermayer 080c846f59 swresample: do not put multiple statements in one line
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-16 18:18:40 +02:00
Michael Niedermayer 344f8d307a swresample/audioconvert: Fix undefined behavior (left shift of negative value)
Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-08 05:35:06 +02:00
Michael Niedermayer 6b347f519d swresample/swresample: replace always true if() by av_assert0()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 01:29:15 +02:00
Michael Niedermayer f9fefa499f swresample/swresample: fix sample drop loop end condition
Fixes Ticket3985

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 01:29:06 +02:00
Reimar Döffinger 2c5c37ade1 libswresample: move condition to start of loop.
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>
2014-09-07 11:31:34 +02:00
Reimar Döffinger 284123d7fd Remove pointless if.
A branch to avoid some calculation seems unlikely to have any benefits.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-09-07 11:31:33 +02:00
Reimar Döffinger 2231d5b671 libswresample: Avoid needlessly large on-stack array.
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>
2014-09-07 11:31:33 +02:00
Michael Niedermayer 7c51f5bd39 swr: aarch64 audio_convert and neon clobber test
Ported from avresample
Code by:  Mans Rullgard, Janne Grunau, Martin Storsjo

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-27 20:06:37 +02:00
Michael Niedermayer b7d5e016a3 swresample: Add AVFrame based API
Based on commit fb1ddcdc8f by Luca Barbato <lu_zero@gentoo.org>
Adapted for libswresample by Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-16 20:39:37 +02:00
Michael Niedermayer f4e814f787 swresample: check av_opt_set for failure in swr_alloc_set_opts()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 01:34:34 +02:00
Luca Barbato c4ac48c5a1 swresample: document the need to configure the context using AVOptions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 00:35:56 +02:00
Michael Niedermayer 97f8c7a03e bump libpostproc and libswresample
this is needed / avoids some headaches  as one of their dependancies
(libavutil) was bumped

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 01:17:02 +02:00
Michael Niedermayer 74be0f82a7 swresample-test: make it independant of the internal SWR_CH_MAX
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 01:15:43 +02:00
Michael Niedermayer 05ff1a2c05 swresample/swresample: Treat mono as planar
This might in some cases improve performance.

Idea from: fbc0b86599
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 03:05:05 +02:00
Andreas Cadhalpun 39a6e02fd4 fix spelling errors
Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-12 22:33:27 +02:00
Michael Niedermayer 52fafaf474 swresample/libswresample.v: hide ff_*
Found-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-12 18:40:17 +02:00
Timothy Gu 5b58692ed4 swresample: misc. doxy improvements
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-08 01:36:56 +02:00
Timothy Gu 064945b3aa swresample: organize functions into doxy groups
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 22:07:15 +02:00
Timothy Gu 81f47e272d swresample: better doxy for configuration-returning functions
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 22:06:51 +02:00
Timothy Gu 2711b4708a swresample: improve Doxygen introduction
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 21:41:31 +02:00
Timothy Gu 77c5f546e7 swresample: add SwrContext doxy
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 20:58:58 +02:00
Timothy Gu fc71434e84 swresample: add SwrDitherType doxy
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 20:58:41 +02:00
Timothy Gu c0d9b026f9 swresample: group all the option constants in a section in doxy
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 20:58:34 +02:00
Timothy Gu 0c58388211 swresample: grammar/capitalization fixes
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 20:46:06 +02:00
Timothy Gu 37715b4594 swresample: split option table to a separate file
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-06 03:45:46 +02:00
James Almer 9937362c54 x86/swr: use lavu helper macros to check CPU extensions
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-04 02:12:16 +02:00
James Almer 8279a15284 x86/swr: split audioconvert and rematrix DSP into separate files
Also rename resample_x86_dsp.c to resample_init.c

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-04 02:00:11 +02:00
James Almer 857cd1f33b swr: initialize only the necessary resample dsp functions
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-04 01:37:41 +02:00
James Almer b5f0eac068 swr: rename swresample_dsp init functions to swri_resample_dsp
The swresample_ prefix is not for internal functions

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-02 13:18:30 +02:00
James Almer 42a92a240d swr: remove obsolete resample prototypes
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-02 03:14:45 +02:00
James Almer 23a9edf531 Partially revert "swr: add prototypes for resample dsp functions"
Prototypes are not needed anymore now that the x86 functions don't
include resample_template.c

The DO_RESAMPLE_ONE macro is removed for that same reason as well.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-02 03:14:36 +02:00
James Almer c45b7f0d80 x86/swr: add ff_resample_{common, linear}_int16_xop
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-02 01:11:20 +02:00
James Almer 1a69224f44 x86/swr: add ff_resample_{common, linear}_float_fma
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-02 01:09:53 +02:00