FFmpeg
Loading...
Searching...
No Matches
vf_gblur_init.c
Go to the documentation of this file.
1/*
2 *
3 * This file is part of FFmpeg.
4 *
5 * FFmpeg is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * FFmpeg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with FFmpeg; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "config.h"
21
23#include "libavutil/cpu.h"
24#include "libavutil/mem.h"
25#include "libavutil/x86/cpu.h"
26#include "libavfilter/gblur.h"
27
28void ff_horiz_slice_sse4(float *ptr, int width, int height, int steps, float nu, float bscale, float *localbuf);
29void ff_horiz_slice_avx2(float *ptr, int width, int height, int steps, float nu, float bscale, float *localbuf);
30void ff_horiz_slice_avx512(float *ptr, int width, int height, int steps, float nu, float bscale, float *localbuf);
31
32void ff_postscale_slice_sse(float *ptr, int length, float postscale, float min, float max);
33void ff_postscale_slice_avx2(float *ptr, int length, float postscale, float min, float max);
34void ff_postscale_slice_avx512(float *ptr, int length, float postscale, float min, float max);
35
36void ff_verti_slice_avx2(float *buffer, int width, int height, int column_begin, int column_end,
37 int steps, float nu, float bscale);
38void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begin, int column_end,
39 int steps, float nu, float bscale);
40
42{
44
46 s->postscale_slice = ff_postscale_slice_sse;
47 }
49 s->postscale_slice = ff_postscale_slice_avx2;
50 }
51#if ARCH_X86_64
53 s->horiz_slice = ff_horiz_slice_sse4;
54 }
56 s->verti_slice = ff_verti_slice_avx2;
57 }
59 s->postscale_slice = ff_postscale_slice_avx512;
60 s->verti_slice = ff_verti_slice_avx512;
61 }
63 s->stride = EXTERNAL_AVX512(cpu_flags) ? 16 : 8;
64 s->localbuf = av_malloc(s->stride * sizeof(float) * s->planewidth[0] * s->planeheight[0]);
65 if (!s->localbuf)
66 return;
67
68 s->horiz_slice = ff_horiz_slice_avx2;
70 s->horiz_slice = ff_horiz_slice_avx512;
71 }
72 }
73#endif
74}
#define s(width, name)
Definition cbs_vp9.c:198
#define min(a, b)
#define max(a, b)
static const FLOAT postscale[64]
Definition faandct.c:55
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
static atomic_int cpu_flags
Definition cpu.c:56
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition cpu.c:109
#define EXTERNAL_SSE(flags)
Definition cpu.h:52
#define EXTERNAL_AVX2_FAST(flags)
Definition cpu.h:73
#define EXTERNAL_SSE4(flags)
Definition cpu.h:62
#define EXTERNAL_AVX512(flags)
Definition cpu.h:77
#define EXTERNAL_AVX2(flags)
Definition cpu.h:72
Memory handling functions.
static const int16_t steps[16]
Definition misc4.c:30
#define av_malloc(s)
Definition ops_static.c:52
static char buffer[20]
Definition seek.c:32
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
void ff_postscale_slice_avx2(float *ptr, int length, float postscale, float min, float max)
void ff_horiz_slice_avx512(float *ptr, int width, int height, int steps, float nu, float bscale, float *localbuf)
void ff_verti_slice_avx2(float *buffer, int width, int height, int column_begin, int column_end, int steps, float nu, float bscale)
void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begin, int column_end, int steps, float nu, float bscale)
void ff_horiz_slice_avx2(float *ptr, int width, int height, int steps, float nu, float bscale, float *localbuf)
av_cold void ff_gblur_init_x86(GBlurContext *s)
void ff_horiz_slice_sse4(float *ptr, int width, int height, int steps, float nu, float bscale, float *localbuf)
void ff_postscale_slice_sse(float *ptr, int length, float postscale, float min, float max)
void ff_postscale_slice_avx512(float *ptr, int length, float postscale, float min, float max)