Commit graph

104 commits

Author SHA1 Message Date
Colin Guthrie
8ea6b0585e Revert "resamplers: Optimize trivial resampler"
This causes problems with 24kHz audio (results in echoing)
when upscaling to 44.1kHz or 48kHz.

It can be reapplied when the optimisation works for all cases.

This reverts commit 8539fe9765.
2012-03-28 11:31:36 +01:00
Arun Raghavan
dc8edf4b43 resampler: Move some peak resampler asserts around
This moves a couple of asserts from peak_resample() to peaks_init()
since they're resampler parameters that shouldn't change after
initialisation.
2011-12-13 09:26:44 +05:30
Arun Raghavan
a0b5f29b42 resampler: Remove invalid channel asserts in peak and trivial
The incoming channel count will be fixed up by the remapping code before
the resampler is invoked.
2011-12-13 09:26:12 +05:30
Peter Meerwald
5f2286e6f7 build-sys: Make speex library optional
make speex library dependency optional, this affects the resampler
and the echo canceller module

this patch supersedes an earlier patch proposal and addresses the following
comments:
* fix order of pa_echo_canceller_method_t enum and ec_table (Frederic)
* the default resampler is speex if available as before, otherwise ffmpeg (Arun)
* does not touch the Adrian EC implementation (see separate patch) (Arun)
2011-12-13 09:10:08 +05:30
Maarten Bosmans
75c2f4d09e resampler: Some minor tweaks
that were forgotten in the previous peaks resampler commits.
2011-11-28 11:08:05 +00:00
Maarten Bosmans
40e35efbce resamplers: Improve performance of peaks resampler
This is mainly achieved by special-casing the common 1ch float case,
which is used by applications such as pavucontrol.
2011-11-27 16:25:04 +00:00
Maarten Bosmans
115d903ab7 resamplers: Rework the peaks resampler
The algorithm had been implemented the same way as the trivial resampler.  But
an important difference between the two is that the trivial resampler can write
an output as soon as the first corresponding input sample is seen, whereas the
peaks resampler must have read all input samples before writing an output
sample.

With this rework, the peaks resampler now outputs samples correctly when the
input data is spanning multiple memblocks.
2011-11-27 16:25:04 +00:00
Maarten Bosmans
8539fe9765 resamplers: Optimize trivial resampler
This improves the performance of a typical s16 2ch resampling by 88%.
2011-11-27 14:54:01 +00:00
Maarten Bosmans
61890ae20d resamplers: Use better variable name in trivial resampler 2011-11-27 14:54:01 +00:00
Maarten Bosmans
761fbee663 resamplers: Use fastpath assert in trivial resampler
When the assert is disabled, the trivial resampler gets a 35% performance boost.
2011-11-27 14:54:01 +00:00
Maarten Bosmans
c5dca7cf2b More spelling fixes 2011-08-25 11:27:47 +01:00
Maarten Bosmans
684b89c639 Fix up some double spaces 2011-03-18 09:20:07 +00:00
Maarten Bosmans
b3721a12c5 Fixup #include directives according to Coding Style
Use #include "header.h" if functionality of header.h is implemented
and #include <header.h> if functionality of header.h is used.
2011-03-11 11:49:39 +00:00
Maarten Bosmans
ecf09f2cd6 Fix up according to Coding Style
Only whitespace changes in here
2011-03-11 11:49:35 +00:00
Andy Shevchenko
300384ce0a Fix checking for NULL after usage
The pa_xmalloc calls oom() in case of NULL pointer returned by malloc() on one
hand and dereferencing of pointer is happen early than actual check on other
hand. Thus, just remove useless checks.
2009-08-28 17:12:44 +02:00
Wim Taymans
ac1f2e0a2e remap: move remapping code in separate file
Move the remapping code into a separate file. Have functions to install custom
init functions that can install optimized versions, when they want.
2009-08-20 18:23:42 +02:00
Wim Taymans
a3f4a4f6ba resamples; refactor the channel remapping bits
Move the channel remapping bits into a separate structure. We'll make this
structure global so that optimized versions can use it to perform the channel
remapping.
2009-08-20 17:54:45 +02:00
Wim Taymans
f09b51198f whitespace fixes 2009-08-20 11:31:04 +02:00
Wim Taymans
3cc1278dcf resampler: avoid some multiplies when we can 2009-08-20 11:31:04 +02:00
Wim Taymans
548b735ccf resampler: fix identity check
Fix the identity matrix check for mono to stereo.
Help the compiler generate better code for the C implementation of the channel
remapping code.
2009-08-20 11:31:04 +02:00
Wim Taymans
d04a6e935f resample: fix counters 2009-08-20 11:31:04 +02:00
Wim Taymans
b4e9942c2f resample: refactor the channel remapping a little
Factor out the channel remap matrix code into a separate function.
Keep a pointer to the channel remapping function so we can install custom
functions.
Catch the common mono->stereo remapping case and install a custom, more
optimized function.
2009-08-20 11:31:04 +02:00
Wim Taymans
601e5f1867 resampler: cache integer channel_map
Calculate and cache an integer version of the channel map so that we don't have
to regenerate it when dealing with s16 samples.
2009-08-20 11:31:03 +02:00
Wim Taymans
25724cdd40 Get rid of liboil
Get rid of the liboil dependency and reimplement the liboil functions with an
equivalent C implementation. Note that most of these functions are deprecated in
liboil and that none of them had  any optimisations. We can further specialize
our handrolled versions for some extra speedups.
2009-08-20 11:31:03 +02:00
Lennart Poettering
fecd0dc801 resampler: round up when estimating input/output sizes 2009-08-14 04:21:09 +02:00
Colin Guthrie
86dee05aec Use LGPL 2.1 on all files previously using LGPL 2 2009-03-03 20:23:02 +00:00
Lennart Poettering
d6dd907cc8 simplify code a bit by using pa_sample_size_of_format() 2009-02-04 17:16:53 +01:00
Lennart Poettering
88c9f9fba6 allow sample spec/channel map to be queried for pa_resampler objects 2009-01-23 22:28:11 +01:00
Diego E. 'Flameeyes' Pettenò
3e5d9fd37a Use #ifdef to avoid warning about undefined macro. 2009-01-22 23:38:58 +01:00
Lennart Poettering
4a13763797 Add support for 24bit samples encoded in the LSB of 32 bit words 2009-01-16 18:39:36 +01:00
Lennart Poettering
6dc76d1158 add support for 24bit packed samples 2009-01-16 03:15:39 +01:00
Lennart Poettering
209a8d7b55 Don't mix front-center into rear channels
If there's a center channel on input that is not available on output
make sure we mix front-center only into front-left/right and rear-center
into rear-left/right.

