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 void (*shuffle_bytes_3102)(const uint8_t *src, uint8_t *dst, int src_size);
60 void (*shuffle_bytes_2013)(const uint8_t *src, uint8_t *dst, int src_size);
61 void (*shuffle_bytes_2130)(const uint8_t *src, uint8_t *dst, int src_size);
62 void (*shuffle_bytes_1203)(const uint8_t *src, uint8_t *dst, int src_size);
63 
64 
65 void (*yv12toyuy2)(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 (*yv12touyvy)(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 (*yuv422ptoyuy2)(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 (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc,
78  const uint8_t *vsrc, uint8_t *dst,
79  int width, int height,
80  int lumStride, int chromStride, int dstStride);
81 void (*yuy2toyv12)(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 void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst,
86  uint8_t *udst, uint8_t *vdst,
87  int width, int height,
88  int lumStride, int chromStride, int srcStride,
89  const int32_t *rgb2yuv);
90 void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
91  int srcStride, int dstStride);
92 void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
93  int width, int height, int src1Stride,
94  int src2Stride, int dstStride);
95 void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
96  int width, int height, int srcStride,
97  int dst1Stride, int dst2Stride);
98 void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
99  uint8_t *dst1, uint8_t *dst2,
100  int width, int height,
101  int srcStride1, int srcStride2,
102  int dstStride1, int dstStride2);
103 void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2,
104  const uint8_t *src3, uint8_t *dst,
105  int width, int height,
106  int srcStride1, int srcStride2,
107  int srcStride3, int dstStride);
108 void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
109  const uint8_t *src, int width, int height,
110  int lumStride, int chromStride, int srcStride);
111 void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
112  const uint8_t *src, int width, int height,
113  int lumStride, int chromStride, int srcStride);
114 void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
115  const uint8_t *src, int width, int height,
116  int lumStride, int chromStride, int srcStride);
117 void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
118  const uint8_t *src, int width, int height,
119  int lumStride, int chromStride, int srcStride);
120 
121 #define BY ((int)( 0.098 * (1 << RGB2YUV_SHIFT) + 0.5))
122 #define BV ((int)(-0.071 * (1 << RGB2YUV_SHIFT) + 0.5))
123 #define BU ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
124 #define GY ((int)( 0.504 * (1 << RGB2YUV_SHIFT) + 0.5))
125 #define GV ((int)(-0.368 * (1 << RGB2YUV_SHIFT) + 0.5))
126 #define GU ((int)(-0.291 * (1 << RGB2YUV_SHIFT) + 0.5))
127 #define RY ((int)( 0.257 * (1 << RGB2YUV_SHIFT) + 0.5))
128 #define RV ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
129 #define RU ((int)(-0.148 * (1 << RGB2YUV_SHIFT) + 0.5))
130 
131 //plain C versions
132 #include "rgb2rgb_template.c"
133 
134 /*
135  * RGB15->RGB16 original by Strepto/Astral
136  * ported to gcc & bugfixed : A'rpi
137  * MMXEXT, 3DNOW optimization by Nick Kurshev
138  * 32-bit C version, and and&add trick by Michael Niedermayer
139  */
140 
142 {
143  rgb2rgb_init_c();
144 #if ARCH_AARCH64
146 #elif ARCH_RISCV
148 #elif ARCH_X86
150 #elif ARCH_LOONGARCH64
152 #endif
153 }
154 
155 void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
156 {
157  int i, num_pixels = src_size >> 2;
158 
159  for (i = 0; i < num_pixels; i++) {
160 #if HAVE_BIGENDIAN
161  /* RGB32 (= A,B,G,R) -> BGR24 (= B,G,R) */
162  dst[3 * i + 0] = src[4 * i + 1];
163  dst[3 * i + 1] = src[4 * i + 2];
164  dst[3 * i + 2] = src[4 * i + 3];
165 #else
166  dst[3 * i + 0] = src[4 * i + 2];
167  dst[3 * i + 1] = src[4 * i + 1];
168  dst[3 * i + 2] = src[4 * i + 0];
169 #endif
170  }
171 }
172 
173 void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size)
174 {
175  int i;
176 
177  for (i = 0; 3 * i < src_size; i++) {
178 #if HAVE_BIGENDIAN
179  /* RGB24 (= R, G, B) -> BGR32 (= A, R, G, B) */
180  dst[4 * i + 0] = 255;
181  dst[4 * i + 1] = src[3 * i + 0];
182  dst[4 * i + 2] = src[3 * i + 1];
183  dst[4 * i + 3] = src[3 * i + 2];
184 #else
185  dst[4 * i + 0] = src[3 * i + 2];
186  dst[4 * i + 1] = src[3 * i + 1];
187  dst[4 * i + 2] = src[3 * i + 0];
188  dst[4 * i + 3] = 255;
189 #endif
190  }
191 }
192 
193 void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
194 {
195  uint8_t *d = dst;
196  const uint16_t *s = (const uint16_t *)src;
197  const uint16_t *end = s + src_size / 2;
198 
199  while (s < end) {
200  register uint16_t bgr = *s++;
201 #if HAVE_BIGENDIAN
202  *d++ = 255;
203  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
204  *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
205  *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
206 #else
207  *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
208  *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
209  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
210  *d++ = 255;
211 #endif
212  }
213 }
214 
215 void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
216 {
217  uint16_t rgb, r, g, b;
218  uint16_t *d = (uint16_t *)dst;
219  const uint16_t *s = (const uint16_t *)src;
220  const uint16_t *end = s + src_size / 2;
221 
222  while (s < end) {
223  rgb = *s++;
224  r = rgb & 0xF00;
225  g = rgb & 0x0F0;
226  b = rgb & 0x00F;
227  r = (r << 3) | ((r & 0x800) >> 1);
228  g = (g << 2) | ((g & 0x080) >> 2);
229  b = (b << 1) | ( b >> 3);
230  *d++ = r | g | b;
231  }
232 }
233 
234 void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size)
235 {
236  uint8_t *d = dst;
237  const uint16_t *s = (const uint16_t *)src;
238  const uint16_t *end = s + src_size / 2;
239 
240  while (s < end) {
241  register uint16_t bgr = *s++;
242  *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
243  *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
244  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
245  }
246 }
247 
248 void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
249 {
250  int i, num_pixels = src_size >> 1;
251 
252  for (i = 0; i < num_pixels; i++) {
253  unsigned rgb = ((const uint16_t *)src)[i];
254  ((uint16_t *)dst)[i] = (rgb >> 11) | (rgb & 0x7E0) | (rgb << 11);
255  }
256 }
257 
258 void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
259 {
260  int i, num_pixels = src_size >> 1;
261 
262  for (i = 0; i < num_pixels; i++) {
263  unsigned rgb = ((const uint16_t *)src)[i];
264  ((uint16_t *)dst)[i] = (rgb >> 11) | ((rgb & 0x7C0) >> 1) | ((rgb & 0x1F) << 10);
265  }
266 }
267 
268 void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
269 {
270  uint8_t *d = dst;
271  const uint16_t *s = (const uint16_t *)src;
272  const uint16_t *end = s + src_size / 2;
273 
274  while (s < end) {
275  register uint16_t bgr = *s++;
276 #if HAVE_BIGENDIAN
277  *d++ = 255;
278  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
279  *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
280  *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
281 #else
282  *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
283  *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
284  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
285  *d++ = 255;
286 #endif
287  }
288 }
289 
290 void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)
291 {
292  uint8_t *d = dst;
293  const uint16_t *s = (const uint16_t *)src;
294  const uint16_t *end = s + src_size / 2;
295 
296  while (s < end) {
297  register uint16_t bgr = *s++;
298  *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
299  *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
300  *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
301  }
302 }
303 
304 void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
305 {
306  int i, num_pixels = src_size >> 1;
307 
308  for (i = 0; i < num_pixels; i++) {
309  unsigned rgb = ((const uint16_t *)src)[i];
310  ((uint16_t *)dst)[i] = ((rgb & 0x7C00) >> 10) | ((rgb & 0x3E0) << 1) | (rgb << 11);
311  }
312 }
313 
314 void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
315 {
316  int i, num_pixels = src_size >> 1;
317 
318  for (i = 0; i < num_pixels; i++) {
319  unsigned rgb = ((const uint16_t *)src)[i];
320  unsigned br = rgb & 0x7C1F;
321  ((uint16_t *)dst)[i] = (br >> 10) | (rgb & 0x3E0) | (br << 10);
322  }
323 }
324 
325 void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
326 {
327  uint16_t *d = (uint16_t *)dst;
328  const uint16_t *s = (const uint16_t *)src;
329  int i, num_pixels = src_size >> 1;
330 
331  for (i = 0; i < num_pixels; i++) {
332  unsigned rgb = s[i];
333  d[i] = (rgb << 8 | rgb & 0xF0 | rgb >> 8) & 0xFFF;
334  }
335 }
336 
337 #define DEFINE_RGB48TOBGR48(need_bswap, swap) \
338 void rgb48tobgr48_ ## need_bswap(const uint8_t *src, \
339  uint8_t *dst, int src_size) \
340 { \
341  uint16_t *d = (uint16_t *)dst; \
342  const uint16_t *s = (const uint16_t *)src; \
343  int i, num_pixels = src_size >> 1; \
344  \
345  for (i = 0; i < num_pixels; i += 3) { \
346  d[i ] = swap ? av_bswap16(s[i + 2]) : s[i + 2]; \
347  d[i + 1] = swap ? av_bswap16(s[i + 1]) : s[i + 1]; \
348  d[i + 2] = swap ? av_bswap16(s[i ]) : s[i ]; \
349  } \
350 }
351 
352 DEFINE_RGB48TOBGR48(nobswap, 0)
353 DEFINE_RGB48TOBGR48(bswap, 1)
354 
355 #define DEFINE_RGB64TOBGR48(need_bswap, swap) \
356 void rgb64tobgr48_ ## need_bswap(const uint8_t *src, \
357  uint8_t *dst, int src_size) \
358 { \
359  uint16_t *d = (uint16_t *)dst; \
360  const uint16_t *s = (const uint16_t *)src; \
361  int i, num_pixels = src_size >> 3; \
362  \
363  for (i = 0; i < num_pixels; i++) { \
364  d[3 * i ] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
365  d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
366  d[3 * i + 2] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
367  } \
368 }
369 
370 DEFINE_RGB64TOBGR48(nobswap, 0)
371 DEFINE_RGB64TOBGR48(bswap, 1)
372 
373 #define DEFINE_RGB64TO48(need_bswap, swap) \
374 void rgb64to48_ ## need_bswap(const uint8_t *src, \
375  uint8_t *dst, int src_size) \
376 { \
377  uint16_t *d = (uint16_t *)dst; \
378  const uint16_t *s = (const uint16_t *)src; \
379  int i, num_pixels = src_size >> 3; \
380  \
381  for (i = 0; i < num_pixels; i++) { \
382  d[3 * i ] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
383  d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
384  d[3 * i + 2] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
385  } \
386 }
387 
388 DEFINE_RGB64TO48(nobswap, 0)
389 DEFINE_RGB64TO48(bswap, 1)
390 
391 #define DEFINE_RGB48TOBGR64(need_bswap, swap) \
392 void rgb48tobgr64_ ## need_bswap(const uint8_t *src, \
393  uint8_t *dst, int src_size) \
394 { \
395  uint16_t *d = (uint16_t *)dst; \
396  const uint16_t *s = (const uint16_t *)src; \
397  int i, num_pixels = src_size / 6; \
398  \
399  for (i = 0; i < num_pixels; i++) { \
400  d[4 * i ] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
401  d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
402  d[4 * i + 2] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
403  d[4 * i + 3] = 0xFFFF; \
404  } \
405 }
406 
407 DEFINE_RGB48TOBGR64(nobswap, 0)
408 DEFINE_RGB48TOBGR64(bswap, 1)
409 
410 #define DEFINE_RGB48TO64(need_bswap, swap) \
411 void rgb48to64_ ## need_bswap(const uint8_t *src, \
412  uint8_t *dst, int src_size) \
413 { \
414  uint16_t *d = (uint16_t *)dst; \
415  const uint16_t *s = (const uint16_t *)src; \
416  int i, num_pixels = src_size / 6; \
417  \
418  for (i = 0; i < num_pixels; i++) { \
419  d[4 * i ] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
420  d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
421  d[4 * i + 2] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
422  d[4 * i + 3] = 0xFFFF; \
423  } \
424 }
425 
426 DEFINE_RGB48TO64(nobswap, 0)
427 DEFINE_RGB48TO64(bswap, 1)
428 
429 #define DEFINE_X2RGB10TO16(need_bswap, swap, bits, alpha) \
430 void x2rgb10to ## bits ## _ ## need_bswap(const uint8_t *src, \
431  uint8_t *dst, int src_size) \
432 { \
433  uint16_t *d = (uint16_t *)dst; \
434  const uint32_t *s = (const uint32_t *)src; \
435  int i, num_pixels = src_size >> 2; \
436  unsigned component; \
437  \
438  for (i = 0; i < num_pixels; i++) { \
439  unsigned p = AV_RL32(s + i); \
440  component = (p >> 20) & 0x3FF; \
441  d[(3 + alpha) * i + 0] = swap ? av_bswap16(component << 6 | component >> 4) \
442  : component << 6 | component >> 4; \
443  component = (p >> 10) & 0x3FF; \
444  d[(3 + alpha) * i + 1] = swap ? av_bswap16(component << 6 | component >> 4) \
445  : component << 6 | component >> 4; \
446  component = p & 0x3FF; \
447  d[(3 + alpha) * i + 2] = swap ? av_bswap16(component << 6 | component >> 4) \
448  : component << 6 | component >> 4; \
449  if (alpha) d[(3 + alpha) * i + 3] = 0xffff; \
450  } \
451 }
452 
453 DEFINE_X2RGB10TO16(nobswap, 0, 48, 0)
454 DEFINE_X2RGB10TO16(bswap, 1, 48, 0)
455 DEFINE_X2RGB10TO16(nobswap, 0, 64, 1)
456 DEFINE_X2RGB10TO16(bswap, 1, 64, 1)
457 
458 #define DEFINE_X2RGB10TOBGR16(need_bswap, swap, bits, alpha) \
459 void x2rgb10tobgr ## bits ## _ ## need_bswap(const uint8_t *src, \
460  uint8_t *dst, int src_size) \
461 { \
462  uint16_t *d = (uint16_t *)dst; \
463  const uint32_t *s = (const uint32_t *)src; \
464  int i, num_pixels = src_size >> 2; \
465  unsigned component; \
466  \
467  for (i = 0; i < num_pixels; i++) { \
468  unsigned p = AV_RL32(s + i); \
469  component = p & 0x3FF; \
470  d[(3 + alpha) * i + 0] = swap ? av_bswap16(component << 6 | component >> 4) \
471  : component << 6 | component >> 4; \
472  component = (p >> 10) & 0x3FF; \
473  d[(3 + alpha) * i + 1] = swap ? av_bswap16(component << 6 | component >> 4) \
474  : component << 6 | component >> 4; \
475  component = (p >> 20) & 0x3FF; \
476  d[(3 + alpha) * i + 2] = swap ? av_bswap16(component << 6 | component >> 4) \
477  : component << 6 | component >> 4; \
478  if (alpha) d[(3 + alpha) * i + 3] = 0xffff; \
479  } \
480 }
481 
482 DEFINE_X2RGB10TOBGR16(nobswap, 0, 48, 0)
483 DEFINE_X2RGB10TOBGR16(bswap, 1, 48, 0)
484 DEFINE_X2RGB10TOBGR16(nobswap, 0, 64, 1)
485 DEFINE_X2RGB10TOBGR16(bswap, 1, 64, 1)
rgb12tobgr12
void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:325
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:127
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:65
rgb15to24
void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:290
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:81
rgb16tobgr32
void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:193
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:69
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:117
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:337
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:69
rgb32to16
void(* rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:45
rgb
Definition: rpzaenc.c:60
shuffle_bytes_2130
void(* shuffle_bytes_2130)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:61
rgb16tobgr16
void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:248
DEFINE_RGB64TOBGR48
#define DEFINE_RGB64TOBGR48(need_bswap, swap)
Definition: rgb2rgb.c:355
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
s
#define s(width, name)
Definition: cbs_vp9.c:198
g
const char * g
Definition: vf_curves.c:128
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:73
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:234
rgb12to15
void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:215
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
rgb2rgb_init_aarch64
av_cold void rgb2rgb_init_aarch64(void)
Definition: rgb2rgb.c:61
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:103
shuffle_bytes_3102
void(* shuffle_bytes_3102)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:59
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:141
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:114
rgb15tobgr16
void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:304
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:391
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
rgb2rgb_init_x86
av_cold void rgb2rgb_init_x86(void)
Definition: rgb2rgb.c:2410
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:155
rgb15tobgr15
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:314
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:111
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, const int32_t *rgb2yuv)
Height should be a multiple of 2 and width should be a multiple of 2.
Definition: rgb2rgb.c:85
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
rgb24to15
void(* rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:48
DEFINE_X2RGB10TOBGR16
#define DEFINE_X2RGB10TOBGR16(need_bswap, swap, bits, alpha)
Definition: rgb2rgb.c:458
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:46
DEFINE_X2RGB10TO16
#define DEFINE_X2RGB10TO16(need_bswap, swap, bits, alpha)
Definition: rgb2rgb.c:429
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:95
rgb2rgb_init_c
static av_cold void rgb2rgb_init_c(void)
Definition: rgb2rgb_template.c:950
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:108
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:173
rgb24tobgr15
void(* rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:41
shuffle_bytes_2013
void(* shuffle_bytes_2013)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:60
rgb15tobgr32
void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:268
rgb15to16
void(* rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:51
shuffle_bytes_1203
void(* shuffle_bytes_1203)(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:62
DEFINE_RGB48TO64
#define DEFINE_RGB48TO64(need_bswap, swap)
Definition: rgb2rgb.c:410
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:77
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:98
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:373
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:90
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:96
width
#define width
Definition: dsp.h:85
rgb2rgb.h
src
#define src
Definition: vp8dsp.c:248
swscale.h
rgb16tobgr15
void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
Definition: rgb2rgb.c:258