Commit graph

5 commits

Author SHA1 Message Date
Siarhei Siamashka
c2b2fc1640 sbc: new 'sbc_calc_scalefactors_j' function added to sbc primitives
The code for scale factors calculation with joint stereo support has
been moved to a separate function. It can get platform-specific
SIMD optimizations later for best possible performance.

But even this change in C code improves performance because of the
use of __builtin_clz() instead of loops similar to what was done
to sbc_calc_scalefactors earlier. Also technically it does loop
unrolling by processing two channels at once, which might be either
good or bad for performance (if the registers pressure is increased
and more data is spilled to memory). But the benchmark from 32-bit
x86 system (pentium-m) shows that it got clearly faster:

$ time ./sbcenc.old -b53 -s8 -j test.au > /dev/null

real    0m1.868s
user    0m1.808s
sys     0m0.048s

$ time ./sbcenc.new -b53 -s8 -j test.au > /dev/null

real    0m1.742s
user    0m1.668s
sys     0m0.064s
2011-03-14 15:16:30 -03:00
Gustavo F. Padovan
16a05e52c6 sbc: Fix redundant null check on calling free()
Issues found by smatch static check: http://smatch.sourceforge.net/
2011-03-14 15:09:50 -03:00
Siarhei Siamashka
84d91fb708 sbc: added saturated clipping of decoder output to 16-bit
This prevents overflows and audible artefacts for the audio files which
originally had loudness maximized. Music from audio CD disks is an
example of such files, see http://en.wikipedia.org/wiki/Loudness_war
2011-03-14 15:07:38 -03:00
Siarhei Siamashka
4d2f0daba1 sbc: ensure 16-byte buffer position alignment for 4 subbands encoding
Buffer position in X array was not always 16-bytes aligned.
Strict 16-byte alignment is strictly required for powerpc altivec
simd optimizations because altivec does not have support for
unaligned vector loads at all.
2011-03-14 15:01:19 -03:00
Luiz Augusto von Dentz
e4eb467010 build: move sbc related files to its own directory
This should make it easier to apply patches from BlueZ which also uses
sbc subdir for this files.
2011-03-14 14:52:52 -03:00
Renamed from src/modules/bluetooth/sbc.c (Browse further)