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_uyvytoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
37  const uint8_t *src, int width, int height,
38  int ystride, int uvstride, int src_stride);
39 void ff_yuyvtoyuv422_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 
44 {
45 #if HAVE_RV
46  int flags = av_get_cpu_flags();
47 
48 #if (__riscv_xlen == 64)
51 #endif
52 #if HAVE_RVV
62  }
63  }
64 #endif
65 #endif
66 }
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:91
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:113
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:103
av_cold
#define av_cold
Definition: attributes.h:90
width
#define width
shuffle_bytes_1230
void(* shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:56
AV_CPU_FLAG_RVB_ADDR
#define AV_CPU_FLAG_RVB_ADDR
Address bit-manipulations.
Definition: cpu.h:92
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:88
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)
cpu.h
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)
height
#define height
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:107
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:87
rgb2rgb_init_riscv
av_cold void rgb2rgb_init_riscv(void)
Definition: rgb2rgb.c:43
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)
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
rgb2rgb.h
ff_shuffle_bytes_3012_rvv
void ff_shuffle_bytes_3012_rvv(const uint8_t *src, uint8_t *dst, int src_len)