Commit Graph

154 Commits

Author SHA1 Message Date
James Almer
d68c05380c x86: check for AV_CPU_FLAG_AVXSLOW where useful
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 12:07:11 +02:00
Luca Barbato
0ac8ff618c avresample: Reallocate the internal buffer to the correct size
Fixes the corner case in which the internal buffer size
is larger than input buffer provided and resizing it
before moving the left over samples would make it write
to now unallocated memory.

Bug-Id: 825
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-28 23:51:51 +02:00
Vittorio Giovara
1a3eb042c7 Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Peter Meerwald
12655c4804 libavresample: NEON optimized FIR audio resampling
modelled after aarch64 code

on Cortex-A8, s16 and s32 code is about 2x faster,
float code about 7x faster

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-21 22:08:39 +02:00
Peter Meerwald
df0891fc8f libavresample: Annotate AARCH64 init function with av_cold
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-20 19:32:37 +02:00
Luca Barbato
963f761448 avresample: Make sure the even check does not overflow
CC: libav-stable@libav.org
Bug-Id: CID 732225
2014-10-18 16:15:10 +01:00
Vittorio Giovara
088eca2816 avresample: prevent theoretical division by zero
CC: libav-stable@libav.org
Bug-Id: CID 1231986
2014-10-18 16:15:10 +01:00
Luca Barbato
11db644a8e lavr: Update the planar check in ff_audio_convert
Leftover from fbc0b86599.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-17 16:11:02 +02:00
Luca Barbato
fb1ddcdc8f avresample: Introduce AVFrame-based API 2014-08-10 14:26:37 +02:00
Anton Khirnov
1985c2e75c Bump major versions of all libraries. 2014-08-09 16:58:33 +00:00
Anton Khirnov
f4c444e17d Postpone API-incompatible changes until the next bump. 2014-08-09 16:57:10 +00:00
Justin Ruggles
fbc0b86599 lavr: Do not change the sample format for mono audio
This treats mono as planar internally within libavresample rather
than changing the sample format.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-03 23:13:26 +02:00
Luca Barbato
b2d4565422 avresample: Add avresample_get_out_samples
Utility function to get the upper bound on the number of samples the
resampler would output.
2014-05-28 22:04:56 +02:00
Janne Grunau
449511740f build: handle library dependencies in configure
Instead of setting FFLIBS in each library Makefile configure
exports FFLIBS-$library in config.mak.
2014-05-13 20:02:01 +02:00
Janne Grunau
a24a252709 aarch64: NEON optimized FIR audio resampling
Optimized for the default filter length 16.

30% faster opus silk decoding.
2014-04-24 18:28:26 +02:00
Janne Grunau
cae8df7875 lavr: define ResampleContext in resample.h
Required for arch optimized resampling.
2014-04-24 18:28:26 +02:00
Janne Grunau
f4d5a2cc35 aarch64: NEON float to s16 audio conversion 2014-04-22 19:35:41 +02:00
Anton Khirnov
21d8f4da91 resample: remove an unneeded context variable 2014-04-17 20:08:19 +02:00
Anton Khirnov
ac976ed91e lavr: allocate the resampling buffer with a positive size
This fixes cases where very few input samples (fewer than needed for one
output sample) are passed to lavr at the beginning.
CC:libav-stable@libav.org
2014-04-13 11:21:20 +02:00
Anton Khirnov
f7c5fd8151 resample: implement flushing 2014-04-13 11:15:45 +02:00
Anton Khirnov
254c95cdd1 resample: split linear into its own function 2014-04-11 16:34:02 +02:00
Anton Khirnov
be394968c8 resample: add initial padding explicitly
This simplifies the code, since we do not have to deal with a possibly
negative source index anymore.
2014-04-11 16:33:46 +02:00
Anton Khirnov
eed752d61d resample: drop useless abs()
negative sample_index is handled in the block above.
2014-04-11 16:28:11 +02:00
Anton Khirnov
3c84f6b5d2 resample: reindent 2014-04-11 16:27:22 +02:00
Anton Khirnov
f20892eb67 resample: split the nearest neighbour path into a separate function pointer 2014-04-11 16:26:36 +02:00
Anton Khirnov
b9dea23766 resample: fix avresample_get_delay() return value
The correct "next" input sample is not the first sample of the
resampling buffer, but the center sample of the filter_length-sized
block at the beginning.

