Ganesh Ajjanagadde
ef62f573ca
swresample/swresample_internal: add av_warn_unused_result
...
This will trigger a few warnings that need to be fixed.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
wm4
cdf4a13f86
swresample: slightly nicer debug output for auto matrix
...
This is the matrix that will be used for up/downmixing.
9 years ago
Ganesh Ajjanagadde
f3fc103c6a
doc/resampler, swresample/options: use proper capitalization
...
Proper names should be capitalized in all user facing API as far as
possible. The option names themselves have not been changed since:
1. We consistently keep option names in lower case.
2. Changing them would break existing scripts.
3. I suspect that we want to be similar to Sox and its relevant options.
The converse is also true: improper names should not be capitalized
generally.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
1bc873acd6
swresample/resample: manually unroll the main loop in bessel()
...
About 10% faster
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
6024c865ef
swresample/resample: merge first iteration into init in bessel()
...
speedup of about 1%
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
James Almer
acdd672506
x86/audio_convert: fix clobbering of xmm registers
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
9 years ago
Michael Niedermayer
7d636d02b1
swresample/dither_template: Add missing license header
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
32f53958b8
swresample/swresample: Fix integer overflow in seed calculation
...
Fixes CID1322333
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
fb42e77516
swresample/swresample-test: Make layouts static const
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Ganesh Ajjanagadde
24e6729a04
swresample/dither: use integer arithmetic
...
This fixes a -Wabsolute-value reported by clang 3.5+ complaining about misuse of fabs() for integer absolute value.
An additional benefit is the removal of floating point calculations.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
James Almer
5750d6c5e9
x86: move XOP emulation code back to x86inc
...
Only two functions that use xop multiply-accumulate instructions where the
first operand is the same as the fourth actually took advantage of the macros.
This further reduces differences with x264's x86inc.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
9 years ago
James Almer
f37a5dcb55
swresample/x86: add missing colon to labels
...
Silences warnings with Nasm
Signed-off-by: James Almer <jamrial@gmail.com>
9 years ago
Carl Eugen Hoyos
a77401e1f7
lswr: Allow 64 channels internally.
9 years ago
Michael Niedermayer
d4325b2fea
swr: Remember previously set int_sample_format from user
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0dd2790df5
swresample/swresample: Clear delayed_samples_fixup in clear_context()
...
This probably makes no difference but its more proper
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Rob Sykes
c70c6be225
swresample: soxr implementation for swr_get_out_samples()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5de3a589f1
swresample/swresample: Print used int_sample_fmt
...
Suggested-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
4977692461
swresample: Choose 16bit internally only if input and output is 16bit or less
...
or if no rematrix and no resampling is performed and the input is 16bit
note reampling and rematrix itself always use more than 16bit internally
the "internal" sampling format is the format between these steps
Its unlikely the difference from this commit is audible in any case
unless there is some bug either before or after the change.
but multiple people prefer this and it slightly improves the precission
of computations.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
56f0fe6b84
swr: Fix ASSERT_LEVEL warning
...
Found-by: cehoyos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Clément Bœsch
c5a08956a3
swresample: fix initilaize/initialize typo
10 years ago
Michael Niedermayer
b14361486b
swresample/resample: fix typos
...
Found-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
c3f87f7545
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>
10 years ago
Michael Niedermayer
cc17b43d8d
swresample: Add swr_get_out_samples()
...
Previous version reviewed-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Previous version reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
52acd22a7d
libswresample/rematrix: Check for malloc errors
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Ganesh Ajjanagadde
196b885a5f
swresample/dither: check memory allocation
...
check memory allocation in swri_get_dither()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
02915602d9
swresample: Check the return value of resampler->init()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
c16e99e3b3
x86: check for AV_CPU_FLAG_AVXSLOW where useful
...
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Rainer Hochecker
adb7372f74
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>
10 years ago
Michael Niedermayer
223a859853
swresample/dither_template: Do not define macro functions to nothing
...
This avoids potential warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ff50b1b13b
swresample/swresample-test: Randomly wipe out channel counts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
3c77bb5f23
swresample: Check channel layouts and channels against each other and print human readable error messages
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
80a28c7509
swresample: Allow reinitialization without ever setting channel layouts
10 years ago
Michael Niedermayer
d7b9cb2f7a
swresample: Allow reinitialization without ever setting channel counts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
43482bd1a5
swr/resample: use av_clip functions
...
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1a10134e20
swresample/swresample: Use av_mallocz_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
e16592c42e
swresample/resample: Fix undefined shifts
...
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
4d00860ac7
swresample: Add prefix to soxr_resampler
...
also move declaration to header
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
c0e3b46118
swresample: add av_cold to init functions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0cb95f9082
swresample/resample_template: Add () to protect the arguments of the OUT() macro
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
37013fd018
swresample/swresample-test: Add () to protect uint_rand() argument
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
f7ed997a6d
x86/swr: make pack_8ch functions work with compilers without aligned stack
...
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Michael Niedermayer
b74ecb82fa
swresample/x86/rematrix_init: Check av_malloc* return codes, forward errors
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
48ffaaaaef
swresample/x86/rematrix_init: Use av_mallocz_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
9d7ae72725
swresample: Use int instead of enum for fields which are accessed through AVOptions as int
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
c77cc2c176
swresample/dither: Cleanup number suffixes
...
The <<31 case needs LL
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Reimar Döffinger
6efd0ba977
swresample_internal.h: Move struct declaration before first use.
...
It seems more logical and works with more restricted C compilers
like tinycc.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
10 years ago
James Almer
59ac93f6af
x86/swr: add SSE/AVX unpack_6ch functions
...
int32/float only
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
James Almer
6abf00d615
x86/swr: load constants outside the loop in pack_6ch functions
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
James Almer
975ff6a3c6
x86/swr: disable pack_8ch functions on msvc/icl x86_32
...
Until a proper fix is committed.
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
James Almer
5f14f9e984
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>
10 years ago