summaryrefslogtreecommitdiffstats
path: root/src/modules/bluetooth/sbc_math.h
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2011-03-14 14:46:10 -0300
committerLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2011-03-14 14:52:52 -0300
commite4eb4670108ad2b4a0d9c3044e12ed0d933f834e (patch)
tree6b8f4005d9fa2c4a4b37423f914c984530d00658 /src/modules/bluetooth/sbc_math.h
parentad8562452768520dd70659cf4be686608b557961 (diff)
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.
Diffstat (limited to 'src/modules/bluetooth/sbc_math.h')
-rw-r--r--src/modules/bluetooth/sbc_math.h60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/modules/bluetooth/sbc_math.h b/src/modules/bluetooth/sbc_math.h
deleted file mode 100644
index b87bc81c..00000000
--- a/src/modules/bluetooth/sbc_math.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * 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-2008 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
- *
- */
-
-#define fabs(x) ((x) < 0 ? -(x) : (x))
-/* C does not provide an explicit arithmetic shift right but this will
- always be correct and every compiler *should* generate optimal code */
-#define ASR(val, bits) ((-2 >> 1 == -1) ? \
- ((int32_t)(val)) >> (bits) : ((int32_t) (val)) / (1 << (bits)))
-
-#define SCALE_SPROTO4_TBL 12
-#define SCALE_SPROTO8_TBL 14
-#define SCALE_NPROTO4_TBL 11
-#define SCALE_NPROTO8_TBL 11
-#define SCALE4_STAGED1_BITS 15
-#define SCALE4_STAGED2_BITS 16
-#define SCALE8_STAGED1_BITS 15
-#define SCALE8_STAGED2_BITS 16
-
-typedef int32_t sbc_fixed_t;
-
-#define SCALE4_STAGED1(src) ASR(src, SCALE4_STAGED1_BITS)
-#define SCALE4_STAGED2(src) ASR(src, SCALE4_STAGED2_BITS)
-#define SCALE8_STAGED1(src) ASR(src, SCALE8_STAGED1_BITS)
-#define SCALE8_STAGED2(src) ASR(src, SCALE8_STAGED2_BITS)
-
-#define SBC_FIXED_0(val) { val = 0; }
-#define MUL(a, b) ((a) * (b))
-#ifdef __arm__
-#define MULA(a, b, res) ({ \
- int tmp = res; \
- __asm__( \
- "mla %0, %2, %3, %0" \
- : "=&r" (tmp) \
- : "0" (tmp), "r" (a), "r" (b)); \
- tmp; })
-#else
-#define MULA(a, b, res) ((a) * (b) + (res))
-#endif