FFmpeg
opusdsp_init.c
Go to the documentation of this file.
1 /*
2  * Copyright © 2022 Rémi Denis-Courmont.
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 "config.h"
22 
23 #include "libavutil/attributes.h"
24 #include "libavutil/cpu.h"
25 #include "libavutil/riscv/cpu.h"
26 #include "libavcodec/opusdsp.h"
27 
28 void ff_opus_postfilter_rvv_128(float *data, int period, float *g, int len);
29 void ff_opus_postfilter_rvv_256(float *data, int period, float *g, int len);
30 void ff_opus_postfilter_rvv_512(float *data, int period, float *g, int len);
31 void ff_opus_postfilter_rvv_1024(float *data, int period, float *g, int len);
32 
34 {
35 #if HAVE_RVV
36  int flags = av_get_cpu_flags();
37 
39  switch (ff_get_rv_vlenb()) {
40  case 16:
41  d->postfilter = ff_opus_postfilter_rvv_128;
42  break;
43  case 32:
44  d->postfilter = ff_opus_postfilter_rvv_256;
45  break;
46  case 64:
47  d->postfilter = ff_opus_postfilter_rvv_512;
48  break;
49  case 128:
50  d->postfilter = ff_opus_postfilter_rvv_512;
51  break;
52  }
53 #endif
54 }
opusdsp.h
data
const char data[16]
Definition: mxf.c:146
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:103
ff_opus_dsp_init_riscv
av_cold void ff_opus_dsp_init_riscv(OpusDSP *d)
Definition: opusdsp_init.c:33
AV_CPU_FLAG_RVV_F32
#define AV_CPU_FLAG_RVV_F32
Vectors of float's *‍/.
Definition: cpu.h:86
av_cold
#define av_cold
Definition: attributes.h:90
g
const char * g
Definition: vf_curves.c:127
cpu.h
ff_opus_postfilter_rvv_256
void ff_opus_postfilter_rvv_256(float *data, int period, float *g, int len)
ff_opus_postfilter_rvv_1024
void ff_opus_postfilter_rvv_1024(float *data, int period, float *g, int len)
period
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without period
Definition: writing_filters.txt:89
cpu.h
attributes.h
ff_opus_postfilter_rvv_128
void ff_opus_postfilter_rvv_128(float *data, int period, float *g, int len)
len
int len
Definition: vorbis_enc_data.h:426
d
d
Definition: ffmpeg_filter.c:156
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
ff_opus_postfilter_rvv_512
void ff_opus_postfilter_rvv_512(float *data, int period, float *g, int len)
OpusDSP
Definition: opusdsp.h:24