FFmpeg
Loading...
Searching...
No Matches
sbrdsp_init.c
Go to the documentation of this file.
1/*
2 * Copyright © 2023 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"
23#include "libavutil/cpu.h"
24#include "libavutil/riscv/cpu.h"
25#include "libavcodec/sbrdsp.h"
26
27void ff_sbr_sum64x5_rvv(float *z);
28float ff_sbr_sum_square_rvv(float (*x)[2], int n);
29void ff_sbr_autocorrelate_rvv(const float x[40][2], float phi[3][2][2]);
30void ff_sbr_hf_gen_rvv(float (*X_high)[2], const float (*X_low)[2],
31 const float alpha0[2], const float alpha1[2],
32 float bw, int start, int end);
33void ff_sbr_hf_g_filt_rvv(float (*Y)[2], const float (*X_high)[40][2],
34 const float *g_filt, int m_max, intptr_t ixh);
35void ff_sbr_hf_apply_noise_0_rvv(float (*Y)[2], const float *s,
36 const float *f, int n, int kx, int max);
37void ff_sbr_hf_apply_noise_1_rvv(float (*Y)[2], const float *s,
38 const float *f, int n, int kx, int max);
39void ff_sbr_hf_apply_noise_2_rvv(float (*Y)[2], const float *s,
40 const float *f, int n, int kx, int max);
41void ff_sbr_hf_apply_noise_3_rvv(float (*Y)[2], const float *s,
42 const float *f, int n, int kx, int max);
43
45{
46#if HAVE_RVV
47 int flags = av_get_cpu_flags();
48
50 if (flags & AV_CPU_FLAG_RVB) {
51 c->sum64x5 = ff_sbr_sum64x5_rvv;
52 c->sum_square = ff_sbr_sum_square_rvv;
53 c->hf_gen = ff_sbr_hf_gen_rvv;
54 c->hf_g_filt = ff_sbr_hf_g_filt_rvv;
55 if (ff_get_rv_vlenb() <= 32) {
56 c->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_rvv;
57 c->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_rvv;
58 c->hf_apply_noise[1] = ff_sbr_hf_apply_noise_1_rvv;
59 c->hf_apply_noise[3] = ff_sbr_hf_apply_noise_3_rvv;
60 }
61 }
62 c->autocorrelate = ff_sbr_autocorrelate_rvv;
63 }
64#endif
65}
#define Y
Definition boxblur.h:37
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define f(width, name)
Definition cbs_vp8.c:236
#define s(width, name)
Definition cbs_vp9.c:198
#define max(a, b)
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition cpu.c:109
#define AV_CPU_FLAG_RVB
B (bit manipulations)
Definition cpu.h:104
#define AV_CPU_FLAG_RVV_F32
Vectors of float's *‍/.
Definition cpu.h:98
void ff_sbr_sum64x5_rvv(float *z)
float ff_sbr_sum_square_rvv(float(*x)[2], int n)
void ff_sbr_hf_apply_noise_0_rvv(float(*Y)[2], const float *s, const float *f, int n, int kx, int max)
void ff_sbr_autocorrelate_rvv(const float x[40][2], float phi[3][2][2])
void ff_sbr_hf_apply_noise_2_rvv(float(*Y)[2], const float *s, const float *f, int n, int kx, int max)
void ff_sbr_hf_g_filt_rvv(float(*Y)[2], const float(*X_high)[40][2], const float *g_filt, int m_max, intptr_t ixh)
void ff_sbr_hf_apply_noise_3_rvv(float(*Y)[2], const float *s, const float *f, int n, int kx, int max)
av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c)
Definition sbrdsp_init.c:44
void ff_sbr_hf_apply_noise_1_rvv(float(*Y)[2], const float *s, const float *f, int n, int kx, int max)
void ff_sbr_hf_gen_rvv(float(*X_high)[2], const float(*X_low)[2], const float alpha0[2], const float alpha1[2], float bw, int start, int end)
static double c[64]