FFmpeg
rgb2rgb.c
Go to the documentation of this file.
1 /*
2  * software RGB to RGB converter
3  * pluralize by software PAL8 to RGB converter
4  * software YUV to YUV converter
5  * software YUV to RGB converter
6  * Written by Nick Kurshev.
7  * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
8  *
9  * This file is part of FFmpeg.
10  *
11  * FFmpeg is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * FFmpeg is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with FFmpeg; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24  */
25 
26 #include <inttypes.h>
27 
28 #include "libavutil/attributes.h"
29 #include "libavutil/bswap.h"
30 #include "config.h"
31 #include "rgb2rgb.h"
32 #include "swscale.h"
33 #include "swscale_internal.h"
34 
35 void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
36 void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
37 void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
38 void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size);
39 void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
40 void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
41 void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
42 void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
43 void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
44 
45 void (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size);
46 void (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size);
47 void (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size);
48 void (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size);
49 void (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size);
50 void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size);
51 void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size);
52 void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size);
53 
54 void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size);
55 void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size);
56 void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size);
57 void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size);
58 void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size);
59 
60 
61 void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
62  const uint8_t *vsrc, uint8_t *dst,
63  int width, int height,
64  int lumStride, int chromStride, int dstStride);
65 void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc,
66  const uint8_t *vsrc, uint8_t *dst,
67  int width, int height,
68  int lumStride, int chromStride, int dstStride);
69 void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
70  const uint8_t *vsrc, uint8_t *dst,
71  int width, int height,
72  int lumStride, int chromStride, int dstStride);
73 void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc,
74  const uint8_t *vsrc, uint8_t *dst,
75  int width, int height,
76  int lumStride, int chromStride, int dstStride);
77 void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst,
78  uint8_t *udst, uint8_t *vdst,
79  int width, int height,
80  int lumStride, int chromStride, int srcStride);
81 void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst,
82  uint8_t *udst, uint8_t *vdst,
83  int width, int height,
84  int lumStride, int chromStride, int srcStride,
85  int32_t *rgb2yuv);
86 void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
87  int srcStride, int dstStride);
88 void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
89  int width, int height, int src1Stride,
90  int src2Stride, int dstStride);
91 void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
92  int width, int height, int srcStride,
93  int dst1Stride, int dst2Stride);
94 void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
95  uint8_t *dst1, uint8_t *dst2,
96  int width, int height,
97  int srcStride1, int srcStride2,
98  int dstStride1, int dstStride2);
99 void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2,
100  const uint8_t *src3, uint8_t *dst,
101  int width, int height,
102  int srcStride1, int srcStride2,
103  int srcStride3, int dstStride);
104 void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
105  const uint8_t *src, int width, int height,
106  int lumStride, int chromStride, int srcStride);
107 void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
108  const uint8_t *src, int width, int height,
109  int lumStride, int chromStride, int srcStride);
110 void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
111  const uint8_t *src, int width, int height,
112  int lumStride, int chromStride, int srcStride);
113 void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
114  const uint8_t *src, int width, int height,
115  int lumStride, int chromStride, int srcStride);
116 
117 #define BY ((int)( 0.098 * (1 << RGB2YUV_SHIFT) + 0.5))
118 #define BV ((int)(-0.071 * (1 << RGB2YUV_SHIFT) + 0.5))
119 #define BU ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
120 #define GY ((int)( 0.504 * (1 << RGB2YUV_SHIFT) + 0.5))
121 #define GV ((int)(-0.368 * (1 << RGB2YUV_SHIFT) + 0.5))
122 #define GU ((int)(-0.291 * (1 << RGB2YUV_SHIFT) + 0.5))
123 #define RY ((int)( 0.257 * (1 << RGB2YUV_SHIFT) + 0.5))
124 #define RV ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
125 #define RU ((int)(-0.148 * (1 << RGB2YUV_SHIFT) + 0.5))
126 
127 //plain C versions
128 #include "rgb2rgb_template.c"
129 
130 /*
131  * RGB15->RGB16 original by Strepto/Astral
132  * ported to gcc & bugfixed : A'rpi
133  * MMXEXT, 3DNOW optimization by Nick Kurshev
134  * 32-bit C version, and and&add trick by Michael Niedermayer
135  */
136 
138 {
139  rgb2rgb_init_c();
140 #if ARCH_AARCH64
142 #elif ARCH_RISCV
144 #elif ARCH_X86
146 #elif ARCH_LOONGARCH64
148 #endif
149 }
150 
151 void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
152 {
153  int i, num_pixels = src_size >> 2;
154 
155  for (i = 0; i < num_pixels; i++) {
156 #if HAVE_BIGENDIAN
157  /* RGB32 (= A,B,G,R) -> BGR24 (= B,G,R) */
158  dst[3 * i + 0] = src[4 * i + 1];
159  dst[3 * i + 1] = src[4 * i + 2];
160  dst[3 * i + 2] = src[4 * i + 3];
161 #else
162  dst[3 * i + 0] = src[4 * i + 2];
163  dst[3 * i + 1] = src[4 * i + 1];
164  dst[3 * i + 2] = src[4 * i + 0];
165 #endif
166  }
167 }
168 
169 void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size)
170 {
171  int i;
172 
173  for (i = 0; 3 * i < src_size; i++) {
174 #if HAVE_BIGENDIAN
175  /* RGB24 (= R, G, B) -> BGR32 (= A, R, G, B) */
176  dst[4 * i + 0] = 255;
177  dst[4 * i + 1] = src[3 * i + 0];
178  dst[4 * i + 2] = src[3 * i + 1];
179  dst[4 * i + 3] = src[3 * i + 2];
180 #else
181  dst[4 * i + 0] = src[3 * i + 2];
182  dst[4 * i + 1] = src[3 * i + 1];
183  dst[4 * i + 2] = src[3 * i + 0];
184  dst[4 * i + 3] = 255;
185 #endif
186  }
187 }
188 
189 void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
190 {
191  uint8_t *d = dst;
192  const uint16_t *s = (const uint16_t *)src;
193  const uint16_t *end = s + src_size / 2;
194 
195  while (s < end) {
196  register uint16_t bgr = *s++;
197 #if HAVE_BIGENDIAN
198  *d++ = 255;
199  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
200  *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
201  *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
202 #else
203  *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
204  *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
205  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
206  *d++ = 255;
207 #endif
208  }
209 }
210 
211 void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
212 {
213  uint16_t rgb, r, g, b;
214  uint16_t *d = (uint16_t *)dst;
215  const uint16_t *s = (const uint16_t *)src;
216  const uint16_t *end = s + src_size / 2;
217 
218  while (s < end) {
219  rgb = *s++;
220  r = rgb & 0xF00;
221  g = rgb & 0x0F0;
222  b = rgb & 0x00F;
223  r = (r << 3) | ((r & 0x800) >> 1);
224  g = (g << 2) | ((g & 0x080) >> 2);
225  b = (b << 1) | ( b >> 3);
226  *d++ = r | g | b;
227  }
228 }
229 
230 void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size)
231 {
232  uint8_t *d = dst;
233  const uint16_t *s = (const uint16_t *)src;
234  const uint16_t *end = s + src_size / 2;
235 
236  while (s < end) {
237  register uint16_t bgr = *s++;
238  *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
239  *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
240  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
241  }
242 }
243 
244 void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
245 {
246  int i, num_pixels = src_size >> 1;
247 
248  for (i = 0; i < num_pixels; i++) {
249  unsigned rgb = ((const uint16_t *)src)[i];
250  ((uint16_t *)dst)[i] = (rgb >> 11) | (rgb & 0x7E0) | (rgb << 11);
251  }
252 }
253 
254 void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
255 {
256  int i, num_pixels = src_size >> 1;
257 
258  for (i = 0; i < num_pixels; i++) {
259  unsigned rgb = ((const uint16_t *)src)[i];
260  ((uint16_t *)dst)[i] = (rgb >> 11) | ((rgb & 0x7C0) >> 1) | ((rgb & 0x1F) << 10);
261  }
262 }
263 
264 void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
265 {
266  uint8_t *d = dst;
267  const uint16_t *s = (const uint16_t *)src;
268  const uint16_t *end = s + src_size / 2;
269 
270  while (s < end) {
271  register uint16_t bgr = *s++;
272 #if HAVE_BIGENDIAN
273  *d++ = 255;
274  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
275  *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
276  *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
277 #else
278  *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
279  *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
280  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
281  *d++ = 255;
282 #endif
283  }
284 }
285 
286 void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)
287 {
288  uint8_t *d = dst;
289  const uint16_t *s = (const uint16_t *)src;
290  const uint16_t *end = s + src_size / 2;
291 
292  while (s < end) {
293  register uint16_t bgr = *s++;
294  *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
295  *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
296  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
297  }
298 }
299 
300 void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
301 {
302  int i, num_pixels = src_size >> 1;
303 
304  for (i = 0; i < num_pixels; i++) {
305  unsigned rgb = ((const uint16_t *)src)[i];
306  ((uint16_t *)dst)[i] = ((rgb & 0x7C00) >> 10) | ((rgb & 0x3E0) << 1) | (rgb << 11);
307  }
308 }
309 
310 void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
311 {
312  int i, num_pixels = src_size >> 1;
313 
314  for (i = 0; i < num_pixels; i++) {
315  unsigned rgb = ((const uint16_t *)src)[i];
316  unsigned br = rgb & 0x7C1F;
317  ((uint16_t *)dst)[i] = (br >> 10) | (rgb & 0x3E0) | (br << 10);
318  }
319 }
320 
321 void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
322 {
323  uint16_t *d = (uint16_t *)dst;
324  const uint16_t *s = (const uint16_t *)src;
325  int i, num_pixels = src_size >> 1;
326 
327  for (i = 0; i < num_pixels; i++) {
328  unsigned rgb = s[i];
329  d[i] = (rgb << 8 | rgb & 0xF0 | rgb >> 8) & 0xFFF;
330  }
331 }
332 
333 #define DEFINE_RGB48TOBGR48(need_bswap, swap) \
334 void rgb48tobgr48_ ## need_bswap(const uint8_t *src, \
335  uint8_t *dst, int src_size) \
336 { \
337  uint16_t *d = (uint16_t *)dst; \
338  const uint16_t *s = (const uint16_t *)src; \
339  int i, num_pixels = src_size >> 1; \
340  \
341  for (i = 0; i < num_pixels; i += 3) { \
342  d[i ] = swap ? av_bswap16(s[i + 2]) : s[i + 2]; \
343  d[i + 1] = swap ? av_bswap16(s[i + 1]) : s[i + 1]; \
344  d[i + 2] = swap ? av_bswap16(s[i ]) : s[i ]; \
345  } \
346 }
347 
348 DEFINE_RGB48TOBGR48(nobswap, 0)
349 DEFINE_RGB48TOBGR48(bswap, 1)
350 
351 #define DEFINE_RGB64TOBGR48(need_bswap, swap) \
352 void rgb64tobgr48_ ## need_bswap(const uint8_t *src, \
353  uint8_t *dst, int src_size) \
354 { \
355  uint16_t *d = (uint16_t *)dst; \
356  const uint16_t *s = (const uint16_t *)src; \
357  int i, num_pixels = src_size >> 3; \
358  \
359  for (i = 0; i < num_pixels; i++) { \
360  d[3 * i ] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
361  d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
362  d[3 * i + 2] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
363  } \
364 }
365 
366 DEFINE_RGB64TOBGR48(nobswap, 0)
367 DEFINE_RGB64TOBGR48(bswap, 1)
368 
369 #define DEFINE_RGB64TO48(need_bswap, swap) \
370 void rgb64to48_ ## need_bswap(const uint8_t *src, \
371  uint8_t *dst, int src_size) \
372 { \
373  uint16_t *d = (uint16_t *)dst; \
374  const uint16_t *s = (const uint16_t *)src; \
375  int i, num_pixels = src_size >> 3; \
376  \
377  for (i = 0; i < num_pixels; i++) { \
378  d[3 * i ] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
379  d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
380  d[3 * i + 2] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
381  } \
382 }
383 
384 DEFINE_RGB64TO48(nobswap, 0)
385 DEFINE_RGB64TO48(bswap, 1)
386 
387 #define DEFINE_RGB48TOBGR64(need_bswap, swap) \
388 void rgb48tobgr64_ ## need_bswap(const uint8_t *src, \
389  uint8_t *dst, int src_size) \
390 { \
391  uint16_t *d = (uint16_t *)dst; \
392  const uint16_t *s = (const uint16_t *)src; \
393  int i, num_pixels = src_size / 6; \
394  \
395  for (i = 0; i < num_pixels; i++) { \
396  d[4 * i ] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
397  d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
398  d[4 * i + 2] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
399  d[4 * i + 3] = 0xFFFF; \
400  } \
401 }
402 
403 DEFINE_RGB48TOBGR64(nobswap, 0)
404 DEFINE_RGB48TOBGR64(bswap, 1)
405 
406 #define DEFINE_RGB48TO64(need_bswap, swap) \
407 void rgb48to64_ ## need_bswap(const uint8_t *src, \
408  uint8_t *dst, int src_size) \
409 { \
410  uint16_t *d = (uint16_t *)dst; \
411  const uint16_t *s = (const uint16_t *)src; \
412  int i, num_pixels = src_size / 6; \
413  \
414  for (i = 0; i < num_pixels; i++) { \
415  d[4 * i ] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
416  d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
417  d[4 * i + 2] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
418  d[4 * i + 3] = 0xFFFF; \
419  } \
420 }
421 
422 DEFINE_RGB48TO64(nobswap, 0)
423 DEFINE_RGB48TO64(bswap, 1)
rgb12tobgr12
void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:321
rgb32tobgr24
void(* rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:35
shuffle_bytes_3012
void(* shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:57
r
const char * r
Definition: vf_curves.c:126
yv12toyuy2
void(* yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Height should be a multiple of 2 and width should be a multiple of 16.
Definition: rgb2rgb.c:61
rgb15to24
void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:286
rgb2rgb_template.c
src1
const pixel * src1
Definition: h264pred_template.c:421
yuy2toyv12
void(* yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride)
Height should be a multiple of 2 and width should be a multiple of 16.
Definition: rgb2rgb.c:77
rgb16tobgr32
void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:189
b
#define b
Definition: input.c:41
shuffle_bytes_3210
void(* shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:58
rgb2yuv
static const char rgb2yuv[]
Definition: vf_scale_vulkan.c:70
rgb32tobgr16
void(* rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:36
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
rgb24tobgr16
void(* rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:40
rgb15to32
void(* rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:52
DEFINE_RGB48TOBGR48
#define DEFINE_RGB48TOBGR48(need_bswap, swap)
Definition: rgb2rgb.c:333
yv12touyvy
void(* yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Height should be a multiple of 2 and width should be a multiple of 16.
Definition: rgb2rgb.c:65
rgb32to16
void(* rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:45
rgb
Definition: rpzaenc.c:60
rgb16tobgr16
void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:244
ff_rgb24toyv12
void(* ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride, int32_t *rgb2yuv)
Height should be a multiple of 2 and width should be a multiple of 2.
Definition: rgb2rgb.c:81
DEFINE_RGB64TOBGR48
#define DEFINE_RGB64TOBGR48(need_bswap, swap)
Definition: rgb2rgb.c:351
av_cold
#define av_cold
Definition: attributes.h:90
rgb16tobgr24
void(* rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:42
width
#define width
s
#define s(width, name)
Definition: cbs_vp9.c:198
g
const char * g
Definition: vf_curves.c:127
shuffle_bytes_1230
void(* shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:56
rgb15tobgr24
void(* rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:43
yuv422ptoyuy2
void(* yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Width should be a multiple of 16.
Definition: rgb2rgb.c:69
shuffle_bytes_2103
void(* shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:55
rgb32tobgr15
void(* rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:37
rgb16to24
void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:230
rgb12to15
void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:211
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
rgb2rgb_init_aarch64
av_cold void rgb2rgb_init_aarch64(void)
Definition: rgb2rgb.c:34
yvu9_to_yuy2
void(* yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, uint8_t *dst, int width, int height, int srcStride1, int srcStride2, int srcStride3, int dstStride)
Definition: rgb2rgb.c:99
rgb16to15
void(* rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:50
ff_sws_rgb2rgb_init
av_cold void ff_sws_rgb2rgb_init(void)
Definition: rgb2rgb.c:137
yuyvtoyuv420
void(* yuyvtoyuv420)(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:110
rgb15tobgr16
void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:300
rgb24tobgr32
void(* rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:38
DEFINE_RGB48TOBGR64
#define DEFINE_RGB48TOBGR64(need_bswap, swap)
Definition: rgb2rgb.c:387
rgb2rgb_init_x86
av_cold void rgb2rgb_init_x86(void)
Definition: rgb2rgb.c:141
shuffle_bytes_0321
void(* shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:54
rgb32to24
void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:151
rgb15tobgr15
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:310
height
#define height
attributes.h
rgb24to16
void(* rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:47
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
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
rgb24to15
void(* rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:48
src2
const pixel * src2
Definition: h264pred_template.c:422
rgb32to15
void(* rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:46
swscale_internal.h
rgb2rgb_init_riscv
av_cold void rgb2rgb_init_riscv(void)
Definition: rgb2rgb.c:43
bswap.h
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:91
rgb2rgb_init_c
static av_cold void rgb2rgb_init_c(void)
Definition: rgb2rgb_template.c:947
uyvytoyuv420
void(* uyvytoyuv420)(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:104
rgb16to32
void(* rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:49
rgb24to32
void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:169
rgb24tobgr15
void(* rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:41
rgb15tobgr32
void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:264
rgb15to16
void(* rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:51
DEFINE_RGB48TO64
#define DEFINE_RGB48TO64(need_bswap, swap)
Definition: rgb2rgb.c:406
yuv422ptouyvy
void(* yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
Width should be a multiple of 16.
Definition: rgb2rgb.c:73
vu9_to_vu12
void(* vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride1, int srcStride2, int dstStride1, int dstStride2)
Definition: rgb2rgb.c:94
rgb24tobgr24
void(* rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:39
DEFINE_RGB64TO48
#define DEFINE_RGB64TO48(need_bswap, swap)
Definition: rgb2rgb.c:369
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
d
d
Definition: ffmpeg_filter.c:368
int32_t
int32_t
Definition: audioconvert.c:56
planar2x
void(* planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride)
Definition: rgb2rgb.c:86
rgb
static const SheerTable rgb[2]
Definition: sheervideodata.h:32
rgb2rgb_init_loongarch
av_cold void rgb2rgb_init_loongarch(void)
Definition: swscale_init_loongarch.c:82
rgb2rgb.h
swscale.h
rgb16tobgr15
void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:254