mirror of https://github.com/FFmpeg/FFmpeg.git
update_lls_8_c: 7.5 update_lls_8_rvv_f64: 4.2 update_lls_12_c: 14.5 update_lls_12_rvv_f64: 5.7release/7.1
parent
fc85aff72f
commit
eed0a1d3d4
5 changed files with 103 additions and 2 deletions
@ -1,5 +1,7 @@ |
||||
OBJS += riscv/float_dsp_init.o \
|
||||
riscv/fixed_dsp_init.o \
|
||||
riscv/lls_init.o \
|
||||
riscv/cpu.o
|
||||
RVV-OBJS += riscv/float_dsp_rvv.o \
|
||||
riscv/fixed_dsp_rvv.o
|
||||
riscv/fixed_dsp_rvv.o \
|
||||
riscv/lls_rvv.o
|
||||
|
@ -0,0 +1,57 @@ |
||||
/*
|
||||
* Copyright © 2024 Rémi Denis-Courmont. |
||||
* |
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#include <assert.h> |
||||
#include <stdint.h> |
||||
|
||||
#include "config.h" |
||||
#include "libavutil/attributes.h" |
||||
#include "libavutil/cpu.h" |
||||
#include "libavutil/riscv/cpu.h" |
||||
#include "libavutil/lls.h" |
||||
|
||||
void ff_lls_update_covariance_rvv(double covar[][36], const double *var, |
||||
int count); |
||||
double ff_scalarproduct_double_rvv(const double *, const double *, size_t); |
||||
|
||||
static void ff_lls_update_rvv(struct LLSModel *m, const double *var) |
||||
{ |
||||
ff_lls_update_covariance_rvv(m->covariance, var, m->indep_count + 1); |
||||
} |
||||
|
||||
static double ff_lls_evaluate_rvv(struct LLSModel *m, const double *var, |
||||
int order) |
||||
{ |
||||
return ff_scalarproduct_double_rvv(m->coeff[order], var, order + 1); |
||||
} |
||||
|
||||
av_cold void ff_init_lls_riscv(LLSModel *m) |
||||
{ |
||||
#if HAVE_RVV |
||||
int flags = av_get_cpu_flags(); |
||||
|
||||
if ((flags & AV_CPU_FLAG_RVB_ADDR) && (flags & AV_CPU_FLAG_RVV_F64)) { |
||||
if ((flags & AV_CPU_FLAG_RVB_BASIC) && |
||||
ff_get_rv_vlenb() > m->indep_count) |
||||
m->update_lls = ff_lls_update_rvv; |
||||
m->evaluate_lls = ff_lls_evaluate_rvv; |
||||
} |
||||
#endif |
||||
} |
@ -0,0 +1,39 @@ |
||||
/* |
||||
* Copyright © 2024 Rémi Denis-Courmont. |
||||
* |
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#include "asm.S" |
||||
|
||||
func ff_lls_update_covariance_rvv, zve64d, zbb |
||||
vtype_vli t0, a2, t1, e64, ta, ma |
||||
vsetvl zero, a2, t0 |
||||
vle64.v v8, (a1) |
||||
1: |
||||
vfmv.f.s ft0, v8 |
||||
vsetvl zero, a2, t0 |
||||
vle64.v v16, (a0) |
||||
vfmacc.vf v16, ft0, v8 |
||||
addi a2, a2, -1 |
||||
vslidedown.vi v8, v8, 1 |
||||
vse64.v v16, (a0) |
||||
addi a0, a0, (36 + 1) * 8 # 1 row + 1 element |
||||
bnez a2, 1b |
||||
|
||||
ret |
||||
endfunc |
Loading…
Reference in new issue