FFmpeg
rgb2rgb.c
Go to the documentation of this file.
1 /*
2  * Copyright © 2022 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 <stdint.h>
22 
23 #include "config.h"
24 #include "libavutil/attributes.h"
25 #include "libavutil/cpu.h"
26 #include "libswscale/rgb2rgb.h"
27 
28 void ff_shuffle_bytes_0321_rvv(const uint8_t *src, uint8_t *dst, int src_len);
29 void ff_shuffle_bytes_2103_rvv(const uint8_t *src, uint8_t *dst, int src_len);
30 void ff_shuffle_bytes_1230_rvv(const uint8_t *src, uint8_t *dst, int src_len);
31 void ff_shuffle_bytes_3012_rvv(const uint8_t *src, uint8_t *dst, int src_len);
32 void ff_shuffle_bytes_3210_rvb(const uint8_t *src, uint8_t *dst, int src_len);
33 void ff_interleave_bytes_rvv(const uint8_t *src1, const uint8_t *src2,
34  uint8_t *dst, int width, int height, int s1stride,
35  int s2stride, int dstride);
36 void ff_deinterleave_bytes_rvv(const uint8_t *src, uint8_t *dst1,
37  uint8_t *dst2, int width, int height,
38  int srcStride, int dst1Stride, int dst2Stride);
39 void ff_uyvytoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
40  const uint8_t *src, int width, int height,
41  int ystride, int uvstride, int src_stride);
42 void ff_yuyvtoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
43  const uint8_t *src, int width, int height,
44  int ystride, int uvstride, int src_stride);
45 
47 {
48 #if HAVE_RV
49  int flags = av_get_cpu_flags();
50 
51 #if (__riscv_xlen == 64)
54 #endif
55 #if HAVE_RVV
65  }
66 #endif
67 #endif
68 }
shuffle_bytes_3012
void(* shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:57
ff_interleave_bytes_rvv
void ff_interleave_bytes_rvv(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, int width, int height, int s1stride, int s2stride, int dstride)
AV_CPU_FLAG_RVB_BASIC
#define AV_CPU_FLAG_RVB_BASIC
Basic bit-manipulations.
Definition: cpu.h:96
src1
const pixel * src1
Definition: h264pred_template.c:421
shuffle_bytes_3210
void(* shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:58
yuyvtoyuv422
void(* yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
Definition: rgb2rgb.c:117
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_RVB
#define AV_CPU_FLAG_RVB
B (bit manipulations)
Definition: cpu.h:102
av_cold
#define av_cold
Definition: attributes.h:90
shuffle_bytes_1230
void(* shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:56
shuffle_bytes_2103
void(* shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:55
interleaveBytes
void(* interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, int width, int height, int src1Stride, int src2Stride, int dstStride)
Definition: rgb2rgb.c:92
ff_shuffle_bytes_3210_rvb
void ff_shuffle_bytes_3210_rvb(const uint8_t *src, uint8_t *dst, int src_len)
ff_shuffle_bytes_1230_rvv
void ff_shuffle_bytes_1230_rvv(const uint8_t *src, uint8_t *dst, int src_len)
height
#define height
Definition: dsp.h:85
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
cpu.h
ff_deinterleave_bytes_rvv
void ff_deinterleave_bytes_rvv(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride, int dst1Stride, int dst2Stride)
shuffle_bytes_0321
void(* shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:54
ff_shuffle_bytes_2103_rvv
void ff_shuffle_bytes_2103_rvv(const uint8_t *src, uint8_t *dst, int src_len)
attributes.h
uyvytoyuv422
void(* uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
Definition: rgb2rgb.c:111
ff_shuffle_bytes_0321_rvv
void ff_shuffle_bytes_0321_rvv(const uint8_t *src, uint8_t *dst, int src_len)
ff_yuyvtoyuv422_rvv
void ff_yuyvtoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int ystride, int uvstride, int src_stride)
src2
const pixel * src2
Definition: h264pred_template.c:422
AV_CPU_FLAG_RVV_I32
#define AV_CPU_FLAG_RVV_I32
Vectors of 8/16/32-bit int's *‍/.
Definition: cpu.h:92
rgb2rgb_init_riscv
av_cold void rgb2rgb_init_riscv(void)
Definition: rgb2rgb.c:46
deinterleaveBytes
void(* deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride, int dst1Stride, int dst2Stride)
Definition: rgb2rgb.c:95
ff_uyvytoyuv422_rvv
void ff_uyvytoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int ystride, int uvstride, int src_stride)
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
width
#define width
Definition: dsp.h:85
rgb2rgb.h
src
#define src
Definition: vp8dsp.c:248
ff_shuffle_bytes_3012_rvv
void ff_shuffle_bytes_3012_rvv(const uint8_t *src, uint8_t *dst, int src_len)