OSDN Git Service

android-x86/external-bluetooth-sbc.git
11 years agosbc: SBC encoder scale factors calculation optimized with __builtin_clz
Siarhei Siamashka [Thu, 29 Jan 2009 00:17:36 +0000 (02:17 +0200)]
sbc: SBC encoder scale factors calculation optimized with __builtin_clz

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.

11 years agosbc: Performance optimizations for input data processing in SBC encoder
Siarhei Siamashka [Tue, 27 Jan 2009 16:57:35 +0000 (18:57 +0200)]
sbc: Performance optimizations for input data processing in SBC encoder

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).

11 years agosbc: Use of -funroll-loops option to improve SBC encoder performance
Siarhei Siamashka [Wed, 21 Jan 2009 19:08:34 +0000 (21:08 +0200)]
sbc: Use of -funroll-loops option to improve SBC encoder performance

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.

11 years agosbc: Audio quality improvement for 16-bit fixed point SBC encoder
Siarhei Siamashka [Wed, 21 Jan 2009 22:12:40 +0000 (00:12 +0200)]
sbc: Audio quality improvement for 16-bit fixed point SBC encoder

Multiplying the first part of the analysis filter constant tables
by some coefficients and dividing the second part by the same
coefficients is a transformation which should produce the same
results if rounding errors are not taken into account. These
additional C0/C1/... coefficients can be varied in a certain
range (the requirement is that we still do not get overflows).
The 'magic' values for these coefficients are selected in such
a way that the rounding errors are minimized (rounding errors
are unavoidable when putting all the floating constants into
16-bit tables and losing some of the fractional part).

Also non-SIMD variant of the analysis filter is dropped because
keeping it would require applying a similar change to its tables,
which is a bit tricky and just increases maintenance overhead.

11 years agosbc: Fix sbcenc breakage when au file header size is larger than 24 bytes
Siarhei Siamashka [Sun, 18 Jan 2009 21:10:00 +0000 (23:10 +0200)]
sbc: Fix sbcenc breakage when au file header size is larger than 24 bytes

11 years agosbc: Performance optimizations for sbcenc utility
Siarhei Siamashka [Fri, 16 Jan 2009 15:23:54 +0000 (17:23 +0200)]
sbc: Performance optimizations for sbcenc utility

Read and write buffers sizes increased, memmove overhead eliminated.
Nonportable cast from 'unsigned char *' to 'struct au_header *' is
now also resolved as part of the changes.

11 years agosbc: Coding style fixes
Siarhei Siamashka [Sat, 17 Jan 2009 18:30:40 +0000 (20:30 +0200)]
sbc: Coding style fixes

11 years agosbc: Fix indentation to use only tabs
Johan Hedberg [Fri, 16 Jan 2009 18:29:43 +0000 (20:29 +0200)]
sbc: Fix indentation to use only tabs

11 years agosbc: MMX and ARM NEON optimized versions of analysis filter for SBC encoder
Siarhei Siamashka [Thu, 15 Jan 2009 18:25:49 +0000 (20:25 +0200)]
sbc: MMX and ARM NEON optimized versions of analysis filter for SBC encoder

11 years agosbc: SBC arrays and constant tables aligned at 16 byte boundary for SIMD
Siarhei Siamashka [Thu, 15 Jan 2009 17:45:36 +0000 (19:45 +0200)]
sbc: SBC arrays and constant tables aligned at 16 byte boundary for SIMD

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.

11 years agosbc: SIMD-friendly variant of SBC encoder analysis filter
Siarhei Siamashka [Thu, 15 Jan 2009 17:11:23 +0000 (19:11 +0200)]
sbc: SIMD-friendly variant of SBC encoder analysis filter

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.

11 years agosbc: Fix for big endian problems in SBC codec
Siarhei Siamashka [Wed, 7 Jan 2009 12:28:48 +0000 (14:28 +0200)]
sbc: Fix for big endian problems in SBC codec

11 years agosbc: Fixed correct handling of frame sizes in the encoder
Christian Hoene [Mon, 5 Jan 2009 12:26:08 +0000 (13:26 +0100)]
sbc: Fixed correct handling of frame sizes in the encoder

