FFmpeg
Loading...
Searching...
No Matches
vp7dsp_init.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 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 "config.h"
22
24#include "libavutil/cpu.h"
25#include "libavutil/riscv/cpu.h"
26#include "libavcodec/vp8dsp.h"
27
28void ff_vp7_luma_dc_wht_rvv(int16_t block[4][4][16], int16_t dc[16]);
29void ff_vp7_idct_add_rvv(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
30void ff_vp78_idct_dc_add_rvv(uint8_t *, int16_t block[16], ptrdiff_t, int dc);
31void ff_vp7_idct_dc_add4y_rvv(uint8_t *dst, int16_t block[4][16], ptrdiff_t);
32void ff_vp7_idct_dc_add4uv_rvv(uint8_t *dst, int16_t block[4][16], ptrdiff_t);
33
34static void ff_vp7_idct_dc_add_rvv(uint8_t *dst, int16_t block[16],
35 ptrdiff_t stride)
36{
37 int dc = (23170 * (23170 * block[0] >> 14) + 0x20000) >> 18;
38
40}
41
43{
44#if HAVE_RVV
45 int flags = av_get_cpu_flags();
46
48 ff_rv_vlen_least(128)) {
49#if __riscv_xlen >= 64
50 c->vp8_luma_dc_wht = ff_vp7_luma_dc_wht_rvv;
51 c->vp8_idct_add = ff_vp7_idct_add_rvv;
52#endif
53 c->vp8_idct_dc_add = ff_vp7_idct_dc_add_rvv;
54 c->vp8_idct_dc_add4y = ff_vp7_idct_dc_add4y_rvv;
56 c->vp8_idct_dc_add4uv = ff_vp7_idct_dc_add4uv_rvv;
57 }
58#endif
59}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define flags(name, subs,...)
Definition cbs_h264.c:74
static int16_t block[64]
Definition dct.c:125
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_RVV_I64
Vectors of 64-bit int's *‍/.
Definition cpu.h:99
#define AV_CPU_FLAG_RVB
B (bit manipulations)
Definition cpu.h:104
#define AV_CPU_FLAG_RVV_I32
Vectors of 8/16/32-bit int's *‍/.
Definition cpu.h:97
#define stride
void ff_vp7_idct_dc_add4uv_rvv(uint8_t *dst, int16_t block[4][16], ptrdiff_t)
void ff_vp7_idct_dc_add4y_rvv(uint8_t *dst, int16_t block[4][16], ptrdiff_t)
static void ff_vp7_idct_dc_add_rvv(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
Definition vp7dsp_init.c:34
void ff_vp7_luma_dc_wht_rvv(int16_t block[4][4][16], int16_t dc[16])
void ff_vp78_idct_dc_add_rvv(uint8_t *, int16_t block[16], ptrdiff_t, int dc)
void ff_vp7_idct_add_rvv(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
av_cold void ff_vp7dsp_init_riscv(VP8DSPContext *c)
Definition vp7dsp_init.c:42
VP8 compatible video decoder.
static double c[64]