OSDN Git Service

sbc: new 'sbc_calc_scalefactors_j' function added to sbc primitives
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>
Tue, 29 Jun 2010 13:48:45 +0000 (16:48 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 30 Jul 2012 02:48:29 +0000 (19:48 -0700)
commit4d9842fe947976958acc56644de4ef1292cdb014
tree1eb9531ea21750986d60c4b3bcb22b0c4f718f15
parent6e673555988c51f5fad8c435d2f5465ac887e627
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
sbc/sbc.c
sbc/sbc_primitives.c
sbc/sbc_primitives.h