Closes #400
2008-12-17 19:53:58 +01:00
Lennart Poettering
17436b21d3 make sure peaks resampler also works for very short input buffers 2008-09-09 02:18:21 +03:00
Lennart Poettering
f2164023fd Add new option to disable remixing from/to LFE and set it to on by default 2008-09-05 16:04:42 +03:00
Lennart Poettering
34bcba63a2 remove a few more gcc warnings 2008-08-30 01:22:41 +02:00
Lennart Poettering
dc9b8dce30 add a few missing casts 2008-08-20 03:33:06 +03:00
Lennart Poettering
b7026bf248 add a few more gcc warning flags and fix quite a few problems found by doing so 2008-08-19 22:39:54 +02:00
Lennart Poettering
1568fcc979 get rid of our internal copy of the speex resampler. Instead, link against a system-installes libspeexdsp 2008-06-28 02:20:14 +02:00
Lennart Poettering
8ae83d618e get rid of svn $ keywords 2008-06-18 23:23:21 +03:00
Lennart Poettering
6285a46935 fix peak detection pseudo resampler
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2453 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-17 09:10:16 +00:00
Lennart Poettering
045c1d602d merge glitch-free branch back into trunk
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2445 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-15 23:34:41 +00:00
Lennart Poettering
86b9ef8c96 deal with a possibly failing pa_channel_map_init_auto() correctly
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2105 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-02-13 22:13:44 +00:00
Lennart Poettering
2a44213430 add API for resetting allocated resamplers
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2088 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-12-23 20:15:03 +00:00
Lennart Poettering
f873a2a224 add a simple fully-automatic fully-linearupmixer/downmixer and enable it by default
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2044 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-11-11 02:30:59 +00:00
Lennart Poettering
7e0f547f2f add support for 32bit integer samples
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2037 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-11-09 02:45:07 +00:00
Lennart Poettering
1c0690776d make speex-float-3 the default resampler
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1973 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-10-29 08:34:30 +00:00
Lennart Poettering
a67c21f093 merge 'lennart' branch back into trunk.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1971 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-10-28 19:13:50 +00:00
Pierre Ossman
06211b7c8f Add copyright notices to all relevant files. (based on svn log)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1426 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-02-13 15:35:19 +00:00
Pierre Ossman
521daf6f0a Huge trailing whitespace cleanup. Let's keep the tree pure from here on,
mmmkay?


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-01-04 13:43:45 +00:00
Pierre Ossman
8dc6214276 Revert r1404 and keep it on a development branch until it is fully tested.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1409 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-11-06 13:06:01 +00:00