Commit Graph

252 Commits

Author SHA1 Message Date
Michael Niedermayer f88f705abc swr: add swr_drop_output()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer 7a59964ba9 swr: add swr_inject_silence()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer 72872d0201 swr: Fix issue with injecting more data than can be used up in the next call.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer c5c355546d swr: add some asserts to resample()
These check that the internal and input buffers match in format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer 75e25f8540 swr: add reversefill_audiodata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer 5027e3daf7 swr: fix buf_set() so it works with input == output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer bdbfd4569d swr: make literal 32 a named constant in realloc_audio()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer 186be49fd5 swr: fill_audio_data() support NULL
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-19 19:23:37 +02:00
Michael Niedermayer 4def5d2b64 swr: add swr_get_delay() to find the exact delay the swresampler introduces.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-18 23:02:10 +02:00
Michael Niedermayer a0493be10e swresample: set the default parameters to "none"
this way it can easily be detected when parameters have not been set

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-17 16:46:15 +02:00
Michael Niedermayer a927641e7a libswresample-simd: Add ff_pack_6ch_float_to_int32_a_avx and ff_pack_6ch_float_to_int32_a_sse4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 20:56:18 +02:00
Michael Niedermayer ca986a06ad libswresample-simd: add ff_pack_6ch_int32_to_float_a_avx and ff_pack_6ch_int32_to_float_a_sse4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 20:53:30 +02:00
Michael Niedermayer c4047ad9e0 libswresample: make NOP_N macro less picky on its parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 20:45:32 +02:00
Michael Niedermayer 57bc91c710 libswresample: Change FLOAT_TO_INT32_N to need 1 register less
same speed on sandy bridge

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 20:44:08 +02:00
Michael Niedermayer ecfdd125f1 libswresample-simd: rename 6ch pack to what it is
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 20:31:12 +02:00
Michael Niedermayer 429b964e25 libswresample-simd: make the converter registers parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 20:30:13 +02:00
Michael Niedermayer b3915c4b70 libswresample: cosmetics
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 19:32:06 +02:00
Michael Niedermayer 24c0d1583c libswresample: unaligned AVX/SSE4 float and int32 6ch pack
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 19:31:59 +02:00
Justin Ruggles 6f67d9833b libswresample: Implement MMX, SSE4 and AVX 6ch float and int32 packing function.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-13 19:31:59 +02:00
Michael Niedermayer bd1d975cd0 swr: fix silence buffer for planar U8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-07 00:05:19 +02:00
Michael Niedermayer fecdc76a9f swr: fix cpy() after the len was changed to be in samples.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-07 00:04:44 +02:00
Michael Niedermayer cbbc472467 swr-x86-simd: add ff_unpack_2ch_int16_to_int16/int32/float_a_ssse3
more than 10% faster (tested on sandybridge)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-06 19:39:52 +02:00
Michael Niedermayer f10aeab69c swr: audioconvert: consider mono to be planar
This way it will be handled by the planar==planar SIMD

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-06 18:04:09 +02:00
Michael Niedermayer 72ae583b7d swr-x86-simd: stereo unpack S16/S32/FLT-> S16/S32/FLT SSE/SSE2 (16 new SIMD functions)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-06 17:25:52 +02:00
Michael Niedermayer 11ad5f0d7d swr-x86-simd: create prototypes with macros, this is simpler.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-06 17:25:52 +02:00
Michael Niedermayer adfa53b91f swr-x86-SIMD: 3 instructions less for stereo planar->packed s32/flt->s16
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-06 17:25:52 +02:00
Michael Niedermayer 5f4e18cd16 swr: replace the remaining 2 audio convert SIMD macros by the new ones
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 19:59:57 +02:00
Michael Niedermayer df5ff103cd swr: fix internal asm labels
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 19:43:11 +02:00
Michael Niedermayer b6f4f0d9ef swr: fix PACK_2CH register count
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 19:42:52 +02:00
Michael Niedermayer aae3119643 swr: replace planar->planar/packed->packed FLT<->S16/S32 SIMD by new macros
this simplifies the code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 19:41:39 +02:00
Michael Niedermayer 47055b8913 swr: implement stereo S16/S32/FLT->S16/S32/FLT planar->packed in SSE/SSE2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 18:32:34 +02:00
Michael Niedermayer fec3700dcd swr: update calling code to support mixed packed planar SIMD
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 18:32:34 +02:00
Michael Niedermayer e8dd7928c8 swr: change simd len argument to be in samples instead of dst bytes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 18:32:34 +02:00
Michael Niedermayer 3db6093244 swr-test: allow testing a specific subset of cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-05 18:32:34 +02:00
Michael Niedermayer c1fe2db376 swr: add ff_int32_to_float_a_avx
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-03 15:58:51 +02:00
Michael Niedermayer 29ed1900cc swr-test: fix rounding error leading to NAN
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-03 14:42:37 +02:00
Michael Niedermayer 33f7033452 swr: automatically choose s16/flt/dbl to preserve input precision unless user overrides.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-02 01:12:16 +02:00
Michael Niedermayer f2e799a3d0 swr: add double precision support to the rematrix code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-02 01:12:16 +02:00
Michael Niedermayer 71a1f76d3c swr: update double precision checks for our resampler
It supports double precision since a while

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-02 01:12:16 +02:00
Justin Ruggles 6d5bf67f04 swr: add lfe_mix_level
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-02 01:12:10 +02:00
Justin Ruggles 9b42653b22 swr: update side to back mixing.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-02 01:11:55 +02:00
Michael Niedermayer aab5a4521c swr: add and use function pointers for rematrix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-01 20:20:21 +02:00
Michael Niedermayer 00fea26faf swr: add native matrix for rematrixing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-01 20:19:28 +02:00
Michael Niedermayer 046b5339fc swr: disable 1 stage convert when dither is enabled.
This combination is not possible easily.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-01 20:12:31 +02:00
Michael Niedermayer 30aa004f0c swr-test: allow randomizing mode differently each run.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-01 13:25:50 +02:00
Michael Niedermayer bea3d19fbb swr-test: use uint_rand() for mode too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-01 13:25:50 +02:00
Michael Niedermayer 0334464336 swr-test: simplify by using uint_rand()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-01 13:25:50 +02:00
Michael Niedermayer 9f98a8e9bc swr: use memcpy when input and output match
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-29 15:32:18 +02:00
Michael Niedermayer 106789dfa0 swr: add sample format to AudioData
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-29 15:32:18 +02:00
Michael Niedermayer 2d6c29f566 swr: add set_audiodata_fmt() and use it to simplify code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-29 15:32:18 +02:00
Michael Niedermayer 65722e7fc5 swr: int32_to_int16_mmx/sse
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-29 14:20:35 +02:00
Michael Niedermayer 73edb58c3c swr: float_to_int16_sse2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-29 12:18:14 +02:00
Michael Niedermayer 5932938c9a swr: float_to_int32_sse2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-29 11:37:32 +02:00
Michael Niedermayer b72a0f9c23 swr: add int16_to_float_sse2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 19:07:30 +02:00
Michael Niedermayer 832c3b10d2 swr: add int32_to_float_sse2
could be done for sse/3dnow too if someone wants

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 17:06:11 +02:00
Michael Niedermayer 95057b1972 swr: int16->int32: use the old index negate trick to avoid 2 adds
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 17:06:11 +02:00
Michael Niedermayer 113738d6c2 swr: more correct cglobal parameters to int16->int32
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 17:06:11 +02:00
Michael Niedermayer fa5daaca0d swr: seperate functions for aligned & unaligned
If someone has an idea on how to do this cleaner, its welcome

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 13:15:44 +02:00
Michael Niedermayer bcc66ff0e4 swr: add int16_to_int32_mmx/sse
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 13:15:44 +02:00
Michael Niedermayer 06b62cb8f2 swr: move AudioConvert to header
the next commits will need it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 13:02:58 +02:00
Michael Niedermayer edbde52226 swr: change sample format representation so as to maintain the planer/packed distinction.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 13:02:58 +02:00
Michael Niedermayer dcfc12e86a swr-test: simplify prng code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-27 12:23:53 +02:00
Michael Niedermayer bbd3dc49ff swr: unroll audioconvert core C function
36k->32k decicycles

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-27 05:05:20 +02:00
Michael Niedermayer 4119fa7023 swr: audioconvert, mark some constants as floats.
idea from avr

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-27 00:22:57 +02:00
Michael Niedermayer 76d376d99b swr-test: fix declaration statement ordering.
swr-test is now warning free.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 23:48:57 +02:00
Michael Niedermayer f75169b251 swr-test: fix pointer type warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 23:47:32 +02:00
Michael Niedermayer 7b2ce50701 swr-test: fix unused var warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 23:44:50 +02:00
Michael Niedermayer a0dd81dd95 swr-test:indent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 23:43:45 +02:00
Michael Niedermayer f1f5b39866 swr-test: support fabrices audiogen like avr
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 20:23:07 +02:00
Michael Niedermayer 73be22f526 swr-test: fix u8 zero point.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 20:23:07 +02:00
Michael Niedermayer 56f89bae52 swr-test: improve rounding in set()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 20:23:07 +02:00
Michael Niedermayer 27de7a8eb3 swr-test: remove unneeded hack to test planar formats.
planar formats are now chosen like any other parameter.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer 08809e3085 swr-test: improve output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer 5347b9da98 swr-test: print channel layout, instead of just channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer e6c460e3ea swr-test: Use randomized collision free hypercube corner enumeration to select tests.
This way the user can specify how many or few tests should run while
still providing good coverage over the whole parameter set.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer 7461e9ae45 swr-test: use formats array
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer 69f3af9590 swr-test: remove 0 terminator in layouts for consistency
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer b1519102f1 swr-test: add rates tables containing a new set of sample rates.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 15:37:41 +02:00
Michael Niedermayer 030d6b65ae swr-test: indent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 14:33:10 +02:00
Michael Niedermayer dd63e27574 swr-test: add sorted formats table from avr
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 14:33:10 +02:00
Michael Niedermayer da9587952a swr: pass resample parameters from the user to the resampler.
doxy and names stolen from avr

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 01:35:22 +02:00
Michael Niedermayer a522e03754 swr: Add longer more descriptive alternative AVOptions.
They match avresample where it supports the same fields.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 01:14:48 +02:00
Michael Niedermayer 20fc610439 swr: Capitalize help texts for AVOptions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 01:03:32 +02:00
Michael Niedermayer 36a9dd2f4d swr: align options a little
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 01:00:43 +02:00
Michael Niedermayer 23282c2222 swr: set AV_OPT_FLAG_AUDIO_PARAM for the AVOptions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 00:51:50 +02:00
Andrew Wason e9b1d5ae5e fix swr_convert buffering of packed audio
swr_convert is not properly buffering packed input audio when the
output is not large enough, and when resampling is not actually needed
(same samplerate and no SWR_FLAG_RESAMPLE).

