60 int lumStride,
int chromStride,
int dstStride);
64 int lumStride,
int chromStride,
int dstStride);
68 int lumStride,
int chromStride,
int dstStride);
72 int lumStride,
int chromStride,
int dstStride);
76 int lumStride,
int chromStride,
int srcStride);
80 int lumStride,
int chromStride,
int srcStride,
83 int srcStride,
int dstStride);
86 int src2Stride,
int dstStride);
89 int dst1Stride,
int dst2Stride);
93 int srcStride1,
int srcStride2,
94 int dstStride1,
int dstStride2);
98 int srcStride1,
int srcStride2,
99 int srcStride3,
int dstStride);
102 int lumStride,
int chromStride,
int srcStride);
105 int lumStride,
int chromStride,
int srcStride);
108 int lumStride,
int chromStride,
int srcStride);
111 int lumStride,
int chromStride,
int srcStride);
113 #define BY ((int)( 0.098 * (1 << RGB2YUV_SHIFT) + 0.5))
114 #define BV ((int)(-0.071 * (1 << RGB2YUV_SHIFT) + 0.5))
115 #define BU ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
116 #define GY ((int)( 0.504 * (1 << RGB2YUV_SHIFT) + 0.5))
117 #define GV ((int)(-0.368 * (1 << RGB2YUV_SHIFT) + 0.5))
118 #define GU ((int)(-0.291 * (1 << RGB2YUV_SHIFT) + 0.5))
119 #define RY ((int)( 0.257 * (1 << RGB2YUV_SHIFT) + 0.5))
120 #define RV ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
121 #define RU ((int)(-0.148 * (1 << RGB2YUV_SHIFT) + 0.5))
142 int i, num_pixels = src_size >> 2;
144 for (i = 0; i < num_pixels; i++) {
147 dst[3 * i + 0] = src[4 * i + 1];
148 dst[3 * i + 1] = src[4 * i + 2];
149 dst[3 * i + 2] = src[4 * i + 3];
151 dst[3 * i + 0] = src[4 * i + 2];
152 dst[3 * i + 1] = src[4 * i + 1];
153 dst[3 * i + 2] = src[4 * i + 0];
162 for (i = 0; 3 * i < src_size; i++) {
165 dst[4 * i + 0] = 255;
166 dst[4 * i + 1] = src[3 * i + 0];
167 dst[4 * i + 2] = src[3 * i + 1];
168 dst[4 * i + 3] = src[3 * i + 2];
170 dst[4 * i + 0] = src[3 * i + 2];
171 dst[4 * i + 1] = src[3 * i + 1];
172 dst[4 * i + 2] = src[3 * i + 0];
173 dst[4 * i + 3] = 255;
181 const uint16_t *
s = (
const uint16_t *)src;
182 const uint16_t *
end = s + src_size / 2;
185 register uint16_t bgr = *s++;
188 *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
189 *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
190 *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
192 *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
193 *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
194 *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
202 uint16_t rgb,
r,
g,
b;
203 uint16_t *d = (uint16_t *)dst;
204 const uint16_t *
s = (
const uint16_t *)src;
205 const uint16_t *
end = s + src_size / 2;
212 r = (r << 3) | ((r & 0x800) >> 1);
213 g = (g << 2) | ((g & 0x080) >> 2);
214 b = (b << 1) | ( b >> 3);
222 const uint16_t *
s = (
const uint16_t *)src;
223 const uint16_t *
end = s + src_size / 2;
226 register uint16_t bgr = *s++;
227 *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
228 *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
229 *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
235 int i, num_pixels = src_size >> 1;
237 for (i = 0; i < num_pixels; i++) {
238 unsigned rgb = ((
const uint16_t *)src)[i];
239 ((uint16_t *)dst)[i] = (rgb >> 11) | (rgb & 0x7E0) | (rgb << 11);
245 int i, num_pixels = src_size >> 1;
247 for (i = 0; i < num_pixels; i++) {
248 unsigned rgb = ((
const uint16_t *)src)[i];
249 ((uint16_t *)dst)[i] = (rgb >> 11) | ((rgb & 0x7C0) >> 1) | ((rgb & 0x1F) << 10);
256 const uint16_t *
s = (
const uint16_t *)src;
257 const uint16_t *
end = s + src_size / 2;
260 register uint16_t bgr = *s++;
263 *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
264 *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
265 *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
267 *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
268 *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
269 *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
278 const uint16_t *
s = (
const uint16_t *)src;
279 const uint16_t *
end = s + src_size / 2;
282 register uint16_t bgr = *s++;
283 *d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
284 *d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
285 *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
291 int i, num_pixels = src_size >> 1;
293 for (i = 0; i < num_pixels; i++) {
294 unsigned rgb = ((
const uint16_t *)src)[i];
295 ((uint16_t *)dst)[i] = ((rgb & 0x7C00) >> 10) | ((rgb & 0x3E0) << 1) | (rgb << 11);
301 int i, num_pixels = src_size >> 1;
303 for (i = 0; i < num_pixels; i++) {
304 unsigned rgb = ((
const uint16_t *)src)[i];
305 unsigned br = rgb & 0x7C1F;
306 ((uint16_t *)dst)[i] = (br >> 10) | (rgb & 0x3E0) | (br << 10);
312 uint16_t *d = (uint16_t *)dst;
313 uint16_t *
s = (uint16_t *)src;
314 int i, num_pixels = src_size >> 1;
316 for (i = 0; i < num_pixels; i++) {
318 d[i] = (rgb << 8 | rgb & 0xF0 | rgb >> 8) & 0xFFF;
323 #define DEFINE_SHUFFLE_BYTES(a, b, c, d) \
324 void shuffle_bytes_ ## a ## b ## c ## d(const uint8_t *src, \
325 uint8_t *dst, int src_size) \
329 for (i = 0; i < src_size; i += 4) { \
330 dst[i + 0] = src[i + a]; \
331 dst[i + 1] = src[i + b]; \
332 dst[i + 2] = src[i + c]; \
333 dst[i + 3] = src[i + d]; \
341 #define DEFINE_RGB48TOBGR48(need_bswap, swap) \
342 void rgb48tobgr48_ ## need_bswap(const uint8_t *src, \
343 uint8_t *dst, int src_size) \
345 uint16_t *d = (uint16_t *)dst; \
346 uint16_t *s = (uint16_t *)src; \
347 int i, num_pixels = src_size >> 1; \
349 for (i = 0; i < num_pixels; i += 3) { \
350 d[i ] = swap ? av_bswap16(s[i + 2]) : s[i + 2]; \
351 d[i + 1] = swap ? av_bswap16(s[i + 1]) : s[i + 1]; \
352 d[i + 2] = swap ? av_bswap16(s[i ]) : s[i ]; \
359 #define DEFINE_RGB64TOBGR48(need_bswap, swap) \
360 void rgb64tobgr48_ ## need_bswap(const uint8_t *src, \
361 uint8_t *dst, int src_size) \
363 uint16_t *d = (uint16_t *)dst; \
364 uint16_t *s = (uint16_t *)src; \
365 int i, num_pixels = src_size >> 3; \
367 for (i = 0; i < num_pixels; i++) { \
368 d[3 * i ] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
369 d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
370 d[3 * i + 2] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
377 #define DEFINE_RGB64TO48(need_bswap, swap) \
378 void rgb64to48_ ## need_bswap(const uint8_t *src, \
379 uint8_t *dst, int src_size) \
381 uint16_t *d = (uint16_t *)dst; \
382 uint16_t *s = (uint16_t *)src; \
383 int i, num_pixels = src_size >> 3; \
385 for (i = 0; i < num_pixels; i++) { \
386 d[3 * i ] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
387 d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
388 d[3 * i + 2] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
395 #define DEFINE_RGB48TOBGR64(need_bswap, swap) \
396 void rgb48tobgr64_ ## need_bswap(const uint8_t *src, \
397 uint8_t *dst, int src_size) \
399 uint16_t *d = (uint16_t *)dst; \
400 uint16_t *s = (uint16_t *)src; \
401 int i, num_pixels = src_size / 6; \
403 for (i = 0; i < num_pixels; i++) { \
404 d[4 * i ] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
405 d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
406 d[4 * i + 2] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
407 d[4 * i + 3] = 0xFFFF; \
414 #define DEFINE_RGB48TO64(need_bswap, swap) \
415 void rgb48to64_ ## need_bswap(const uint8_t *src, \
416 uint8_t *dst, int src_size) \
418 uint16_t *d = (uint16_t *)dst; \
419 uint16_t *s = (uint16_t *)src; \
420 int i, num_pixels = src_size / 6; \
422 for (i = 0; i < num_pixels; i++) { \
423 d[4 * i ] = swap ? av_bswap16(s[3 * i ]) : s[3 * i ]; \
424 d[4 * i + 1] = swap ? av_bswap16(s[3 * i + 1]) : s[3 * i + 1]; \
425 d[4 * i + 2] = swap ? av_bswap16(s[3 * i + 2]) : s[3 * i + 2]; \
426 d[4 * i + 3] = 0xFFFF; \
#define DEFINE_RGB48TOBGR48(need_bswap, swap)
static void fn() rgb2yuv(uint8_t *_yuv[3], const ptrdiff_t yuv_stride[3], int16_t *rgb[3], ptrdiff_t s, int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], const int16_t yuv_offset[8])
void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
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.
void(* planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride)
void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
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)
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.
av_cold void rgb2rgb_init_x86(void)
void(* rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size)
Macro definitions for various function/variable attributes.
void(* rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size)
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)
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)
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.
static av_cold int end(AVCodecContext *avctx)
void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
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.
#define DEFINE_SHUFFLE_BYTES(a, b, c, d)
void(* interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, int width, int height, int src1Stride, int src2Stride, int dstStride)
static av_cold void rgb2rgb_init_c(void)
void(* rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB64TOBGR48(need_bswap, swap)
void(* rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB48TOBGR64(need_bswap, swap)
void(* rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
av_cold void ff_sws_rgb2rgb_init(void)
void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
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.
void(* rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
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)
void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size)
void(* shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size)
#define DEFINE_RGB48TO64(need_bswap, swap)
void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size)
void(* shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
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.
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)
void(* rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
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)
void(* rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
void(* deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride, int dst1Stride, int dst2Stride)
#define DEFINE_RGB64TO48(need_bswap, swap)
void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
void(* rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)