diff options
| author | Siarhei Siamashka <siarhei.siamashka@nokia.com> | 2009-01-15 19:11:23 +0200 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2009-01-16 00:28:32 +0100 | 
| commit | 9e31e7dde636ca28ee551e8bcf8e4f4ca0ef553d (patch) | |
| tree | efc05cd31c23eb871dcff2ed3776473e38a3d003 /sbc/sbc_primitives.h | |
| parent | 5331a26b8a3c2d69d30a4334e023238db197080b (diff) | |
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.
Diffstat (limited to 'sbc/sbc_primitives.h')
| -rw-r--r-- | sbc/sbc_primitives.h | 52 | 
1 files changed, 52 insertions, 0 deletions
| diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h new file mode 100644 index 00000000..ca1ec277 --- /dev/null +++ b/sbc/sbc_primitives.h @@ -0,0 +1,52 @@ +/* + * + *  Bluetooth low-complexity, subband codec (SBC) library + * + *  Copyright (C) 2004-2009  Marcel Holtmann <marcel@holtmann.org> + *  Copyright (C) 2004-2005  Henryk Ploetz <henryk@ploetzli.ch> + *  Copyright (C) 2005-2006  Brad Midgley <bmidgley@xmission.com> + * + * + *  This library is free software; you can redistribute it and/or + *  modify it under the terms of the GNU Lesser General Public + *  License as published by the Free Software Foundation; either + *  version 2.1 of the License, or (at your option) any later version. + * + *  This library is distributed in the hope that it will be useful, + *  but WITHOUT ANY WARRANTY; without even the implied warranty of + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU + *  Lesser General Public License for more details. + * + *  You should have received a copy of the GNU Lesser General Public + *  License along with this library; if not, write to the Free Software + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA + * + */ + +#ifndef __SBC_PRIMITIVES_H +#define __SBC_PRIMITIVES_H + +#define SCALE_OUT_BITS 15 + +struct sbc_encoder_state { +	int subbands; +	int position[2]; +	int16_t X[2][256]; +	/* Polyphase analysis filter for 4 subbands configuration, +	   it handles 4 blocks at once */ +	void (*sbc_analyze_4b_4s)(int16_t *pcm, int16_t *x, +				  int32_t *out, int out_stride); +	/* Polyphase analysis filter for 8 subbands configuration, +	   it handles 4 blocks at once */ +	void (*sbc_analyze_4b_8s)(int16_t *pcm, int16_t *x, +				  int32_t *out, int out_stride); +}; + +/* + * Initialize pointers to the functions which are the basic "building bricks" + * of SBC codec. Best implementation is selected based on target CPU + * capabilities. + */ +void sbc_init_primitives(struct sbc_encoder_state *encoder_state); + +#endif | 
