sbcdsp_init.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Bluetooth low-complexity, subband codec (SBC)
  3. *
  4. * Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
  5. * Copyright (C) 2008-2010 Nokia Corporation
  6. * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
  7. * Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch>
  8. * Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com>
  9. *
  10. * This file is part of FFmpeg.
  11. *
  12. * FFmpeg is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU Lesser General Public
  14. * License as published by the Free Software Foundation; either
  15. * version 2.1 of the License, or (at your option) any later version.
  16. *
  17. * FFmpeg is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. * Lesser General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Lesser General Public
  23. * License along with FFmpeg; if not, write to the Free Software
  24. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  25. */
  26. /**
  27. * @file
  28. * SBC MMX optimization for some basic "building bricks"
  29. */
  30. #include "libavutil/cpu.h"
  31. #include "libavutil/x86/cpu.h"
  32. #include "libavcodec/sbcdsp.h"
  33. void ff_sbc_analyze_4_mmx(const int16_t *in, int32_t *out, const int16_t *consts);
  34. void ff_sbc_analyze_8_mmx(const int16_t *in, int32_t *out, const int16_t *consts);
  35. void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8],
  36. uint32_t scale_factor[2][8],
  37. int blocks, int channels, int subbands);
  38. av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
  39. {
  40. int cpu_flags = av_get_cpu_flags();
  41. if (EXTERNAL_MMX(cpu_flags)) {
  42. s->sbc_analyze_4 = ff_sbc_analyze_4_mmx;
  43. s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
  44. s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
  45. }
  46. }