11 years agosbc: Use of constant shift in SBC quantization code to make it faster
Siarhei Siamashka [Sun, 4 Jan 2009 01:11:12 +0000 (03:11 +0200)]
sbc: Use of constant shift in SBC quantization code to make it faster

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.

11 years agosbc: Update copyright information
Marcel Holtmann [Thu, 1 Jan 2009 18:33:20 +0000 (19:33 +0100)]
sbc: Update copyright information

11 years agosbc: Added possibility to analyze 4 blocks at once in SBC encoder
Siarhei Siamashka [Wed, 31 Dec 2008 07:14:25 +0000 (09:14 +0200)]
sbc: Added possibility to analyze 4 blocks at once in SBC encoder

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).

11 years agosbc: New SBC analysis filter function to replace current broken code
Siarhei Siamashka [Sun, 28 Dec 2008 01:22:59 +0000 (03:22 +0200)]
sbc: New SBC analysis filter function to replace current broken code

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.

11 years agosbc: Fixed subbands selection for joint-stereo in SBC encoder
Siarhei Siamashka [Sat, 27 Dec 2008 17:36:14 +0000 (19:36 +0200)]
sbc: Fixed subbands selection for joint-stereo in SBC encoder

11 years agosbc: Add more options to control encoding methods
Marcel Holtmann [Tue, 23 Dec 2008 22:56:32 +0000 (23:56 +0100)]
sbc: Add more options to control encoding methods

11 years agosbc: Don't decode a frame if it is too small
Marcel Holtmann [Tue, 23 Dec 2008 22:41:38 +0000 (23:41 +0100)]
sbc: Don't decode a frame if it is too small

11 years agosbc: Remove unnecessary code and fix a coding style.
Luiz Augusto von Dentz [Thu, 18 Dec 2008 22:22:31 +0000 (19:22 -0300)]
sbc: Remove unnecessary code and fix a coding style.

11 years agosbc: Fix for overflow bug in SBC quantization code
Siarhei Siamashka [Wed, 17 Dec 2008 20:32:11 +0000 (22:32 +0200)]
sbc: Fix for overflow bug in SBC quantization code

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.

11 years agosbc: Bitstream writing optimization for SBC encoder
Siarhei Siamashka [Thu, 11 Dec 2008 19:21:28 +0000 (21:21 +0200)]
sbc: Bitstream writing optimization for SBC encoder

SBC encoder performance improvement up to 1.5x for ARM11
and almost twice faster for Intel Core2 in some cases.

11 years agosbc: Add more options to SBC encoder and decoder
Marcel Holtmann [Fri, 31 Oct 2008 23:14:46 +0000 (00:14 +0100)]
sbc: Add more options to SBC encoder and decoder

11 years agosbc: Fix SBC gain mismatch
Marcel Holtmann [Fri, 31 Oct 2008 22:55:13 +0000 (23:55 +0100)]
sbc: Fix SBC gain mismatch

11 years agosbc: Fix SBC decoding handling
Marcel Holtmann [Thu, 30 Oct 2008 19:01:06 +0000 (20:01 +0100)]
sbc: Fix SBC decoding handling

11 years agosbc: Let the decoder write Sun/NeXT audio S16_BE files
Marcel Holtmann [Sun, 26 Oct 2008 00:04:44 +0000 (02:04 +0200)]
sbc: Let the decoder write Sun/NeXT audio S16_BE files

11 years agosbc: Add bitpool option to encoder
Marcel Holtmann [Sat, 25 Oct 2008 23:32:52 +0000 (01:32 +0200)]
sbc: Add bitpool option to encoder

11 years agosbc: Fix missing encoding of last frame
Marcel Holtmann [Sat, 25 Oct 2008 22:26:20 +0000 (00:26 +0200)]
sbc: Fix missing encoding of last frame

11 years agosbc: Add low-complexity, subband codec support
Marcel Holtmann [Mon, 30 Jul 2012 02:34:44 +0000 (19:34 -0700)]
sbc: Add low-complexity, subband codec support

11 years agoInitial revision
Marcel Holtmann [Wed, 11 Jul 2012 12:51:00 +0000 (09:51 -0300)]
Initial revision