FFmpeg
sbcdsp_init.c
Go to the documentation of this file.
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 /**
28  * @file
29  * SBC MMX optimization for some basic "building bricks"
30  */
31 
32 #include "libavutil/attributes.h"
33 #include "libavutil/cpu.h"
34 #include "libavutil/x86/cpu.h"
35 #include "libavcodec/sbcdsp.h"
36 
37 void ff_sbc_analyze_4_mmx(const int16_t *in, int32_t *out, const int16_t *consts);
38 void ff_sbc_analyze_8_mmx(const int16_t *in, int32_t *out, const int16_t *consts);
39 void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8],
40  uint32_t scale_factor[2][8],
41  int blocks, int channels, int subbands);
42 
43 av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
44 {
46 
47  if (EXTERNAL_MMX(cpu_flags)) {
48  s->sbc_analyze_4 = ff_sbc_analyze_4_mmx;
49  s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
50  s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
51  }
52 }
cpu.h
out
FILE * out
Definition: movenc.c:55
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:107
subbands
subbands
Definition: aptx.h:37
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:56
sbcdsp.h
av_cold
#define av_cold
Definition: attributes.h:90
s
#define s(width, name)
Definition: cbs_vp9.c:198
channels
channels
Definition: aptx.h:31
ff_sbc_analyze_4_mmx
void ff_sbc_analyze_4_mmx(const int16_t *in, int32_t *out, const int16_t *consts)
ff_sbc_calc_scalefactors_mmx
void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8], uint32_t scale_factor[2][8], int blocks, int channels, int subbands)
cpu.h
attributes.h
ff_sbc_analyze_8_mmx
void ff_sbc_analyze_8_mmx(const int16_t *in, int32_t *out, const int16_t *consts)
int32_t
int32_t
Definition: audioconvert.c:56
ff_sbcdsp_init_x86
av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
Definition: sbcdsp_init.c:43
EXTERNAL_MMX
#define EXTERNAL_MMX(flags)
Definition: cpu.h:56