Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
0fa421c8
Commit
0fa421c8
authored
Nov 19, 2023
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/llvidencdsp: add R-V V diff_bytes
diff_bytes_c: 163.0 diff_bytes_rvv_i32: 52.7
parent
0183c2c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
1 deletion
+82
-1
lossless_videoencdsp.c
libavcodec/lossless_videoencdsp.c
+3
-1
lossless_videoencdsp.h
libavcodec/lossless_videoencdsp.h
+1
-0
Makefile
libavcodec/riscv/Makefile
+2
-0
llvidencdsp_init.c
libavcodec/riscv/llvidencdsp_init.c
+39
-0
llvidencdsp_rvv.S
libavcodec/riscv/llvidencdsp_rvv.S
+37
-0
No files found.
libavcodec/lossless_videoencdsp.c
View file @
0fa421c8
...
...
@@ -94,7 +94,9 @@ av_cold void ff_llvidencdsp_init(LLVidEncDSPContext *c)
c
->
sub_median_pred
=
sub_median_pred_c
;
c
->
sub_left_predict
=
sub_left_predict_c
;
#if ARCH_X86
#if ARCH_RISCV
ff_llvidencdsp_init_riscv
(
c
);
#elif ARCH_X86
ff_llvidencdsp_init_x86
(
c
);
#endif
}
libavcodec/lossless_videoencdsp.h
View file @
0fa421c8
...
...
@@ -40,6 +40,7 @@ typedef struct LLVidEncDSPContext {
}
LLVidEncDSPContext
;
void
ff_llvidencdsp_init
(
LLVidEncDSPContext
*
c
);
void
ff_llvidencdsp_init_riscv
(
LLVidEncDSPContext
*
c
);
void
ff_llvidencdsp_init_x86
(
LLVidEncDSPContext
*
c
);
#endif
/* AVCODEC_LOSSLESS_VIDEOENCDSP_H */
libavcodec/riscv/Makefile
View file @
0fa421c8
...
...
@@ -30,6 +30,8 @@ OBJS-$(CONFIG_LLAUDDSP) += riscv/llauddsp_init.o
RVV-OBJS-$(CONFIG_LLAUDDSP)
+=
riscv/llauddsp_rvv.o
OBJS-$(CONFIG_LLVIDDSP)
+=
riscv/llviddsp_init.o
RVV-OBJS-$(CONFIG_LLVIDDSP)
+=
riscv/llviddsp_rvv.o
OBJS-$(CONFIG_LLVIDENCDSP)
+=
riscv/llvidencdsp_init.o
RVV-OBJS-$(CONFIG_LLVIDENCDSP)
+=
riscv/llvidencdsp_rvv.o
OBJS-$(CONFIG_OPUS_DECODER)
+=
riscv/opusdsp_init.o
RVV-OBJS-$(CONFIG_OPUS_DECODER)
+=
riscv/opusdsp_rvv.o
OBJS-$(CONFIG_PIXBLOCKDSP)
+=
riscv/pixblockdsp_init.o
\
...
...
libavcodec/riscv/llvidencdsp_init.c
0 → 100644
View file @
0fa421c8
/*
* Copyright © 2023 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 "config.h"
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavcodec/lossless_videoencdsp.h"
void
ff_llvidenc_diff_bytes_rvv
(
uint8_t
*
dst
,
const
uint8_t
*
src1
,
const
uint8_t
*
src2
,
intptr_t
w
);
av_cold
void
ff_llvidencdsp_init_riscv
(
LLVidEncDSPContext
*
c
)
{
#if HAVE_RVV
int
flags
=
av_get_cpu_flags
();
if
(
flags
&
AV_CPU_FLAG_RVV_I32
)
{
c
->
diff_bytes
=
ff_llvidenc_diff_bytes_rvv
;
}
#endif
}
libavcodec/riscv/llvidencdsp_rvv.S
0 → 100644
View file @
0fa421c8
/*
* Copyright © 2023 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 "libavutil/riscv/asm.S"
func ff_llvidenc_diff_bytes_rvv, zve32x
1:
vsetvli t0, a3, e8, m8, ta, ma
vle8.v v0, (a1)
sub a3, a3, t0
vle8.v v8, (a2)
add a1, t0, a1
vsub.vv v8, v0, v8
add a2, t0, a2
vse8.v v8, (a0)
add a0, t0, a0
bnez a3, 1b
ret
endfunc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment