summaryrefslogtreecommitdiffstats
path: root/sbc/sbc.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix SBC to compile cleanly with -Wsign-compareMarcel Holtmann2009-01-301-4/+7
|
* Fix for SBC encoding with block sizes other than 16Siarhei Siamashka2009-01-291-6/+13
| | | | | | Thanks to Christian Hoene for finding and reporting the problem. This regression was intruduced in commit 19af3c49e61aa046375497108e05a3a0605da158
* SBC encoder scale factors calculation optimized with __builtin_clzSiarhei Siamashka2009-01-291-16/+5
| | | | | | | | | Count leading zeros operation is often implemented using a special instruction for it on various architectures (at least this is true for ARM and x86). Using __builtin_clz gcc intrinsic allows to eliminate innermost loop in scale factors calculation and improve performance. Also scale factors calculation can be optimized even more using SIMD instructions.
* Performance optimizations for input data processing in SBC encoderSiarhei Siamashka2009-01-281-26/+29
| | | | | | | | Channels deinterleaving, endian conversion and samples reordering is done in one pass, avoiding the use of intermediate buffer. Also this code is implemented as a new "performance primitive", which allows further platform specific optimizations (ARMv6 and ARM NEON should gain quite a lot from assembly optimizations here).
* Use of -funroll-loops option to improve SBC encoder performanceSiarhei Siamashka2009-01-231-16/+33
| | | | | | | | | Added the use of -funroll-loops gcc option for SBC. Also in order to gain better effect, 'sbc_pack_frame' function body moved to an inline function, which gets instantiated for 4 different subbands/channels combinations. So that 'frame_subbands' and 'frame_channels' arguments become compile time constants and can be better optimized by the compiler.
* Coding style fixesSiarhei Siamashka2009-01-181-21/+32
|
* SBC arrays and constant tables aligned at 16 byte boundary for SIMDSiarhei Siamashka2009-01-161-10/+16
| | | | | | | Most SIMD instruction sets benefit from data being naturally aligned. And even if it is not strictly required, performance is usually better with the aligned data. ARM NEON and SSE2 have different instruction variants for aligned/unaligned memory accesses.
* SIMD-friendly variant of SBC encoder analysis filterSiarhei Siamashka2009-01-161-153/+2
| | | | | | | | | Added SIMD-friendly C implementation of SBC analysis filter (the structure of code had to be changed a bit and constants in the tables reordered). This code can be used as a reference for developing platform specific SIMD optimizations. These functions are put into a new file 'sbc_primitives.c', which is going to contain all the basic stuff for SBC codec.
* Fix for big endian problems in SBC codecSiarhei Siamashka2009-01-071-12/+0
|
* Fixed correct handling of frame sizes in the encoderChristian Hoene2009-01-061-3/+3
|
* Use of constant shift in SBC quantization code to make it fasterSiarhei Siamashka2009-01-061-10/+13
| | | | | | | | | The result of 32x32->64 unsigned long multiplication is returned in two registers (high and low 32-bit parts) for many 32-bit architectures. For these architectures constant right shift by 32 bits is optimized out by the compiler to just taking the high 32-bit part. Also some data needed at the quantization stage is precalculated beforehand to improve performance.
* Update copyright informationMarcel Holtmann2009-01-011-1/+1
|
* Added possibility to analyze 4 blocks at once in SBC encoderSiarhei Siamashka2009-01-011-49/+82
| | | | | | | | | | | This change is needed for SIMD optimizations which will follow shortly. And even for non-SIMD capable platforms it still may be useful to have possibility to merge several analyzing functions together into one for better code scheduling or reusing loaded constants. Also analysis filter functions are now called using function pointers, which allows the default implementation to be overrided at runtime (with high precision variant or MMX/SSE2/NEON optimized code).
* New SBC analysis filter function to replace current broken codeSiarhei Siamashka2008-12-291-198/+108
| | | | | | | | | | | | | | This code is heavily based on the patch submitted by Jaska Uimonen. Additional changes include preserving extra bits in the output of filter function for better precision, support for both 16-bit and 32-bit fixed point implementation. Sign of some table values was changed in order to preserve a regular code structure and have multiply-accumulate oparations only. No additional optimizations were applied as this code is intended to be some kind of "reference" implementation. Platform specific optimizations may require different tricks and can be branched off from this implementation. Some extra information about this code can be found in linux-bluetooth mailing list archive for December 2008.
* Fixed subbands selection for joint-stereo in SBC encoderSiarhei Siamashka2008-12-291-4/+4
|
* Don't decode a frame if it is too smallMarcel Holtmann2008-12-231-0/+3
|
* Remove unnecessary code and fix a coding style.Luiz Augusto von Dentz2008-12-181-14/+11
|
* Fix for overflow bug in SBC quantization codeSiarhei Siamashka2008-12-181-1/+1
| | | | | | | The result of multiplication does not always fit into 32-bits. Using 64-bit calculations helps to avoid overflows and sound quality problems in encoded audio. Overflows are more likely to show up when using high values for bitpool setting.
* Bitstream writing optimization for SBC encoderSiarhei Siamashka2008-12-181-28/+37
| | | | | SBC encoder performance improvement up to 1.5x for ARM11 and almost twice faster for Intel Core2 in some cases.
* Fix SBC gain mismatchMarcel Holtmann2008-10-311-2/+2
|
* Avoid direct inclusion of malloc.hMarcel Holtmann2008-06-111-1/+0
|
* Cidorvan found another place where the spec had us saving a bunch of valuesBrad Midgley2008-03-081-24/+13
| | | | that were used immediately. Just compute and use instead of saving. In the decoder.
* decoder optimization, now using nested multiply callsBrad Midgley2008-03-061-48/+51
|
* Cidorvan's 4-subband overflow fixesBrad Midgley2008-02-291-1/+1
|
* Replace 64bits multiplies by 32bits to further optimize the codeJohan Hedberg2008-02-221-6/+4
|
* Introduce sbc new API.Luiz Augusto von Dentz2008-02-191-153/+157
|
* fix for decoder noise at high bitpoolsBrad Midgley2008-02-151-10/+2
|
* Update copyright informationMarcel Holtmann2008-02-021-2/+1
|
* change MUL/MULA semanticsBrad Midgley2008-01-301-168/+171
|
* one more .X 32-bitismBrad Midgley2008-01-291-1/+1
|
* revert 16-bit state.X change (bad on arm)Brad Midgley2008-01-291-4/+4
|
* revert arm conditional codeBrad Midgley2008-01-281-12/+1
|
* change function signature so the arm optimization will workBrad Midgley2008-01-281-1/+12
|
* remove 16x16 mult optimization--gcc actually generates more costly codeBrad Midgley2008-01-281-93/+93
|
* Whitespace cleanupJohan Hedberg2008-01-281-1/+1
|
* avoid an (unlikely) overflowBrad Midgley2008-01-271-2/+2
|
* get 32-bit products whenever we're sure the multiplicands are both 16 bitsBrad Midgley2008-01-271-95/+95
|
* shorten the encoder tables to 16 bits, take out mula32/mul32 for now for ↵Brad Midgley2008-01-261-67/+67
| | | | simplicity
* pcm input array should be 16 not 32 bitsBrad Midgley2008-01-261-75/+75
| | | | use 32-bit product when multiplying two values limited to 16 bits each
* update copyrightsBrad Midgley2008-01-191-1/+1
|
* coding styleBrad Midgley2008-01-141-7/+4
|
* comment typoBrad Midgley2008-01-141-1/+1
|
* fix initializationBrad Midgley2008-01-141-1/+4
|
* take out memmove in sbc analyzeBrad Midgley2008-01-141-21/+29
|
* tweak to the memmove for 4 subbandsBrad Midgley2008-01-111-1/+1
|
* optimizations: use memmove instead of a loop, unroll short loopBrad Midgley2008-01-081-11/+22
|
* smooth out last shift-in-place wrinkleBrad Midgley2007-12-141-11/+2
|
* push in-place-shift optimization up into scalefactors sectionBrad Midgley2007-12-141-7/+13
|
* shift-in-place opt is back in, with a bugfix for the 4-subband caseBrad Midgley2007-12-141-7/+15
|
* coding style on ?:Brad Midgley2007-12-141-1/+1
|