buf_set() is only handling the first channel and leaving the others as-is.

Sample program to reproduce the problem is here https://gist.github.com/2431768

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-21 01:57:21 +02:00
Michael Niedermayer 44239bd9f2 swr: add a swr_flags AVOption
Using swr_flags instead of plain flags will avoid conflicts that
arise with plain flags and multiple libs (which all have AVOption flags)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 14:10:22 +02:00
Michael Niedermayer c1d404b9e4 swr: add a dither_scale parameter to tune the amplitude of the dither.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 13:44:48 +02:00
Michael Niedermayer a2c92e6063 swr: pass context to swri_get_dither()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 13:44:15 +02:00
Michael Niedermayer f8a237a307 swr: add triangular highpass dither
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 13:27:22 +02:00
Michael Niedermayer 1fc4ff2205 swr: generate more dither noise to improve quality.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 13:26:32 +02:00
Michael Niedermayer 22057e8ecb swr: add swr_get_class()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 13:25:56 +02:00
Michael Niedermayer f9a2c5bc07 swr: simplify code by using av_get_bytes_per_sample()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-11 10:02:00 +02:00
Michael Niedermayer 6e9c634c36 swr: fix copy & pasted comment to match the code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 23:54:04 +02:00
Michael Niedermayer b1ef4dc406 swr: add triangular dither support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 21:18:33 +02:00
Michael Niedermayer 0cff3e130b swr: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 21:18:32 +02:00
Michael Niedermayer 0170889372 swr: add SWR_DITHER_RECTANGULAR to AVOptions array
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 21:18:32 +02:00
Michael Niedermayer 5b2be9bcc0 swr-test: include opt.h, this is needed for changing options for testing.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 19:54:42 +02:00
Michael Niedermayer 7c673d73ec swr: use assert in swri_sum2 to check that only supported formats are used.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 19:54:42 +02:00
Michael Niedermayer db2eadb2f5 swr: add dither support.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-10 19:54:41 +02:00