CC:libav-stable@libav.org
2014-04-11 16:21:25 +02:00
Diego Biurrun
01c5779f56 x86: Drop some unnecessary YASM ifdefs
Dead code elimination is enough to avoid undefined references in these cases.
2014-04-04 19:08:05 +02:00
Diego Biurrun
aba70bb538 Add missing headers to make template files compile (more) standalone 2014-03-26 04:31:27 -07:00
Anton Khirnov
1db03a6864 lavr: return an error if a avresample_open() is called on an open context 2014-02-22 20:53:09 +01:00
Anton Khirnov
7e86c27b4e lavr: add a function for checking whether AVAudioResampleContext is open 2014-02-22 20:52:36 +01:00
Tim Walker
76a75c523c lavr: mix front center channel as indicated in the ATSC A/52 specification.
When mixing 3 front channels into 2, the center channel is mixed into left and right with the center mix level, not -3dB.
2014-02-08 13:42:55 +01:00
Martin Storsjö
5bcbb516f2 arm: Add X() around all references to extern symbols
Don't rely on the fact that an unprefixed label currently exists.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-02-07 15:13:58 +02:00
Janne Grunau
fe96769bed aarch64: port neon clobber test from arm 2014-01-15 12:31:07 +01:00
Martin Storsjö
99e2012523 x86/arm: Add clobber tests to libavresample
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-13 14:13:27 +02:00
Anton Khirnov
cc976a75df audio_mix: print (SKIP) instead of 0.0 for matrix columns removed along with output zeroing 2014-01-03 16:43:25 +01:00
Anton Khirnov
fc6a3ef40d audio_mix: fix zeroing output channels in certain cases
Specifically, when the corresponding input channel exists and its matrix
column is all-zero (which is necessary for zeroing the output), the
matrix column must be removed from the matrix.

This is not done currently, so the mixing code would end up using
uninitialized pointers from stack.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-01-03 16:42:46 +01:00
Anton Khirnov
3d95d27376 audio_mix: initialize the data pointers to NULL
This should make it easier to catch problems where some of those
pointers are used uninitialized, since reading from NULL should always
crash, while random numbers from stack can turn out to be valid
pointers, so random memory may be silently overwritten.
2014-01-03 16:42:23 +01:00
Diego Biurrun
b83d1ee3b4 avutil: Move library version related macros to version.h
This is a more sensible place for these macros.
2013-12-26 19:05:22 +01:00
Diego Biurrun
8f8bc92365 Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
Justin Ruggles
211ca69b13 lavr: check that current_buffer is not NULL before using it
Fixes a segfault during resampling when compiled with -DDEBUG.
Fixes all fate-lavr-resample tests with -DDEBUG.

CC:libav-stable@libav.org
2013-10-27 15:07:10 -04:00
Derek Buitenhuis
206895708e x86inc: Remove our FMA4 support
This is so we can sync to x264's version of FMA4 support.

This partialy reverts commit 79687079a9.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-14 12:39:29 +01:00
Derek Buitenhuis
15748773bf avresample/x86: Switch operand order for mulps
With the forthcoming VEX instruction emulation, mulps
must have only the third operand point to memory, as
this is what vmulps expects.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-14 12:36:11 +01:00
Anton Khirnov
df6737a55f audio_mix: fix channel order in mix_1_to_2_fltp_flt_c
CC:libav-stable@libav.org
2013-10-12 15:06:55 +02:00
Diego Biurrun
b5a138652f Give less generic names to global library option arrays 2013-08-02 19:19:02 +02:00
Diego Biurrun
03039f4c8c miscellaneous typo fixes 2013-07-25 19:43:32 +02:00
Diego Biurrun
3ac7fa81b2 Consistently use "cpu_flags" as variable/parameter name for CPU flags 2013-07-18 00:31:35 +02:00
Anton Khirnov
006ec64877 lavr doxy: add version.h to the lavr group 2013-05-17 20:27:48 +02:00
Diego Biurrun
e445647b4f avresample: Add av_cold attributes to init functions missing them 2013-05-04 21:10:05 +02:00
Diego Biurrun
b6649ab503 cosmetics: Remove unnecessary extern keywords from function declarations 2013-03-27 14:21:45 +01:00
Justin Ruggles
b2eea615c0 lavr: allow setting internal_sample_fmt option by string 2013-02-23 17:07:54 -05:00