Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sbc for openSUSE:Factory checked in at 2021-01-15 19:44:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sbc (Old) and /work/SRC/openSUSE:Factory/.sbc.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sbc" Fri Jan 15 19:44:07 2021 rev:8 rq:862163 version:1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/sbc/sbc.changes 2019-09-05 12:10:19.071852627 +0200 +++ /work/SRC/openSUSE:Factory/.sbc.new.28504/sbc.changes 2021-01-15 19:44:25.465858458 +0100 @@ -1,0 +2,6 @@ +Mon Jan 11 01:03:32 UTC 2021 - Dirk M??ller <[email protected]> + +- update to 1.5: + * Add support for SSE primitives. + +------------------------------------------------------------------- Old: ---- sbc-1.4.tar.xz New: ---- sbc-1.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sbc.spec ++++++ --- /var/tmp/diff_new_pack.bEIvgj/_old 2021-01-15 19:44:26.157859592 +0100 +++ /var/tmp/diff_new_pack.bEIvgj/_new 2021-01-15 19:44:26.161859599 +0100 @@ -1,7 +1,7 @@ # # spec file for package sbc # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # Copyright (c) 2012 B1 Systems GmbH, Vohburg, Germany. # # All modifications and additions to the file contributed by third parties @@ -20,12 +20,12 @@ %define sonum 1 Name: sbc -Version: 1.4 +Version: 1.5 Release: 0 Summary: Bluetooth Low-Complexity, Sub-Band Codec Utilities License: GPL-2.0-or-later Group: Hardware/Mobile -Url: http://www.kernel.org/pub/linux/bluetooth +URL: https://www.kernel.org/pub/linux/bluetooth Source: https://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.xz Source1: baselibs.conf BuildRequires: libsndfile-devel ++++++ sbc-1.4.tar.xz -> sbc-1.5.tar.xz ++++++ ++++ 25209 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/AUTHORS new/sbc-1.5/AUTHORS --- old/sbc-1.4/AUTHORS 2018-09-19 22:32:29.000000000 +0200 +++ new/sbc-1.5/AUTHORS 2020-12-07 23:26:08.000000000 +0100 @@ -9,3 +9,4 @@ Aur??lien Zanelli <[email protected]> Joshua Kessinger <[email protected]> Tanu Kaskinen <[email protected]> +John Keeping <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/ChangeLog new/sbc-1.5/ChangeLog --- old/sbc-1.4/ChangeLog 2018-09-19 22:32:29.000000000 +0200 +++ new/sbc-1.5/ChangeLog 2020-12-07 23:26:08.000000000 +0100 @@ -1,3 +1,6 @@ +ver 1.5: + Add support for SSE primitives. + ver 1.4: Fix issue with stack overflow within sbc_crc8 function. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/Makefile.am new/sbc-1.5/Makefile.am --- old/sbc-1.4/Makefile.am 2018-09-19 22:32:29.000000000 +0200 +++ new/sbc-1.5/Makefile.am 2020-12-07 23:26:08.000000000 +0100 @@ -6,14 +6,15 @@ # Interfaces added: CURRENT++ REVISION=0 AGE++ # Interfaces removed: CURRENT++ REVISION=0 AGE=0 -SBC_CURRENT = 3 -SBC_REVISION = 2 -SBC_AGE = 2 +SBC_CURRENT = 4 +SBC_REVISION = 0 +SBC_AGE = 3 sbc_headers = sbc/sbc.h sbc_sources = sbc/sbc.c sbc/sbc_private.h sbc/sbc_math.h sbc/sbc_tables.h \ sbc/sbc_primitives.h sbc/sbc_primitives.c \ + sbc/sbc_primitives_sse.h sbc/sbc_primitives_sse.c \ sbc/sbc_primitives_mmx.h sbc/sbc_primitives_mmx.c \ sbc/sbc_primitives_iwmmxt.h sbc/sbc_primitives_iwmmxt.c \ sbc/sbc_primitives_neon.h sbc/sbc_primitives_neon.c \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/compile new/sbc-1.5/compile --- old/sbc-1.4/compile 2018-09-19 22:32:57.000000000 +0200 +++ new/sbc-1.5/compile 2020-12-07 23:26:45.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/config.h.in new/sbc-1.5/config.h.in --- old/sbc-1.4/config.h.in 2018-09-19 22:32:53.000000000 +0200 +++ new/sbc-1.5/config.h.in 2020-12-07 23:26:40.000000000 +0100 @@ -30,8 +30,7 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/configure.ac new/sbc-1.5/configure.ac --- old/sbc-1.4/configure.ac 2018-09-19 22:32:29.000000000 +0200 +++ new/sbc-1.5/configure.ac 2020-12-07 23:26:08.000000000 +0100 @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(sbc, 1.4) +AC_INIT(sbc, 1.5) AM_INIT_AUTOMAKE([foreign subdir-objects color-tests]) AC_CONFIG_HEADERS(config.h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/missing new/sbc-1.5/missing --- old/sbc-1.4/missing 2018-09-19 22:32:57.000000000 +0200 +++ new/sbc-1.5/missing 2020-12-07 23:26:45.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc.c new/sbc-1.5/sbc/sbc.c --- old/sbc-1.4/sbc/sbc.c 2018-09-19 22:32:29.000000000 +0200 +++ new/sbc-1.5/sbc/sbc.c 2020-12-07 23:26:08.000000000 +0100 @@ -1087,6 +1087,24 @@ return 0; } +SBC_EXPORT int sbc_reinit_msbc(sbc_t *sbc, unsigned long flags) +{ + int err; + + err = sbc_reinit(sbc, flags); + if (err < 0) + return err; + + sbc->frequency = SBC_FREQ_16000; + sbc->blocks = MSBC_BLOCKS; + sbc->subbands = SBC_SB_8; + sbc->mode = SBC_MODE_MONO; + sbc->allocation = SBC_AM_LOUDNESS; + sbc->bitpool = 26; + + return 0; +} + static int sbc_set_a2dp(sbc_t *sbc, unsigned long flags, const void *conf, size_t conf_len) { @@ -1191,7 +1209,7 @@ return 0; } -int sbc_reinit_a2dp(sbc_t *sbc, unsigned long flags, +SBC_EXPORT int sbc_reinit_a2dp(sbc_t *sbc, unsigned long flags, const void *conf, size_t conf_len) { int err; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc.h new/sbc-1.5/sbc/sbc.h --- old/sbc-1.4/sbc/sbc.h 2018-09-19 22:32:29.000000000 +0200 +++ new/sbc-1.5/sbc/sbc.h 2020-12-07 23:26:08.000000000 +0100 @@ -85,6 +85,7 @@ int sbc_init(sbc_t *sbc, unsigned long flags); int sbc_reinit(sbc_t *sbc, unsigned long flags); int sbc_init_msbc(sbc_t *sbc, unsigned long flags); +int sbc_reinit_msbc(sbc_t *sbc, unsigned long flags); int sbc_init_a2dp(sbc_t *sbc, unsigned long flags, const void *conf, size_t conf_len); int sbc_reinit_a2dp(sbc_t *sbc, unsigned long flags, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc.sym new/sbc-1.5/sbc/sbc.sym --- old/sbc-1.4/sbc/sbc.sym 2014-01-23 14:13:57.000000000 +0100 +++ new/sbc-1.5/sbc/sbc.sym 2020-12-07 23:26:08.000000000 +0100 @@ -15,12 +15,19 @@ local: *; }; + SBC_1.1 { global: sbc_init_msbc; } SBC_1.0; + SBC_1.2 { global: sbc_init_a2dp; sbc_reinit_a2dp; } SBC_1.1; + +SBC_1.3 { +global: + sbc_reinit_msbc; +} SBC_1.2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc_primitives.c new/sbc-1.5/sbc/sbc_primitives.c --- old/sbc-1.4/sbc/sbc_primitives.c 2013-04-30 18:19:23.000000000 +0200 +++ new/sbc-1.5/sbc/sbc_primitives.c 2020-12-07 23:26:08.000000000 +0100 @@ -33,6 +33,7 @@ #include "sbc_tables.h" #include "sbc_primitives.h" +#include "sbc_primitives_sse.h" #include "sbc_primitives_mmx.h" #include "sbc_primitives_iwmmxt.h" #include "sbc_primitives_neon.h" @@ -590,6 +591,21 @@ return joint; } +static void sbc_init_primitives_x86(struct sbc_encoder_state *state) +{ + __builtin_cpu_init(); + +#ifdef SBC_BUILD_WITH_MMX_SUPPORT + if (__builtin_cpu_supports("mmx")) + sbc_init_primitives_mmx(state); +#endif + +#ifdef SBC_BUILD_WITH_SSE_SUPPORT + if (__builtin_cpu_supports("sse4.2")) + sbc_init_primitives_sse(state); +#endif +} + /* * Detect CPU features and setup function pointers */ @@ -614,9 +630,7 @@ state->implementation_info = "Generic C"; /* X86/AMD64 optimizations */ -#ifdef SBC_BUILD_WITH_MMX_SUPPORT - sbc_init_primitives_mmx(state); -#endif + sbc_init_primitives_x86(state); /* ARM optimizations */ #ifdef SBC_BUILD_WITH_ARMV6_SUPPORT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc_primitives_mmx.c new/sbc-1.5/sbc/sbc_primitives_mmx.c --- old/sbc-1.4/sbc/sbc_primitives_mmx.c 2013-04-30 18:19:23.000000000 +0200 +++ new/sbc-1.5/sbc/sbc_primitives_mmx.c 2020-12-07 23:26:08.000000000 +0100 @@ -350,50 +350,14 @@ __asm__ volatile ("emms\n"); } -static int check_mmx_support(void) -{ -#ifdef __amd64__ - return 1; /* We assume that all 64-bit processors have MMX support */ -#else - int cpuid_feature_information; - __asm__ volatile ( - /* According to Intel manual, CPUID instruction is supported - * if the value of ID bit (bit 21) in EFLAGS can be modified */ - "pushf\n" - "movl (%%esp), %0\n" - "xorl $0x200000, (%%esp)\n" /* try to modify ID bit */ - "popf\n" - "pushf\n" - "xorl (%%esp), %0\n" /* check if ID bit changed */ - "jz 1f\n" - "push %%eax\n" - "push %%ebx\n" - "push %%ecx\n" - "mov $1, %%eax\n" - "cpuid\n" - "pop %%ecx\n" - "pop %%ebx\n" - "pop %%eax\n" - "1:\n" - "popf\n" - : "=d" (cpuid_feature_information) - : - : "cc"); - return cpuid_feature_information & (1 << 23); -#endif -} - void sbc_init_primitives_mmx(struct sbc_encoder_state *state) { - if (check_mmx_support()) { - state->sbc_analyze_4s = sbc_analyze_4b_4s_mmx; - if (state->increment == 1) - state->sbc_analyze_8s = sbc_analyze_1b_8s_mmx_odd; - else - state->sbc_analyze_8s = sbc_analyze_4b_8s_mmx; - state->sbc_calc_scalefactors = sbc_calc_scalefactors_mmx; - state->implementation_info = "MMX"; - } + state->sbc_analyze_4s = sbc_analyze_4b_4s_mmx; + if (state->increment == 1) + state->sbc_analyze_8s = sbc_analyze_1b_8s_mmx_odd; + else + state->sbc_analyze_8s = sbc_analyze_4b_8s_mmx; + state->sbc_calc_scalefactors = sbc_calc_scalefactors_mmx; + state->implementation_info = "MMX"; } - #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc_primitives_sse.c new/sbc-1.5/sbc/sbc_primitives_sse.c --- old/sbc-1.4/sbc/sbc_primitives_sse.c 1970-01-01 01:00:00.000000000 +0100 +++ new/sbc-1.5/sbc/sbc_primitives_sse.c 2020-12-07 23:26:08.000000000 +0100 @@ -0,0 +1,336 @@ +/* + * + * Bluetooth low-complexity, subband codec (SBC) library + * + * Copyright (C) 2020 Intel Corporation + * + * + * 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 + * + */ + +#include <stdint.h> +#include <limits.h> +#include "sbc.h" +#include "sbc_math.h" +#include "sbc_tables.h" + +#include "sbc_primitives_sse.h" + +/* + * SSE optimizations + */ + +#ifdef SBC_BUILD_WITH_SSE_SUPPORT + +static inline void sbc_analyze_four_sse(const int16_t *in, int32_t *out, + const FIXED_T *consts) +{ + static const SBC_ALIGNED int32_t round_c[4] = { + 1 << (SBC_PROTO_FIXED4_SCALE - 1), + 1 << (SBC_PROTO_FIXED4_SCALE - 1), + 1 << (SBC_PROTO_FIXED4_SCALE - 1), + 1 << (SBC_PROTO_FIXED4_SCALE - 1), + }; + __asm__ volatile ( + "movdqu (%0), %%xmm0\n" + "pmaddwd (%1), %%xmm0\n" + "paddd (%2), %%xmm0\n" + "\n" + "movdqu 16(%0), %%xmm1\n" + "pmaddwd 16(%1), %%xmm1\n" + "paddd %%xmm1, %%xmm0\n" + "\n" + "movdqu 32(%0), %%xmm1\n" + "pmaddwd 32(%1), %%xmm1\n" + "paddd %%xmm1, %%xmm0\n" + "\n" + "movdqu 48(%0), %%xmm1\n" + "pmaddwd 48(%1), %%xmm1\n" + "paddd %%xmm1, %%xmm0\n" + "\n" + "movdqu 64(%0), %%xmm1\n" + "pmaddwd 64(%1), %%xmm1\n" + "paddd %%xmm1, %%xmm0\n" + "\n" + "psrad %4, %%xmm0\n" + "\n" + "movdqa %%xmm0, %%xmm1\n" + "punpckhqdq %%xmm1, %%xmm1\n" + "movdq2q %%xmm0, %%mm0\n" + "movdq2q %%xmm1, %%mm1\n" + "\n" + "packssdw %%mm0, %%mm0\n" + "packssdw %%mm1, %%mm1\n" + "\n" + "movq %%mm0, %%mm2\n" + "pmaddwd 80(%1), %%mm0\n" + "pmaddwd 88(%1), %%mm2\n" + "\n" + "movq %%mm1, %%mm3\n" + "pmaddwd 96(%1), %%mm1\n" + "pmaddwd 104(%1), %%mm3\n" + "paddd %%mm1, %%mm0\n" + "paddd %%mm3, %%mm2\n" + "\n" + "movq %%mm0, (%3)\n" + "movq %%mm2, 8(%3)\n" + : + : "r" (in), "r" (consts), "r" (&round_c), "r" (out), + "i" (SBC_PROTO_FIXED4_SCALE) + : "cc", "memory"); +} + +static inline void sbc_analyze_eight_sse(const int16_t *in, int32_t *out, + const FIXED_T *consts) +{ + static const SBC_ALIGNED int32_t round_c[4] = { + 1 << (SBC_PROTO_FIXED8_SCALE - 1), + 1 << (SBC_PROTO_FIXED8_SCALE - 1), + 1 << (SBC_PROTO_FIXED8_SCALE - 1), + 1 << (SBC_PROTO_FIXED8_SCALE - 1), + }; + __asm__ volatile ( + "movdqu (%0), %%xmm0\n" + "movdqu 16(%0), %%xmm1\n" + "pmaddwd (%1), %%xmm0\n" + "pmaddwd 16(%1), %%xmm1\n" + "paddd (%2), %%xmm0\n" + "paddd (%2), %%xmm1\n" + "\n" + "movdqu 32(%0), %%xmm2\n" + "movdqu 48(%0), %%xmm3\n" + "pmaddwd 32(%1), %%xmm2\n" + "pmaddwd 48(%1), %%xmm3\n" + "paddd %%xmm2, %%xmm0\n" + "paddd %%xmm3, %%xmm1\n" + "\n" + "movdqu 64(%0), %%xmm2\n" + "movdqu 80(%0), %%xmm3\n" + "pmaddwd 64(%1), %%xmm2\n" + "pmaddwd 80(%1), %%xmm3\n" + "paddd %%xmm2, %%xmm0\n" + "paddd %%xmm3, %%xmm1\n" + "\n" + "movdqu 96(%0), %%xmm2\n" + "movdqu 112(%0), %%xmm3\n" + "pmaddwd 96(%1), %%xmm2\n" + "pmaddwd 112(%1), %%xmm3\n" + "paddd %%xmm2, %%xmm0\n" + "paddd %%xmm3, %%xmm1\n" + "\n" + "movdqu 128(%0), %%xmm2\n" + "movdqu 144(%0), %%xmm3\n" + "pmaddwd 128(%1), %%xmm2\n" + "pmaddwd 144(%1), %%xmm3\n" + "paddd %%xmm2, %%xmm0\n" + "paddd %%xmm3, %%xmm1\n" + "\n" + "psrad %4, %%xmm0\n" + "psrad %4, %%xmm1\n" + "\n" + "movdqa %%xmm0, %%xmm2\n" + "movdqa %%xmm1, %%xmm3\n" + "punpckhqdq %%xmm2, %%xmm2\n" + "punpckhqdq %%xmm3, %%xmm3\n" + "movdq2q %%xmm0, %%mm0\n" + "movdq2q %%xmm2, %%mm1\n" + "movdq2q %%xmm1, %%mm2\n" + "movdq2q %%xmm3, %%mm3\n" + "\n" + "packssdw %%mm0, %%mm0\n" + "packssdw %%mm1, %%mm1\n" + "packssdw %%mm2, %%mm2\n" + "packssdw %%mm3, %%mm3\n" + "\n" + "movq %%mm0, %%mm4\n" + "movq %%mm0, %%mm5\n" + "pmaddwd 160(%1), %%mm4\n" + "pmaddwd 168(%1), %%mm5\n" + "\n" + "movq %%mm1, %%mm6\n" + "movq %%mm1, %%mm7\n" + "pmaddwd 192(%1), %%mm6\n" + "pmaddwd 200(%1), %%mm7\n" + "paddd %%mm6, %%mm4\n" + "paddd %%mm7, %%mm5\n" + "\n" + "movq %%mm2, %%mm6\n" + "movq %%mm2, %%mm7\n" + "pmaddwd 224(%1), %%mm6\n" + "pmaddwd 232(%1), %%mm7\n" + "paddd %%mm6, %%mm4\n" + "paddd %%mm7, %%mm5\n" + "\n" + "movq %%mm3, %%mm6\n" + "movq %%mm3, %%mm7\n" + "pmaddwd 256(%1), %%mm6\n" + "pmaddwd 264(%1), %%mm7\n" + "paddd %%mm6, %%mm4\n" + "paddd %%mm7, %%mm5\n" + "\n" + "movq %%mm4, (%3)\n" + "movq %%mm5, 8(%3)\n" + "\n" + "movq %%mm0, %%mm5\n" + "pmaddwd 176(%1), %%mm0\n" + "pmaddwd 184(%1), %%mm5\n" + "\n" + "movq %%mm1, %%mm7\n" + "pmaddwd 208(%1), %%mm1\n" + "pmaddwd 216(%1), %%mm7\n" + "paddd %%mm1, %%mm0\n" + "paddd %%mm7, %%mm5\n" + "\n" + "movq %%mm2, %%mm7\n" + "pmaddwd 240(%1), %%mm2\n" + "pmaddwd 248(%1), %%mm7\n" + "paddd %%mm2, %%mm0\n" + "paddd %%mm7, %%mm5\n" + "\n" + "movq %%mm3, %%mm7\n" + "pmaddwd 272(%1), %%mm3\n" + "pmaddwd 280(%1), %%mm7\n" + "paddd %%mm3, %%mm0\n" + "paddd %%mm7, %%mm5\n" + "\n" + "movq %%mm0, 16(%3)\n" + "movq %%mm5, 24(%3)\n" + : + : "r" (in), "r" (consts), "r" (&round_c), "r" (out), + "i" (SBC_PROTO_FIXED8_SCALE) + : "cc", "memory"); +} + +static inline void sbc_analyze_4b_4s_sse(struct sbc_encoder_state *state, + int16_t *x, int32_t *out, int out_stride) +{ + /* Analyze blocks */ + sbc_analyze_four_sse(x + 12, out, analysis_consts_fixed4_simd_odd); + out += out_stride; + sbc_analyze_four_sse(x + 8, out, analysis_consts_fixed4_simd_even); + out += out_stride; + sbc_analyze_four_sse(x + 4, out, analysis_consts_fixed4_simd_odd); + out += out_stride; + sbc_analyze_four_sse(x + 0, out, analysis_consts_fixed4_simd_even); + + __asm__ volatile ("emms\n"); +} + +static inline void sbc_analyze_4b_8s_sse(struct sbc_encoder_state *state, + int16_t *x, int32_t *out, int out_stride) +{ + /* Analyze blocks */ + sbc_analyze_eight_sse(x + 24, out, analysis_consts_fixed8_simd_odd); + out += out_stride; + sbc_analyze_eight_sse(x + 16, out, analysis_consts_fixed8_simd_even); + out += out_stride; + sbc_analyze_eight_sse(x + 8, out, analysis_consts_fixed8_simd_odd); + out += out_stride; + sbc_analyze_eight_sse(x + 0, out, analysis_consts_fixed8_simd_even); + + __asm__ volatile ("emms\n"); +} + +static inline void sbc_analyze_1b_8s_sse_even(struct sbc_encoder_state *state, + int16_t *x, int32_t *out, int out_stride); + +static inline void sbc_analyze_1b_8s_sse_odd(struct sbc_encoder_state *state, + int16_t *x, int32_t *out, int out_stride) +{ + sbc_analyze_eight_sse(x, out, analysis_consts_fixed8_simd_odd); + state->sbc_analyze_8s = sbc_analyze_1b_8s_sse_even; + + __asm__ volatile ("emms\n"); +} + +static inline void sbc_analyze_1b_8s_sse_even(struct sbc_encoder_state *state, + int16_t *x, int32_t *out, int out_stride) +{ + sbc_analyze_eight_sse(x, out, analysis_consts_fixed8_simd_even); + state->sbc_analyze_8s = sbc_analyze_1b_8s_sse_odd; + + __asm__ volatile ("emms\n"); +} + +static void sbc_calc_scalefactors_sse( + int32_t sb_sample_f[16][2][8], + uint32_t scale_factor[2][8], + int blocks, int channels, int subbands) +{ + static const SBC_ALIGNED int32_t consts[2] = { + 1 << SCALE_OUT_BITS, + 1 << SCALE_OUT_BITS, + }; + int ch, sb; + intptr_t blk; + for (ch = 0; ch < channels; ch++) { + for (sb = 0; sb < subbands; sb += 2) { + blk = (blocks - 1) * (((char *) &sb_sample_f[1][0][0] - + (char *) &sb_sample_f[0][0][0])); + __asm__ volatile ( + "movq (%4), %%mm0\n" + "1:\n" + "movq (%1, %0), %%mm1\n" + "pxor %%mm2, %%mm2\n" + "pcmpgtd %%mm2, %%mm1\n" + "paddd (%1, %0), %%mm1\n" + "pcmpgtd %%mm1, %%mm2\n" + "pxor %%mm2, %%mm1\n" + + "por %%mm1, %%mm0\n" + + "sub %2, %0\n" + "jns 1b\n" + + "movd %%mm0, %k0\n" + "psrlq $32, %%mm0\n" + "bsrl %k0, %k0\n" + "subl %5, %k0\n" + "movl %k0, (%3)\n" + + "movd %%mm0, %k0\n" + "bsrl %k0, %k0\n" + "subl %5, %k0\n" + "movl %k0, 4(%3)\n" + : "+r" (blk) + : "r" (&sb_sample_f[0][ch][sb]), + "i" ((char *) &sb_sample_f[1][0][0] - + (char *) &sb_sample_f[0][0][0]), + "r" (&scale_factor[ch][sb]), + "r" (&consts), + "i" (SCALE_OUT_BITS) + : "cc", "memory"); + } + } + __asm__ volatile ("emms\n"); +} + +void sbc_init_primitives_sse(struct sbc_encoder_state *state) +{ + state->sbc_analyze_4s = sbc_analyze_4b_4s_sse; + if (state->increment == 1) + state->sbc_analyze_8s = sbc_analyze_1b_8s_sse_odd; + else + state->sbc_analyze_8s = sbc_analyze_4b_8s_sse; + state->sbc_calc_scalefactors = sbc_calc_scalefactors_sse; + state->implementation_info = "SSE"; +} + +#else +void sbc_init_primitives_sse(struct sbc_encoder_state *state) +{ +} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/sbc/sbc_primitives_sse.h new/sbc-1.5/sbc/sbc_primitives_sse.h --- old/sbc-1.4/sbc/sbc_primitives_sse.h 1970-01-01 01:00:00.000000000 +0100 +++ new/sbc-1.5/sbc/sbc_primitives_sse.h 2020-12-07 23:26:08.000000000 +0100 @@ -0,0 +1,38 @@ +/* + * + * Bluetooth low-complexity, subband codec (SBC) library + * + * Copyright (C) 2020 Intel Corporation + * + * + * 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_SSE_H +#define __SBC_PRIMITIVES_SSE_H + +#include "sbc_primitives.h" + +#if defined(__GNUC__) && (defined(__i386__) || defined(__amd64__)) && \ + !defined(SBC_HIGH_PRECISION) && (SCALE_OUT_BITS == 15) + +#define SBC_BUILD_WITH_SSE_SUPPORT + +void sbc_init_primitives_sse(struct sbc_encoder_state *encoder_state); + +#endif + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sbc-1.4/src/sbcenc.c new/sbc-1.5/src/sbcenc.c --- old/sbc-1.4/src/sbcenc.c 2013-04-30 18:19:23.000000000 +0200 +++ new/sbc-1.5/src/sbcenc.c 2020-12-07 23:26:08.000000000 +0100 @@ -105,6 +105,10 @@ case 48000: sbc.frequency = SBC_FREQ_48000; break; + default: + fprintf(stderr, "Unsupported sample rate %ukHz\n", + BE_INT(au_hdr.sample_rate)); + goto done; } srate = BE_INT(au_hdr.sample_rate); @@ -138,7 +142,6 @@ blocks == 12 ? SBC_BLK_12 : SBC_BLK_16; } else { if (BE_INT(au_hdr.sample_rate) != 16000 || - BE_INT(au_hdr.channels) != 1 || BE_INT(au_hdr.channels) != 1) { fprintf(stderr, "mSBC requires 16 bits, 16kHz, mono " "input\n");
