FFmpeg
float_dsp_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 <stdint.h>
22 
23 #include "config.h"
24 #include "libavutil/attributes.h"
25 #include "libavutil/cpu.h"
26 #include "libavutil/float_dsp.h"
27 
28 void ff_vector_fmul_rvv(float *dst, const float *src0, const float *src1,
29  int len);
30 void ff_vector_fmac_scalar_rvv(float *dst, const float *src, float mul,
31  int len);
32 void ff_vector_fmul_scalar_rvv(float *dst, const float *src, float mul,
33  int len);
34 void ff_vector_fmul_window_rvv(float *dst, const float *src0,
35  const float *src1, const float *win, int len);
36 void ff_vector_fmul_add_rvv(float *dst, const float *src0, const float *src1,
37  const float *src2, int len);
38 void ff_vector_fmul_reverse_rvv(float *dst, const float *src0,
39  const float *src1, int len);
40 void ff_butterflies_float_rvv(float *v1, float *v2, int len);
41 float ff_scalarproduct_float_rvv(const float *v1, const float *v2, int len);
42 
43 void ff_vector_dmul_rvv(double *dst, const double *src0, const double *src1,
44  int len);
45 void ff_vector_dmac_scalar_rvv(double *dst, const double *src, double mul,
46  int len);
47 void ff_vector_dmul_scalar_rvv(double *dst, const double *src, double mul,
48  int len);
49 
51 {
52 #if HAVE_RVV
53  int flags = av_get_cpu_flags();
54 
56  if (flags & AV_CPU_FLAG_RVV_F32) {
65  }
66 
67  if (flags & AV_CPU_FLAG_RVV_F64) {
71  }
72  }
73 #endif
74 }
ff_vector_fmul_add_rvv
void ff_vector_fmul_add_rvv(float *dst, const float *src0, const float *src1, const float *src2, int len)
AVFloatDSPContext::butterflies_float
void(* butterflies_float)(float *restrict v1, float *restrict v2, int len)
Calculate the sum and difference of two vectors of floats.
Definition: float_dsp.h:162
src1
const pixel * src1
Definition: h264pred_template.c:421
AVFloatDSPContext::vector_fmul_reverse
void(* vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len)
Calculate the entry wise product of two vectors of floats, and store the result in a vector of floats...
Definition: float_dsp.h:152
ff_vector_fmul_rvv
void ff_vector_fmul_rvv(float *dst, const float *src0, const float *src1, int len)
AVFloatDSPContext::vector_dmul
void(* vector_dmul)(double *dst, const double *src0, const double *src1, int len)
Calculate the entry wise product of two vectors of doubles and store the result in a vector of double...
Definition: float_dsp.h:188
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_vector_dmul_scalar_rvv
void ff_vector_dmul_scalar_rvv(double *dst, const double *src, double mul, int len)
AV_CPU_FLAG_RVV_F64
#define AV_CPU_FLAG_RVV_F64
Vectors of double's.
Definition: cpu.h:90
win
static float win(SuperEqualizerContext *s, float n, int N)
Definition: af_superequalizer.c:120
AV_CPU_FLAG_RVV_F32
#define AV_CPU_FLAG_RVV_F32
Vectors of float's *‍/.
Definition: cpu.h:88
av_cold
#define av_cold
Definition: attributes.h:90
ff_vector_fmul_scalar_rvv
void ff_vector_fmul_scalar_rvv(float *dst, const float *src, float mul, int len)
AVFloatDSPContext::scalarproduct_float
float(* scalarproduct_float)(const float *v1, const float *v2, int len)
Calculate the scalar product of two vectors of floats.
Definition: float_dsp.h:173
ff_vector_dmac_scalar_rvv
void ff_vector_dmac_scalar_rvv(double *dst, const double *src, double mul, int len)
AV_CPU_FLAG_RVB_ADDR
#define AV_CPU_FLAG_RVB_ADDR
Address bit-manipulations.
Definition: cpu.h:92
AVFloatDSPContext::vector_fmul_scalar
void(* vector_fmul_scalar)(float *dst, const float *src, float mul, int len)
Multiply a vector of floats by a scalar float.
Definition: float_dsp.h:83
float_dsp.h
AVFloatDSPContext::vector_fmul
void(* vector_fmul)(float *dst, const float *src0, const float *src1, int len)
Calculate the entry wise product of two vectors of floats and store the result in a vector of floats.
Definition: float_dsp.h:36
cpu.h
AVFloatDSPContext
Definition: float_dsp.h:22
attributes.h
AVFloatDSPContext::vector_fmac_scalar
void(* vector_fmac_scalar)(float *dst, const float *src, float mul, int len)
Multiply a vector of floats by a scalar float and add to destination vector.
Definition: float_dsp.h:52
src2
const pixel * src2
Definition: h264pred_template.c:422
AVFloatDSPContext::vector_fmul_add
void(* vector_fmul_add)(float *dst, const float *src0, const float *src1, const float *src2, int len)
Calculate the entry wise product of two vectors of floats, add a third vector of floats and store the...
Definition: float_dsp.h:135
ff_vector_fmul_window_rvv
void ff_vector_fmul_window_rvv(float *dst, const float *src0, const float *src1, const float *win, int len)
ff_butterflies_float_rvv
void ff_butterflies_float_rvv(float *v1, float *v2, int len)
ff_vector_dmul_rvv
void ff_vector_dmul_rvv(double *dst, const double *src0, const double *src1, int len)
len
int len
Definition: vorbis_enc_data.h:426
AVFloatDSPContext::vector_dmul_scalar
void(* vector_dmul_scalar)(double *dst, const double *src, double mul, int len)
Multiply a vector of double by a scalar double.
Definition: float_dsp.h:98
ff_vector_fmac_scalar_rvv
void ff_vector_fmac_scalar_rvv(float *dst, const float *src, float mul, int len)
ff_float_dsp_init_riscv
av_cold void ff_float_dsp_init_riscv(AVFloatDSPContext *fdsp)
Definition: float_dsp_init.c:50
ff_scalarproduct_float_rvv
float ff_scalarproduct_float_rvv(const float *v1, const float *v2, int len)
src0
const pixel *const src0
Definition: h264pred_template.c:420
AVFloatDSPContext::vector_fmul_window
void(* vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, int len)
Overlap/add with window function.
Definition: float_dsp.h:117
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
AVFloatDSPContext::vector_dmac_scalar
void(* vector_dmac_scalar)(double *dst, const double *src, double mul, int len)
Multiply a vector of doubles by a scalar double and add to destination vector.
Definition: float_dsp.h:68
ff_vector_fmul_reverse_rvv
void ff_vector_fmul_reverse_rvv(float *dst, const float *src0, const float *src1, int len)