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