FFmpeg
libavfilter
x86
avf_showcqt_init.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Muhammad Faiz <mfcc64@gmail.com>
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include "
libavutil/attributes.h
"
22
#include "
libavutil/cpu.h
"
23
#include "
libavutil/x86/cpu.h
"
24
#include "
libavfilter/avf_showcqt.h
"
25
26
#define DECLARE_CQT_CALC(type) \
27
void ff_showcqt_cqt_calc_##type(AVComplexFloat *dst, const AVComplexFloat *src, \
28
const Coeffs *coeffs, int len, int fft_len)
29
30
DECLARE_CQT_CALC
(
sse
);
31
DECLARE_CQT_CALC
(sse3);
32
DECLARE_CQT_CALC
(avx);
33
DECLARE_CQT_CALC
(fma3);
34
DECLARE_CQT_CALC
(fma4);
35
36
#define permute_coeffs_0 NULL
37
38
static
void
permute_coeffs_01452367
(
float
*v,
int
len
)
39
{
40
int
k;
41
for
(k = 0; k <
len
; k += 8) {
42
FFSWAP
(
float
, v[k+2], v[k+4]);
43
FFSWAP
(
float
, v[k+3], v[k+5]);
44
}
45
}
46
47
av_cold
void
ff_showcqt_init_x86
(
ShowCQTContext
*
s
)
48
{
49
int
cpuflags =
av_get_cpu_flags
();
50
51
#define SELECT_CQT_CALC(type, TYPE, align, perm) \
52
if (EXTERNAL_##TYPE(cpuflags)) { \
53
s->cqt_calc = ff_showcqt_cqt_calc_##type; \
54
s->cqt_align = align; \
55
s->permute_coeffs = permute_coeffs_##perm; \
56
}
57
58
SELECT_CQT_CALC
(
sse
, SSE, 4, 0);
59
SELECT_CQT_CALC
(sse3, SSE3_FAST, 4, 0);
60
SELECT_CQT_CALC
(fma4, FMA4, 4, 0);
// using xmm
61
SELECT_CQT_CALC
(avx, AVX_FAST, 8, 01452367);
62
SELECT_CQT_CALC
(fma3, FMA3_FAST, 8, 01452367);
63
}
DECLARE_CQT_CALC
#define DECLARE_CQT_CALC(type)
Definition:
avf_showcqt_init.c:26
cpu.h
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition:
cpu.c:107
av_cold
#define av_cold
Definition:
attributes.h:90
s
#define s(width, name)
Definition:
cbs_vp9.c:198
ShowCQTContext
Definition:
avf_showcqt.h:45
cpu.h
attributes.h
permute_coeffs_01452367
static void permute_coeffs_01452367(float *v, int len)
Definition:
avf_showcqt_init.c:38
len
int len
Definition:
vorbis_enc_data.h:426
ff_showcqt_init_x86
av_cold void ff_showcqt_init_x86(ShowCQTContext *s)
Definition:
avf_showcqt_init.c:47
FFSWAP
#define FFSWAP(type, a, b)
Definition:
macros.h:52
avf_showcqt.h
SELECT_CQT_CALC
#define SELECT_CQT_CALC(type, TYPE, align, perm)
sse
static int sse(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, int w, int h, int stride)
Definition:
mpegvideo_enc.c:2653
Generated on Mon Nov 25 2024 19:22:27 for FFmpeg by
1.8.17