FFmpeg
lls_init.c
Go to the documentation of this file.
1 /*
2  * Copyright © 2024 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 <assert.h>
22 #include <stdint.h>
23 
24 #include "config.h"
25 #include "libavutil/attributes.h"
26 #include "libavutil/cpu.h"
27 #include "libavutil/riscv/cpu.h"
28 #include "libavutil/lls.h"
29 
30 void ff_lls_update_covariance_rvv(double covar[][36], const double *var,
31  int count);
32 double ff_scalarproduct_double_rvv(const double *, const double *, size_t);
33 
34 static void ff_lls_update_rvv(struct LLSModel *m, const double *var)
35 {
37 }
38 
39 static double ff_lls_evaluate_rvv(struct LLSModel *m, const double *var,
40  int order)
41 {
42  return ff_scalarproduct_double_rvv(m->coeff[order], var, order + 1);
43 }
44 
46 {
47 #if HAVE_RVV
48  int flags = av_get_cpu_flags();
49 
51  if (ff_get_rv_vlenb() > m->indep_count)
54  }
55 #endif
56 }
LLSModel
Linear least squares model.
Definition: lls.h:37
ff_scalarproduct_double_rvv
double ff_scalarproduct_double_rvv(const double *, const double *, size_t)
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_CPU_FLAG_RVV_F64
#define AV_CPU_FLAG_RVV_F64
Vectors of double's.
Definition: cpu.h:95
AV_CPU_FLAG_RVB
#define AV_CPU_FLAG_RVB
B (bit manipulations)
Definition: cpu.h:102
ff_lls_update_rvv
static void ff_lls_update_rvv(struct LLSModel *m, const double *var)
Definition: lls_init.c:34
av_cold
#define av_cold
Definition: attributes.h:90
cpu.h
ff_init_lls_riscv
av_cold void ff_init_lls_riscv(LLSModel *m)
Definition: lls_init.c:45
lls.h
ff_lls_evaluate_rvv
static double ff_lls_evaluate_rvv(struct LLSModel *m, const double *var, int order)
Definition: lls_init.c:39
LLSModel::update_lls
void(* update_lls)(struct LLSModel *m, const double *var)
Take the outer-product of var[] with itself, and add to the covariance matrix.
Definition: lls.h:49
cpu.h
attributes.h
LLSModel::evaluate_lls
double(* evaluate_lls)(struct LLSModel *m, const double *var, int order)
Inner product of var[] and the LPC coefs.
Definition: lls.h:56
LLSModel::indep_count
int indep_count
Definition: lls.h:41
LLSModel::covariance
double covariance[(((32+1)+(4) -1)&~((4) -1))][MAX_VARS_ALIGN]
Definition: lls.h:38
LLSModel::coeff
double coeff[32][MAX_VARS]
Definition: lls.h:39
ff_lls_update_covariance_rvv
void ff_lls_update_covariance_rvv(double covar[][36], const double *var, int count)
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AVRIPEMD::count
uint64_t count
number of bytes in buffer
Definition: ripemd.c:37