FFmpeg
input.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2001-2012 Michael Niedermayer <michaelni@gmx.at>
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 <math.h>
22 #include <stdint.h>
23 #include <stdio.h>
24 
25 #include "libavutil/bswap.h"
26 #include "libavutil/intreadwrite.h"
27 #include "libavutil/avassert.h"
28 #include "config.h"
29 #include "swscale_internal.h"
30 
31 #define input_pixel(pos) (is_be ? AV_RB16(pos) : AV_RL16(pos))
32 
33 #define IS_BE_LE 0
34 #define IS_BE_BE 1
35 #define IS_BE_ 0
36 /* ENDIAN_IDENTIFIER needs to be "BE", "LE" or "". The latter is intended
37  * for single-byte cases where the concept of endianness does not apply. */
38 #define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER
39 
40 #define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? b_r : r_b)
41 #define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? r_b : b_r)
42 
43 static av_always_inline void
44 rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width,
45  enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
46 {
47  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
48  int i;
49  for (i = 0; i < width; i++) {
50  unsigned int r_b = input_pixel(&src[i*4+0]);
51  unsigned int g = input_pixel(&src[i*4+1]);
52  unsigned int b_r = input_pixel(&src[i*4+2]);
53 
54  dst[i] = (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
55  }
56 }
57 
58 static av_always_inline void
59 rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV,
60  const uint16_t *src1, const uint16_t *src2,
61  int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
62 {
63  int i;
64  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
65  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
67  for (i = 0; i < width; i++) {
68  unsigned int r_b = input_pixel(&src1[i*4+0]);
69  unsigned int g = input_pixel(&src1[i*4+1]);
70  unsigned int b_r = input_pixel(&src1[i*4+2]);
71 
72  dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
73  dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
74  }
75 }
76 
77 static av_always_inline void
78 rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV,
79  const uint16_t *src1, const uint16_t *src2,
80  int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
81 {
82  int i;
83  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
84  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
86  for (i = 0; i < width; i++) {
87  unsigned r_b = (input_pixel(&src1[8 * i + 0]) + input_pixel(&src1[8 * i + 4]) + 1) >> 1;
88  unsigned g = (input_pixel(&src1[8 * i + 1]) + input_pixel(&src1[8 * i + 5]) + 1) >> 1;
89  unsigned b_r = (input_pixel(&src1[8 * i + 2]) + input_pixel(&src1[8 * i + 6]) + 1) >> 1;
90 
91  dstU[i]= (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
92  dstV[i]= (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
93  }
94 }
95 
96 #define RGB64FUNCS_EXT(pattern, BE_LE, origin, is_be) \
97 static void pattern ## 64 ## BE_LE ## ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, const uint8_t *unused1,\
98  int width, uint32_t *rgb2yuv, void *opq) \
99 { \
100  const uint16_t *src = (const uint16_t *) _src; \
101  uint16_t *dst = (uint16_t *) _dst; \
102  rgb64ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
103 } \
104  \
105 static void pattern ## 64 ## BE_LE ## ToUV_c(uint8_t *_dstU, uint8_t *_dstV, \
106  const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
107  int width, uint32_t *rgb2yuv, void *opq) \
108 { \
109  const uint16_t *src1 = (const uint16_t *) _src1, \
110  *src2 = (const uint16_t *) _src2; \
111  uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
112  rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
113 } \
114  \
115 static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, \
116  const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
117  int width, uint32_t *rgb2yuv, void *opq) \
118 { \
119  const uint16_t *src1 = (const uint16_t *) _src1, \
120  *src2 = (const uint16_t *) _src2; \
121  uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
122  rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
123 }
124 #define RGB64FUNCS(pattern, endianness, base_fmt) \
125  RGB64FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
126 
131 
132 static av_always_inline void rgb48ToY_c_template(uint16_t *dst,
133  const uint16_t *src, int width,
134  enum AVPixelFormat origin,
135  int32_t *rgb2yuv, int is_be)
136 {
137  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
138  int i;
139  for (i = 0; i < width; i++) {
140  unsigned int r_b = input_pixel(&src[i * 3 + 0]);
141  unsigned int g = input_pixel(&src[i * 3 + 1]);
142  unsigned int b_r = input_pixel(&src[i * 3 + 2]);
143 
144  dst[i] = (ry*r + gy*g + by*b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
145  }
146 }
147 
148 static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
149  uint16_t *dstV,
150  const uint16_t *src1,
151  const uint16_t *src2,
152  int width,
153  enum AVPixelFormat origin,
154  int32_t *rgb2yuv, int is_be)
155 {
156  int i;
157  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
158  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
159  av_assert1(src1 == src2);
160  for (i = 0; i < width; i++) {
161  unsigned r_b = input_pixel(&src1[i * 3 + 0]);
162  unsigned g = input_pixel(&src1[i * 3 + 1]);
163  unsigned b_r = input_pixel(&src1[i * 3 + 2]);
164 
165  dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
166  dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
167  }
168 }
169 
170 static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
171  uint16_t *dstV,
172  const uint16_t *src1,
173  const uint16_t *src2,
174  int width,
175  enum AVPixelFormat origin,
176  int32_t *rgb2yuv, int is_be)
177 {
178  int i;
179  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
180  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
181  av_assert1(src1 == src2);
182  for (i = 0; i < width; i++) {
183  unsigned r_b = (input_pixel(&src1[6 * i + 0]) +
184  input_pixel(&src1[6 * i + 3]) + 1) >> 1;
185  unsigned g = (input_pixel(&src1[6 * i + 1]) +
186  input_pixel(&src1[6 * i + 4]) + 1) >> 1;
187  unsigned b_r = (input_pixel(&src1[6 * i + 2]) +
188  input_pixel(&src1[6 * i + 5]) + 1) >> 1;
189 
190  dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
191  dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
192  }
193 }
194 
195 #undef r
196 #undef b
197 #undef input_pixel
198 
199 #define RGB48FUNCS_EXT(pattern, BE_LE, origin, is_be) \
200 static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst, \
201  const uint8_t *_src, \
202  const uint8_t *unused0, const uint8_t *unused1,\
203  int width, \
204  uint32_t *rgb2yuv, \
205  void *opq) \
206 { \
207  const uint16_t *src = (const uint16_t *)_src; \
208  uint16_t *dst = (uint16_t *)_dst; \
209  rgb48ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
210 } \
211  \
212 static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU, \
213  uint8_t *_dstV, \
214  const uint8_t *unused0, \
215  const uint8_t *_src1, \
216  const uint8_t *_src2, \
217  int width, \
218  uint32_t *rgb2yuv, \
219  void *opq) \
220 { \
221  const uint16_t *src1 = (const uint16_t *)_src1, \
222  *src2 = (const uint16_t *)_src2; \
223  uint16_t *dstU = (uint16_t *)_dstU, \
224  *dstV = (uint16_t *)_dstV; \
225  rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
226 } \
227  \
228 static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \
229  uint8_t *_dstV, \
230  const uint8_t *unused0, \
231  const uint8_t *_src1, \
232  const uint8_t *_src2, \
233  int width, \
234  uint32_t *rgb2yuv, \
235  void *opq) \
236 { \
237  const uint16_t *src1 = (const uint16_t *)_src1, \
238  *src2 = (const uint16_t *)_src2; \
239  uint16_t *dstU = (uint16_t *)_dstU, \
240  *dstV = (uint16_t *)_dstV; \
241  rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
242 }
243 #define RGB48FUNCS(pattern, endianness, base_fmt) \
244  RGB48FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
245 
250 
251 #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \
252  origin == AV_PIX_FMT_BGRA || \
253  origin == AV_PIX_FMT_ARGB || \
254  origin == AV_PIX_FMT_ABGR) \
255  ? AV_RN32A(&src[(i) * 4]) \
256  : ((origin == AV_PIX_FMT_X2RGB10LE || \
257  origin == AV_PIX_FMT_X2BGR10LE) \
258  ? AV_RL32(&src[(i) * 4]) \
259  : (is_be ? AV_RB16(&src[(i) * 2]) \
260  : AV_RL16(&src[(i) * 2]))))
261 
262 static av_always_inline void rgb16_32ToY_c_template(int16_t *dst,
263  const uint8_t *src,
264  int width,
265  enum AVPixelFormat origin,
266  int shr, int shg,
267  int shb, int shp,
268  int maskr, int maskg,
269  int maskb, int rsh,
270  int gsh, int bsh, int S,
271  int32_t *rgb2yuv, int is_be)
272 {
273  const int ry = rgb2yuv[RY_IDX]<<rsh, gy = rgb2yuv[GY_IDX]<<gsh, by = rgb2yuv[BY_IDX]<<bsh;
274  const unsigned rnd = (32<<((S)-1)) + (1<<(S-7));
275  int i;
276 
277  for (i = 0; i < width; i++) {
278  int px = input_pixel(i) >> shp;
279  int b = (px & maskb) >> shb;
280  int g = (px & maskg) >> shg;
281  int r = (px & maskr) >> shr;
282 
283  dst[i] = (ry * r + gy * g + by * b + rnd) >> ((S)-6);
284  }
285 }
286 
287 static av_always_inline void rgb16_32ToUV_c_template(int16_t *dstU,
288  int16_t *dstV,
289  const uint8_t *src,
290  int width,
291  enum AVPixelFormat origin,
292  int shr, int shg,
293  int shb, int shp,
294  int maskr, int maskg,
295  int maskb, int rsh,
296  int gsh, int bsh, int S,
297  int32_t *rgb2yuv, int is_be)
298 {
299  const int ru = rgb2yuv[RU_IDX] * (1 << rsh), gu = rgb2yuv[GU_IDX] * (1 << gsh), bu = rgb2yuv[BU_IDX] * (1 << bsh),
300  rv = rgb2yuv[RV_IDX] * (1 << rsh), gv = rgb2yuv[GV_IDX] * (1 << gsh), bv = rgb2yuv[BV_IDX] * (1 << bsh);
301  const unsigned rnd = (256u<<((S)-1)) + (1<<(S-7));
302  int i;
303 
304  for (i = 0; i < width; i++) {
305  int px = input_pixel(i) >> shp;
306  int b = (px & maskb) >> shb;
307  int g = (px & maskg) >> shg;
308  int r = (px & maskr) >> shr;
309 
310  dstU[i] = (ru * r + gu * g + bu * b + rnd) >> ((S)-6);
311  dstV[i] = (rv * r + gv * g + bv * b + rnd) >> ((S)-6);
312  }
313 }
314 
316  int16_t *dstV,
317  const uint8_t *src,
318  int width,
319  enum AVPixelFormat origin,
320  int shr, int shg,
321  int shb, int shp,
322  int maskr, int maskg,
323  int maskb, int rsh,
324  int gsh, int bsh, int S,
325  int32_t *rgb2yuv, int is_be)
326 {
327  const int ru = rgb2yuv[RU_IDX] * (1 << rsh), gu = rgb2yuv[GU_IDX] * (1 << gsh), bu = rgb2yuv[BU_IDX] * (1 << bsh),
328  rv = rgb2yuv[RV_IDX] * (1 << rsh), gv = rgb2yuv[GV_IDX] * (1 << gsh), bv = rgb2yuv[BV_IDX] * (1 << bsh),
329  maskgx = ~(maskr | maskb);
330  const unsigned rnd = (256U<<(S)) + (1<<(S-6));
331  int i;
332 
333  maskr |= maskr << 1;
334  maskb |= maskb << 1;
335  maskg |= maskg << 1;
336  for (i = 0; i < width; i++) {
337  unsigned px0 = input_pixel(2 * i + 0) >> shp;
338  unsigned px1 = input_pixel(2 * i + 1) >> shp;
339  int b, r, g = (px0 & maskgx) + (px1 & maskgx);
340  int rb = px0 + px1 - g;
341 
342  b = (rb & maskb) >> shb;
343  if (shp ||
344  origin == AV_PIX_FMT_BGR565LE || origin == AV_PIX_FMT_BGR565BE ||
345  origin == AV_PIX_FMT_RGB565LE || origin == AV_PIX_FMT_RGB565BE) {
346  g >>= shg;
347  } else {
348  g = (g & maskg) >> shg;
349  }
350  r = (rb & maskr) >> shr;
351 
352  dstU[i] = (ru * r + gu * g + bu * b + (unsigned)rnd) >> ((S)-6+1);
353  dstV[i] = (rv * r + gv * g + bv * b + (unsigned)rnd) >> ((S)-6+1);
354  }
355 }
356 
357 #undef input_pixel
358 
359 #define RGB16_32FUNCS_EXT(fmt, name, shr, shg, shb, shp, maskr, \
360  maskg, maskb, rsh, gsh, bsh, S, is_be) \
361 static void name ## ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, \
362  int width, uint32_t *tab, void *opq) \
363 { \
364  rgb16_32ToY_c_template((int16_t*)dst, src, width, fmt, shr, shg, shb, shp, \
365  maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
366 } \
367  \
368 static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
369  const uint8_t *unused0, const uint8_t *src, const uint8_t *dummy, \
370  int width, uint32_t *tab, void *opq) \
371 { \
372  rgb16_32ToUV_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
373  shr, shg, shb, shp, \
374  maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
375 } \
376  \
377 static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
378  const uint8_t *unused0, const uint8_t *src, \
379  const uint8_t *dummy, \
380  int width, uint32_t *tab, void *opq) \
381 { \
382  rgb16_32ToUV_half_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
383  shr, shg, shb, shp, \
384  maskr, maskg, maskb, \
385  rsh, gsh, bsh, S, tab, is_be); \
386 }
387 
388 #define RGB16_32FUNCS(base_fmt, endianness, name, shr, shg, shb, shp, maskr, \
389  maskg, maskb, rsh, gsh, bsh, S) \
390  RGB16_32FUNCS_EXT(base_fmt ## endianness, name, shr, shg, shb, shp, maskr, \
391  maskg, maskb, rsh, gsh, bsh, S, IS_BE(endianness))
392 
393 RGB16_32FUNCS(AV_PIX_FMT_BGR32, , bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
394 RGB16_32FUNCS(AV_PIX_FMT_BGR32_1, , bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
395 RGB16_32FUNCS(AV_PIX_FMT_RGB32, , rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
396 RGB16_32FUNCS(AV_PIX_FMT_RGB32_1, , rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
397 RGB16_32FUNCS(AV_PIX_FMT_BGR565, LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
398 RGB16_32FUNCS(AV_PIX_FMT_BGR555, LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
399 RGB16_32FUNCS(AV_PIX_FMT_BGR444, LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
400 RGB16_32FUNCS(AV_PIX_FMT_RGB565, LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
401 RGB16_32FUNCS(AV_PIX_FMT_RGB555, LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
402 RGB16_32FUNCS(AV_PIX_FMT_RGB444, LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
403 RGB16_32FUNCS(AV_PIX_FMT_BGR565, BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
404 RGB16_32FUNCS(AV_PIX_FMT_BGR555, BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
405 RGB16_32FUNCS(AV_PIX_FMT_BGR444, BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
406 RGB16_32FUNCS(AV_PIX_FMT_RGB565, BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
407 RGB16_32FUNCS(AV_PIX_FMT_RGB555, BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
408 RGB16_32FUNCS(AV_PIX_FMT_RGB444, BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
409 RGB16_32FUNCS(AV_PIX_FMT_X2RGB10, LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4, RGB2YUV_SHIFT + 6)
410 RGB16_32FUNCS(AV_PIX_FMT_X2BGR10, LE, bgr30le, 0, 6, 16, 0, 0x3FF, 0xFFC00, 0x3FF00000, 4, 0, 0, RGB2YUV_SHIFT + 6)
411 
412 static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV,
413  const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
414  int width, uint32_t *rgb2yuv, void *opq)
415 {
416  uint16_t *dstU = (uint16_t *)_dstU;
417  uint16_t *dstV = (uint16_t *)_dstV;
418  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
419  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
420 
421  int i;
422  for (i = 0; i < width; i++) {
423  unsigned int g = gsrc[2*i] + gsrc[2*i+1];
424  unsigned int b = bsrc[2*i] + bsrc[2*i+1];
425  unsigned int r = rsrc[2*i] + rsrc[2*i+1];
426 
427  dstU[i] = (ru*r + gu*g + bu*b + (0x4001<<(RGB2YUV_SHIFT-6))) >> (RGB2YUV_SHIFT-6+1);
428  dstV[i] = (rv*r + gv*g + bv*b + (0x4001<<(RGB2YUV_SHIFT-6))) >> (RGB2YUV_SHIFT-6+1);
429  }
430 }
431 
432 static void rgba64leToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
433  const uint8_t *unused2, int width, uint32_t *unused, void *opq)
434 {
435  int16_t *dst = (int16_t *)_dst;
436  const uint16_t *src = (const uint16_t *)_src;
437  int i;
438  for (i = 0; i < width; i++)
439  dst[i] = AV_RL16(src + 4 * i + 3);
440 }
441 
442 static void rgba64beToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
443  const uint8_t *unused2, int width, uint32_t *unused, void *opq)
444 {
445  int16_t *dst = (int16_t *)_dst;
446  const uint16_t *src = (const uint16_t *)_src;
447  int i;
448  for (i = 0; i < width; i++)
449  dst[i] = AV_RB16(src + 4 * i + 3);
450 }
451 
452 static void abgrToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
453  const uint8_t *unused2, int width, uint32_t *unused, void *opq)
454 {
455  int16_t *dst = (int16_t *)_dst;
456  int i;
457  for (i=0; i<width; i++) {
458  dst[i]= src[4*i]<<6 | src[4*i]>>2;
459  }
460 }
461 
462 static void rgbaToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
463  const uint8_t *unused2, int width, uint32_t *unused, void *opq)
464 {
465  int16_t *dst = (int16_t *)_dst;
466  int i;
467  for (i=0; i<width; i++) {
468  dst[i]= src[4*i+3]<<6 | src[4*i+3]>>2;
469  }
470 }
471 
472 static void palToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
473  const uint8_t *unused2, int width, uint32_t *pal, void *opq)
474 {
475  int16_t *dst = (int16_t *)_dst;
476  int i;
477  for (i=0; i<width; i++) {
478  int d= src[i];
479 
480  dst[i]= (pal[d] >> 24)<<6 | pal[d]>>26;
481  }
482 }
483 
484 static void palToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
485  const uint8_t *unused2, int width, uint32_t *pal, void *opq)
486 {
487  int16_t *dst = (int16_t *)_dst;
488  int i;
489  for (i = 0; i < width; i++) {
490  int d = src[i];
491 
492  dst[i] = (pal[d] & 0xFF)<<6;
493  }
494 }
495 
496 static void palToUV_c(uint8_t *_dstU, uint8_t *_dstV,
497  const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2,
498  int width, uint32_t *pal, void *opq)
499 {
500  uint16_t *dstU = (uint16_t *)_dstU;
501  int16_t *dstV = (int16_t *)_dstV;
502  int i;
503  av_assert1(src1 == src2);
504  for (i = 0; i < width; i++) {
505  int p = pal[src1[i]];
506 
507  dstU[i] = (uint8_t)(p>> 8)<<6;
508  dstV[i] = (uint8_t)(p>>16)<<6;
509  }
510 }
511 
512 static void monowhite2Y_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
513  const uint8_t *unused2, int width, uint32_t *unused, void *opq)
514 {
515  int16_t *dst = (int16_t *)_dst;
516  int i, j;
517  width = (width + 7) >> 3;
518  for (i = 0; i < width; i++) {
519  int d = ~src[i];
520  for (j = 0; j < 8; j++)
521  dst[8*i+j]= ((d>>(7-j))&1) * 16383;
522  }
523  if(width&7){
524  int d= ~src[i];
525  for (j = 0; j < (width&7); j++)
526  dst[8*i+j]= ((d>>(7-j))&1) * 16383;
527  }
528 }
529 
530 static void monoblack2Y_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
531  const uint8_t *unused2, int width, uint32_t *unused, void *opq)
532 {
533  int16_t *dst = (int16_t *)_dst;
534  int i, j;
535  width = (width + 7) >> 3;
536  for (i = 0; i < width; i++) {
537  int d = src[i];
538  for (j = 0; j < 8; j++)
539  dst[8*i+j]= ((d>>(7-j))&1) * 16383;
540  }
541  if(width&7){
542  int d = src[i];
543  for (j = 0; j < (width&7); j++)
544  dst[8*i+j] = ((d>>(7-j))&1) * 16383;
545  }
546 }
547 
548 static void yuy2ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
549  uint32_t *unused, void *opq)
550 {
551  int i;
552  for (i = 0; i < width; i++)
553  dst[i] = src[2 * i];
554 }
555 
556 static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
557  const uint8_t *src2, int width, uint32_t *unused, void *opq)
558 {
559  int i;
560  for (i = 0; i < width; i++) {
561  dstU[i] = src1[4 * i + 1];
562  dstV[i] = src1[4 * i + 3];
563  }
564  av_assert1(src1 == src2);
565 }
566 
567 static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
568  const uint8_t *src2, int width, uint32_t *unused, void *opq)
569 {
570  int i;
571  for (i = 0; i < width; i++) {
572  dstV[i] = src1[4 * i + 1];
573  dstU[i] = src1[4 * i + 3];
574  }
575  av_assert1(src1 == src2);
576 }
577 
578 #define y21xle_wrapper(bits, shift) \
579  static void y2 ## bits ## le_UV_c(uint8_t *dstU, uint8_t *dstV, \
580  const uint8_t *unused0, \
581  const uint8_t *src, \
582  const uint8_t *unused1, int width, \
583  uint32_t *unused2, void *opq) \
584  { \
585  int i; \
586  for (i = 0; i < width; i++) { \
587  AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> shift); \
588  AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> shift); \
589  } \
590  } \
591  \
592  static void y2 ## bits ## le_Y_c(uint8_t *dst, const uint8_t *src, \
593  const uint8_t *unused0, \
594  const uint8_t *unused1, int width, \
595  uint32_t *unused2, void *opq) \
596  { \
597  int i; \
598  for (i = 0; i < width; i++) \
599  AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> shift); \
600  }
601 
603 y21xle_wrapper(12, 4)
604 
605 static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
606  uint32_t *unused, void *opq)
607 {
608  int i;
609  const uint16_t *src = (const uint16_t *)_src;
610  uint16_t *dst = (uint16_t *)_dst;
611  for (i = 0; i < width; i++)
612  dst[i] = av_bswap16(src[i]);
613 }
614 
615 static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *_src1,
616  const uint8_t *_src2, int width, uint32_t *unused, void *opq)
617 {
618  int i;
619  const uint16_t *src1 = (const uint16_t *)_src1,
620  *src2 = (const uint16_t *)_src2;
621  uint16_t *dstU = (uint16_t *)_dstU, *dstV = (uint16_t *)_dstV;
622  for (i = 0; i < width; i++) {
623  dstU[i] = av_bswap16(src1[i]);
624  dstV[i] = av_bswap16(src2[i]);
625  }
626 }
627 
628 static void read_ya16le_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
629  uint32_t *unused, void *opq)
630 {
631  int i;
632  for (i = 0; i < width; i++)
633  AV_WN16(dst + i * 2, AV_RL16(src + i * 4));
634 }
635 
636 static void read_ya16le_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
637  uint32_t *unused, void *opq)
638 {
639  int i;
640  for (i = 0; i < width; i++)
641  AV_WN16(dst + i * 2, AV_RL16(src + i * 4 + 2));
642 }
643 
644 static void read_ya16be_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
645  uint32_t *unused, void *opq)
646 {
647  int i;
648  for (i = 0; i < width; i++)
649  AV_WN16(dst + i * 2, AV_RB16(src + i * 4));
650 }
651 
652 static void read_ya16be_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
653  uint32_t *unused, void *opq)
654 {
655  int i;
656  for (i = 0; i < width; i++)
657  AV_WN16(dst + i * 2, AV_RB16(src + i * 4 + 2));
658 }
659 
660 static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
661  uint32_t *unused2, void *opq)
662 {
663  int i;
664  for (i = 0; i < width; i++)
665  AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2));
666 }
667 
668 
669 static void read_ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
670  const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
671 {
672  int i;
673  for (i = 0; i < width; i++) {
674  AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 4));
675  AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6));
676  }
677 }
678 
679 static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
680  uint32_t *unused2, void *opq)
681 {
682  int i;
683  for (i = 0; i < width; i++)
684  AV_WN16(dst + i * 2, AV_RL16(src + i * 8));
685 }
686 
687 static void read_vuyx_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
688  const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
689 {
690  int i;
691  for (i = 0; i < width; i++) {
692  dstU[i] = src[i * 4 + 1];
693  dstV[i] = src[i * 4];
694  }
695 }
696 
697 static void read_vuyx_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
698  uint32_t *unused2, void *opq)
699 {
700  int i;
701  for (i = 0; i < width; i++)
702  dst[i] = src[i * 4 + 2];
703 }
704 
705 static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
706  uint32_t *unused2, void *opq)
707 {
708  int i;
709  for (i = 0; i < width; i++)
710  dst[i] = src[i * 4 + 3];
711 }
712 
713 static void read_xv30le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
714  uint32_t *unused2, void *opq)
715 {
716  int i;
717  for (i = 0; i < width; i++)
718  AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 10) & 0x3FFu);
719 }
720 
721 
722 static void read_xv30le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
723  const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
724 {
725  int i;
726  for (i = 0; i < width; i++) {
727  AV_WN16(dstU + i * 2, AV_RL32(src + i * 4) & 0x3FFu);
728  AV_WN16(dstV + i * 2, (AV_RL32(src + i * 4) >> 20) & 0x3FFu);
729  }
730 }
731 
732 static void read_xv36le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
733  uint32_t *unused2, void *opq)
734 {
735  int i;
736  for (i = 0; i < width; i++)
737  AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2) >> 4);
738 }
739 
740 
741 static void read_xv36le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
742  const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
743 {
744  int i;
745  for (i = 0; i < width; i++) {
746  AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 0) >> 4);
747  AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 4) >> 4);
748  }
749 }
750 
751 /* This is almost identical to the previous, end exists only because
752  * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
753 static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
754  uint32_t *unused, void *opq)
755 {
756  int i;
757  for (i = 0; i < width; i++)
758  dst[i] = src[2 * i + 1];
759 }
760 
761 static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
762  const uint8_t *src2, int width, uint32_t *unused, void *opq)
763 {
764  int i;
765  for (i = 0; i < width; i++) {
766  dstU[i] = src1[4 * i + 0];
767  dstV[i] = src1[4 * i + 2];
768  }
769  av_assert1(src1 == src2);
770 }
771 
772 static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2,
773  const uint8_t *src, int width)
774 {
775  int i;
776  for (i = 0; i < width; i++) {
777  dst1[i] = src[2 * i + 0];
778  dst2[i] = src[2 * i + 1];
779  }
780 }
781 
782 static void nv12ToUV_c(uint8_t *dstU, uint8_t *dstV,
783  const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2,
784  int width, uint32_t *unused, void *opq)
785 {
786  nvXXtoUV_c(dstU, dstV, src1, width);
787 }
788 
789 static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV,
790  const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2,
791  int width, uint32_t *unused, void *opq)
792 {
793  nvXXtoUV_c(dstV, dstU, src1, width);
794 }
795 
796 #define p01x_uv_wrapper(bits, shift) \
797  static void p0 ## bits ## LEToUV_c(uint8_t *dstU, uint8_t *dstV, \
798  const uint8_t *unused0, \
799  const uint8_t *src1, \
800  const uint8_t *src2, int width, \
801  uint32_t *unused, void *opq) \
802  { \
803  int i; \
804  for (i = 0; i < width; i++) { \
805  AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> shift); \
806  AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> shift); \
807  } \
808  } \
809  \
810  static void p0 ## bits ## BEToUV_c(uint8_t *dstU, uint8_t *dstV, \
811  const uint8_t *unused0, \
812  const uint8_t *src1, \
813  const uint8_t *src2, int width, \
814  uint32_t *unused, void *opq) \
815  { \
816  int i; \
817  for (i = 0; i < width; i++) { \
818  AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> shift); \
819  AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> shift); \
820  } \
821  }
822 
823 #define p01x_wrapper(bits, shift) \
824  static void p0 ## bits ## LEToY_c(uint8_t *dst, const uint8_t *src, \
825  const uint8_t *unused1, \
826  const uint8_t *unused2, int width, \
827  uint32_t *unused, void *opq) \
828  { \
829  int i; \
830  for (i = 0; i < width; i++) { \
831  AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> shift); \
832  } \
833  } \
834  \
835  static void p0 ## bits ## BEToY_c(uint8_t *dst, const uint8_t *src, \
836  const uint8_t *unused1, \
837  const uint8_t *unused2, int width, \
838  uint32_t *unused, void *opq) \
839  { \
840  int i; \
841  for (i = 0; i < width; i++) { \
842  AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> shift); \
843  } \
844  } \
845  p01x_uv_wrapper(bits, shift)
846 
848 p01x_wrapper(12, 4)
849 p01x_uv_wrapper(16, 0)
850 
851 static void bgr24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2,
852  int width, uint32_t *rgb2yuv, void *opq)
853 {
854  int16_t *dst = (int16_t *)_dst;
855  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
856  int i;
857  for (i = 0; i < width; i++) {
858  int b = src[i * 3 + 0];
859  int g = src[i * 3 + 1];
860  int r = src[i * 3 + 2];
861 
862  dst[i] = ((ry*r + gy*g + by*b + (32<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6));
863  }
864 }
865 
866 static void bgr24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
867  const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
868 {
869  int16_t *dstU = (int16_t *)_dstU;
870  int16_t *dstV = (int16_t *)_dstV;
871  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
872  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
873  int i;
874  for (i = 0; i < width; i++) {
875  int b = src1[3 * i + 0];
876  int g = src1[3 * i + 1];
877  int r = src1[3 * i + 2];
878 
879  dstU[i] = (ru*r + gu*g + bu*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
880  dstV[i] = (rv*r + gv*g + bv*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
881  }
882  av_assert1(src1 == src2);
883 }
884 
885 static void bgr24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
886  const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
887 {
888  int16_t *dstU = (int16_t *)_dstU;
889  int16_t *dstV = (int16_t *)_dstV;
890  int i;
891  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
892  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
893  for (i = 0; i < width; i++) {
894  int b = src1[6 * i + 0] + src1[6 * i + 3];
895  int g = src1[6 * i + 1] + src1[6 * i + 4];
896  int r = src1[6 * i + 2] + src1[6 * i + 5];
897 
898  dstU[i] = (ru*r + gu*g + bu*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
899  dstV[i] = (rv*r + gv*g + bv*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
900  }
901  av_assert1(src1 == src2);
902 }
903 
904 static void rgb24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
905  uint32_t *rgb2yuv, void *opq)
906 {
907  int16_t *dst = (int16_t *)_dst;
908  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
909  int i;
910  for (i = 0; i < width; i++) {
911  int r = src[i * 3 + 0];
912  int g = src[i * 3 + 1];
913  int b = src[i * 3 + 2];
914 
915  dst[i] = ((ry*r + gy*g + by*b + (32<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6));
916  }
917 }
918 
919 static void rgb24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
920  const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
921 {
922  int16_t *dstU = (int16_t *)_dstU;
923  int16_t *dstV = (int16_t *)_dstV;
924  int i;
925  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
926  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
927  av_assert1(src1 == src2);
928  for (i = 0; i < width; i++) {
929  int r = src1[3 * i + 0];
930  int g = src1[3 * i + 1];
931  int b = src1[3 * i + 2];
932 
933  dstU[i] = (ru*r + gu*g + bu*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
934  dstV[i] = (rv*r + gv*g + bv*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
935  }
936 }
937 
938 static void rgb24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
939  const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
940 {
941  int16_t *dstU = (int16_t *)_dstU;
942  int16_t *dstV = (int16_t *)_dstV;
943  int i;
944  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
945  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
946  av_assert1(src1 == src2);
947  for (i = 0; i < width; i++) {
948  int r = src1[6 * i + 0] + src1[6 * i + 3];
949  int g = src1[6 * i + 1] + src1[6 * i + 4];
950  int b = src1[6 * i + 2] + src1[6 * i + 5];
951 
952  dstU[i] = (ru*r + gu*g + bu*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
953  dstV[i] = (rv*r + gv*g + bv*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
954  }
955 }
956 
957 static void planar_rgb_to_y(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
958 {
959  uint16_t *dst = (uint16_t *)_dst;
960  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
961  int i;
962  for (i = 0; i < width; i++) {
963  int g = src[0][i];
964  int b = src[1][i];
965  int r = src[2][i];
966 
967  dst[i] = (ry*r + gy*g + by*b + (0x801<<(RGB2YUV_SHIFT-7))) >> (RGB2YUV_SHIFT-6);
968  }
969 }
970 
971 static void planar_rgb_to_a(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused, void *opq)
972 {
973  uint16_t *dst = (uint16_t *)_dst;
974  int i;
975  for (i = 0; i < width; i++)
976  dst[i] = src[3][i] << 6;
977 }
978 
979 static void planar_rgb_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
980 {
981  uint16_t *dstU = (uint16_t *)_dstU;
982  uint16_t *dstV = (uint16_t *)_dstV;
983  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
984  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
985  int i;
986  for (i = 0; i < width; i++) {
987  int g = src[0][i];
988  int b = src[1][i];
989  int r = src[2][i];
990 
991  dstU[i] = (ru*r + gu*g + bu*b + (0x4001<<(RGB2YUV_SHIFT-7))) >> (RGB2YUV_SHIFT-6);
992  dstV[i] = (rv*r + gv*g + bv*b + (0x4001<<(RGB2YUV_SHIFT-7))) >> (RGB2YUV_SHIFT-6);
993  }
994 }
995 
996 #define rdpx(src) \
997  (is_be ? AV_RB16(src) : AV_RL16(src))
998 static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_src[4],
999  int width, int bpc, int is_be, int32_t *rgb2yuv)
1000 {
1001  int i;
1002  const uint16_t **src = (const uint16_t **)_src;
1003  uint16_t *dst = (uint16_t *)_dst;
1004  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1005  int shift = bpc < 16 ? bpc : 14;
1006  for (i = 0; i < width; i++) {
1007  int g = rdpx(src[0] + i);
1008  int b = rdpx(src[1] + i);
1009  int r = rdpx(src[2] + i);
1010 
1011  dst[i] = (ry*r + gy*g + by*b + (16 << (RGB2YUV_SHIFT + bpc - 8)) + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14);
1012  }
1013 }
1014 
1015 static av_always_inline void planar_rgb16_to_a(uint8_t *_dst, const uint8_t *_src[4],
1016  int width, int bpc, int is_be, int32_t *rgb2yuv)
1017 {
1018  int i;
1019  const uint16_t **src = (const uint16_t **)_src;
1020  uint16_t *dst = (uint16_t *)_dst;
1021  int shift = bpc < 16 ? bpc : 14;
1022 
1023  for (i = 0; i < width; i++) {
1024  dst[i] = rdpx(src[3] + i) << (14 - shift);
1025  }
1026 }
1027 
1028 static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
1029  const uint8_t *_src[4], int width,
1030  int bpc, int is_be, int32_t *rgb2yuv)
1031 {
1032  int i;
1033  const uint16_t **src = (const uint16_t **)_src;
1034  uint16_t *dstU = (uint16_t *)_dstU;
1035  uint16_t *dstV = (uint16_t *)_dstV;
1036  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1037  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1038  int shift = bpc < 16 ? bpc : 14;
1039  for (i = 0; i < width; i++) {
1040  int g = rdpx(src[0] + i);
1041  int b = rdpx(src[1] + i);
1042  int r = rdpx(src[2] + i);
1043 
1044  dstU[i] = (ru*r + gu*g + bu*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14);
1045  dstV[i] = (rv*r + gv*g + bv*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14);
1046  }
1047 }
1048 #undef rdpx
1049 
1050 #define rdpx(src) (is_be ? av_int2float(AV_RB32(src)): av_int2float(AV_RL32(src)))
1051 
1052 static av_always_inline void planar_rgbf32_to_a(uint8_t *_dst, const uint8_t *_src[4], int width, int is_be, int32_t *rgb2yuv)
1053 {
1054  int i;
1055  const float **src = (const float **)_src;
1056  uint16_t *dst = (uint16_t *)_dst;
1057 
1058  for (i = 0; i < width; i++) {
1059  dst[i] = lrintf(av_clipf(65535.0f * rdpx(src[3] + i), 0.0f, 65535.0f));
1060  }
1061 }
1062 
1063 static av_always_inline void planar_rgbf32_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src[4], int width, int is_be, int32_t *rgb2yuv)
1064 {
1065  int i;
1066  const float **src = (const float **)_src;
1067  uint16_t *dstU = (uint16_t *)_dstU;
1068  uint16_t *dstV = (uint16_t *)_dstV;
1069  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1070  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1071 
1072  for (i = 0; i < width; i++) {
1073  int g = lrintf(av_clipf(65535.0f * rdpx(src[0] + i), 0.0f, 65535.0f));
1074  int b = lrintf(av_clipf(65535.0f * rdpx(src[1] + i), 0.0f, 65535.0f));
1075  int r = lrintf(av_clipf(65535.0f * rdpx(src[2] + i), 0.0f, 65535.0f));
1076 
1077  dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1078  dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1079  }
1080 }
1081 
1082 static av_always_inline void planar_rgbf32_to_y(uint8_t *_dst, const uint8_t *_src[4], int width, int is_be, int32_t *rgb2yuv)
1083 {
1084  int i;
1085  const float **src = (const float **)_src;
1086  uint16_t *dst = (uint16_t *)_dst;
1087 
1088  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1089 
1090  for (i = 0; i < width; i++) {
1091  int g = lrintf(av_clipf(65535.0f * rdpx(src[0] + i), 0.0f, 65535.0f));
1092  int b = lrintf(av_clipf(65535.0f * rdpx(src[1] + i), 0.0f, 65535.0f));
1093  int r = lrintf(av_clipf(65535.0f * rdpx(src[2] + i), 0.0f, 65535.0f));
1094 
1095  dst[i] = (ry*r + gy*g + by*b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1096  }
1097 }
1098 
1099 static av_always_inline void grayf32ToY16_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
1100  const uint8_t *unused2, int width, int is_be, uint32_t *unused)
1101 {
1102  int i;
1103  const float *src = (const float *)_src;
1104  uint16_t *dst = (uint16_t *)_dst;
1105 
1106  for (i = 0; i < width; ++i){
1107  dst[i] = lrintf(av_clipf(65535.0f * rdpx(src + i), 0.0f, 65535.0f));
1108  }
1109 }
1110 
1111 #undef rdpx
1112 
1113 #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
1114 static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1115  int w, int32_t *rgb2yuv, void *opq) \
1116 { \
1117  planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
1118 } \
1119 static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1120  const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1121  void *opq) \
1122 { \
1123  planar_rgb16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
1124 } \
1125 
1126 #define rgb9plus_planar_transparency_funcs(nbits) \
1127 static void planar_rgb##nbits##le_to_a(uint8_t *dst, const uint8_t *src[4], \
1128  int w, int32_t *rgb2yuv, \
1129  void *opq) \
1130 { \
1131  planar_rgb16_to_a(dst, src, w, nbits, 0, rgb2yuv); \
1132 } \
1133 static void planar_rgb##nbits##be_to_a(uint8_t *dst, const uint8_t *src[4], \
1134  int w, int32_t *rgb2yuv, \
1135  void *opq) \
1136 { \
1137  planar_rgb16_to_a(dst, src, w, nbits, 1, rgb2yuv); \
1138 }
1139 
1140 #define rgb9plus_planar_funcs(nbits) \
1141  rgb9plus_planar_funcs_endian(nbits, le, 0) \
1142  rgb9plus_planar_funcs_endian(nbits, be, 1)
1143 
1149 
1153 
1154 #define rgbf32_planar_funcs_endian(endian_name, endian) \
1155 static void planar_rgbf32##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1156  int w, int32_t *rgb2yuv, void *opq) \
1157 { \
1158  planar_rgbf32_to_y(dst, src, w, endian, rgb2yuv); \
1159 } \
1160 static void planar_rgbf32##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1161  const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1162  void *opq) \
1163 { \
1164  planar_rgbf32_to_uv(dstU, dstV, src, w, endian, rgb2yuv); \
1165 } \
1166 static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1167  int w, int32_t *rgb2yuv, void *opq) \
1168 { \
1169  planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \
1170 } \
1171 static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1172  const uint8_t *unused1, const uint8_t *unused2, \
1173  int width, uint32_t *unused, void *opq) \
1174 { \
1175  grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \
1176 }
1177 
1180 
1181 #define rdpx(src) av_int2float(half2float(is_be ? AV_RB16(&src) : AV_RL16(&src), h2f_tbl))
1182 
1183 static av_always_inline void rgbaf16ToUV_half_endian(uint16_t *dstU, uint16_t *dstV, int is_be,
1184  const uint16_t *src, int width,
1185  int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1186 {
1187  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1188  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1189  int i;
1190  for (i = 0; i < width; i++) {
1191  int r = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+0]), 0.0f, 65535.0f)) +
1192  lrintf(av_clipf(65535.0f * rdpx(src[i*8+4]), 0.0f, 65535.0f))) >> 1;
1193  int g = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+1]), 0.0f, 65535.0f)) +
1194  lrintf(av_clipf(65535.0f * rdpx(src[i*8+5]), 0.0f, 65535.0f))) >> 1;
1195  int b = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+2]), 0.0f, 65535.0f)) +
1196  lrintf(av_clipf(65535.0f * rdpx(src[i*8+6]), 0.0f, 65535.0f))) >> 1;
1197 
1198  dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1199  dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1200  }
1201 }
1202 
1203 static av_always_inline void rgbaf16ToUV_endian(uint16_t *dstU, uint16_t *dstV, int is_be,
1204  const uint16_t *src, int width,
1205  int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1206 {
1207  int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1208  int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1209  int i;
1210  for (i = 0; i < width; i++) {
1211  int r = lrintf(av_clipf(65535.0f * rdpx(src[i*4+0]), 0.0f, 65535.0f));
1212  int g = lrintf(av_clipf(65535.0f * rdpx(src[i*4+1]), 0.0f, 65535.0f));
1213  int b = lrintf(av_clipf(65535.0f * rdpx(src[i*4+2]), 0.0f, 65535.0f));
1214 
1215  dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1216  dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1217  }
1218 }
1219 
1220 static av_always_inline void rgbaf16ToY_endian(uint16_t *dst, const uint16_t *src, int is_be,
1221  int width, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1222 {
1223  int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1224  int i;
1225  for (i = 0; i < width; i++) {
1226  int r = lrintf(av_clipf(65535.0f * rdpx(src[i*4+0]), 0.0f, 65535.0f));
1227  int g = lrintf(av_clipf(65535.0f * rdpx(src[i*4+1]), 0.0f, 65535.0f));
1228  int b = lrintf(av_clipf(65535.0f * rdpx(src[i*4+2]), 0.0f, 65535.0f));
1229 
1230  dst[i] = (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1231  }
1232 }
1233 
1234 static av_always_inline void rgbaf16ToA_endian(uint16_t *dst, const uint16_t *src, int is_be,
1235  int width, Half2FloatTables *h2f_tbl)
1236 {
1237  int i;
1238  for (i=0; i<width; i++) {
1239  dst[i] = lrintf(av_clipf(65535.0f * rdpx(src[i*4+3]), 0.0f, 65535.0f));
1240  }
1241 }
1242 
1243 #undef rdpx
1244 
1245 #define rgbaf16_funcs_endian(endian_name, endian) \
1246 static void rgbaf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1247  const uint8_t *src1, const uint8_t *src2, \
1248  int width, uint32_t *_rgb2yuv, void *opq) \
1249 { \
1250  const uint16_t *src = (const uint16_t*)src1; \
1251  uint16_t *dstU = (uint16_t*)_dstU; \
1252  uint16_t *dstV = (uint16_t*)_dstV; \
1253  int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1254  av_assert1(src1==src2); \
1255  rgbaf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1256 } \
1257 static void rgbaf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1258  const uint8_t *src1, const uint8_t *src2, \
1259  int width, uint32_t *_rgb2yuv, void *opq) \
1260 { \
1261  const uint16_t *src = (const uint16_t*)src1; \
1262  uint16_t *dstU = (uint16_t*)_dstU; \
1263  uint16_t *dstV = (uint16_t*)_dstV; \
1264  int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1265  av_assert1(src1==src2); \
1266  rgbaf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1267 } \
1268 static void rgbaf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1269  const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1270 { \
1271  const uint16_t *src = (const uint16_t*)_src; \
1272  uint16_t *dst = (uint16_t*)_dst; \
1273  int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1274  rgbaf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1275 } \
1276 static void rgbaf16##endian_name##ToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1277  const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
1278 { \
1279  const uint16_t *src = (const uint16_t*)_src; \
1280  uint16_t *dst = (uint16_t*)_dst; \
1281  rgbaf16ToA_endian(dst, src, endian, width, opq); \
1282 }
1283 
1286 
1288 {
1289  enum AVPixelFormat srcFormat = c->srcFormat;
1290 
1291  c->chrToYV12 = NULL;
1292  switch (srcFormat) {
1293  case AV_PIX_FMT_YUYV422:
1294  c->chrToYV12 = yuy2ToUV_c;
1295  break;
1296  case AV_PIX_FMT_YVYU422:
1297  c->chrToYV12 = yvy2ToUV_c;
1298  break;
1299  case AV_PIX_FMT_UYVY422:
1300  c->chrToYV12 = uyvyToUV_c;
1301  break;
1302  case AV_PIX_FMT_NV12:
1303  case AV_PIX_FMT_NV16:
1304  case AV_PIX_FMT_NV24:
1305  c->chrToYV12 = nv12ToUV_c;
1306  break;
1307  case AV_PIX_FMT_NV21:
1308  case AV_PIX_FMT_NV42:
1309  c->chrToYV12 = nv21ToUV_c;
1310  break;
1311  case AV_PIX_FMT_RGB8:
1312  case AV_PIX_FMT_BGR8:
1313  case AV_PIX_FMT_PAL8:
1314  case AV_PIX_FMT_BGR4_BYTE:
1315  case AV_PIX_FMT_RGB4_BYTE:
1316  c->chrToYV12 = palToUV_c;
1317  break;
1318  case AV_PIX_FMT_GBRP9LE:
1319  c->readChrPlanar = planar_rgb9le_to_uv;
1320  break;
1321  case AV_PIX_FMT_GBRAP10LE:
1322  case AV_PIX_FMT_GBRP10LE:
1323  c->readChrPlanar = planar_rgb10le_to_uv;
1324  break;
1325  case AV_PIX_FMT_GBRAP12LE:
1326  case AV_PIX_FMT_GBRP12LE:
1327  c->readChrPlanar = planar_rgb12le_to_uv;
1328  break;
1329  case AV_PIX_FMT_GBRP14LE:
1330  c->readChrPlanar = planar_rgb14le_to_uv;
1331  break;
1332  case AV_PIX_FMT_GBRAP16LE:
1333  case AV_PIX_FMT_GBRP16LE:
1334  c->readChrPlanar = planar_rgb16le_to_uv;
1335  break;
1336  case AV_PIX_FMT_GBRAPF32LE:
1337  case AV_PIX_FMT_GBRPF32LE:
1338  c->readChrPlanar = planar_rgbf32le_to_uv;
1339  break;
1340  case AV_PIX_FMT_GBRP9BE:
1341  c->readChrPlanar = planar_rgb9be_to_uv;
1342  break;
1343  case AV_PIX_FMT_GBRAP10BE:
1344  case AV_PIX_FMT_GBRP10BE:
1345  c->readChrPlanar = planar_rgb10be_to_uv;
1346  break;
1347  case AV_PIX_FMT_GBRAP12BE:
1348  case AV_PIX_FMT_GBRP12BE:
1349  c->readChrPlanar = planar_rgb12be_to_uv;
1350  break;
1351  case AV_PIX_FMT_GBRP14BE:
1352  c->readChrPlanar = planar_rgb14be_to_uv;
1353  break;
1354  case AV_PIX_FMT_GBRAP16BE:
1355  case AV_PIX_FMT_GBRP16BE:
1356  c->readChrPlanar = planar_rgb16be_to_uv;
1357  break;
1358  case AV_PIX_FMT_GBRAPF32BE:
1359  case AV_PIX_FMT_GBRPF32BE:
1360  c->readChrPlanar = planar_rgbf32be_to_uv;
1361  break;
1362  case AV_PIX_FMT_GBRAP:
1363  case AV_PIX_FMT_GBRP:
1364  c->readChrPlanar = planar_rgb_to_uv;
1365  break;
1366 #if HAVE_BIGENDIAN
1367  case AV_PIX_FMT_YUV420P9LE:
1368  case AV_PIX_FMT_YUV422P9LE:
1369  case AV_PIX_FMT_YUV444P9LE:
1384 
1396  c->chrToYV12 = bswap16UV_c;
1397  break;
1398 #else
1399  case AV_PIX_FMT_YUV420P9BE:
1400  case AV_PIX_FMT_YUV422P9BE:
1401  case AV_PIX_FMT_YUV444P9BE:
1416 
1428  c->chrToYV12 = bswap16UV_c;
1429  break;
1430 #endif
1431  case AV_PIX_FMT_VUYA:
1432  case AV_PIX_FMT_VUYX:
1433  c->chrToYV12 = read_vuyx_UV_c;
1434  break;
1435  case AV_PIX_FMT_XV30LE:
1436  c->chrToYV12 = read_xv30le_UV_c;
1437  break;
1438  case AV_PIX_FMT_AYUV64LE:
1439  c->chrToYV12 = read_ayuv64le_UV_c;
1440  break;
1441  case AV_PIX_FMT_XV36LE:
1442  c->chrToYV12 = read_xv36le_UV_c;
1443  break;
1444  case AV_PIX_FMT_P010LE:
1445  case AV_PIX_FMT_P210LE:
1446  case AV_PIX_FMT_P410LE:
1447  c->chrToYV12 = p010LEToUV_c;
1448  break;
1449  case AV_PIX_FMT_P010BE:
1450  case AV_PIX_FMT_P210BE:
1451  case AV_PIX_FMT_P410BE:
1452  c->chrToYV12 = p010BEToUV_c;
1453  break;
1454  case AV_PIX_FMT_P012LE:
1455  c->chrToYV12 = p012LEToUV_c;
1456  break;
1457  case AV_PIX_FMT_P012BE:
1458  c->chrToYV12 = p012BEToUV_c;
1459  break;
1460  case AV_PIX_FMT_P016LE:
1461  case AV_PIX_FMT_P216LE:
1462  case AV_PIX_FMT_P416LE:
1463  c->chrToYV12 = p016LEToUV_c;
1464  break;
1465  case AV_PIX_FMT_P016BE:
1466  case AV_PIX_FMT_P216BE:
1467  case AV_PIX_FMT_P416BE:
1468  c->chrToYV12 = p016BEToUV_c;
1469  break;
1470  case AV_PIX_FMT_Y210LE:
1471  c->chrToYV12 = y210le_UV_c;
1472  break;
1473  case AV_PIX_FMT_Y212LE:
1474  c->chrToYV12 = y212le_UV_c;
1475  break;
1476  }
1477  if (c->chrSrcHSubSample) {
1478  switch (srcFormat) {
1479  case AV_PIX_FMT_RGBA64BE:
1480  c->chrToYV12 = rgb64BEToUV_half_c;
1481  break;
1482  case AV_PIX_FMT_RGBA64LE:
1483  c->chrToYV12 = rgb64LEToUV_half_c;
1484  break;
1485  case AV_PIX_FMT_BGRA64BE:
1486  c->chrToYV12 = bgr64BEToUV_half_c;
1487  break;
1488  case AV_PIX_FMT_BGRA64LE:
1489  c->chrToYV12 = bgr64LEToUV_half_c;
1490  break;
1491  case AV_PIX_FMT_RGB48BE:
1492  c->chrToYV12 = rgb48BEToUV_half_c;
1493  break;
1494  case AV_PIX_FMT_RGB48LE:
1495  c->chrToYV12 = rgb48LEToUV_half_c;
1496  break;
1497  case AV_PIX_FMT_BGR48BE:
1498  c->chrToYV12 = bgr48BEToUV_half_c;
1499  break;
1500  case AV_PIX_FMT_BGR48LE:
1501  c->chrToYV12 = bgr48LEToUV_half_c;
1502  break;
1503  case AV_PIX_FMT_RGB32:
1504  c->chrToYV12 = bgr32ToUV_half_c;
1505  break;
1506  case AV_PIX_FMT_RGB32_1:
1507  c->chrToYV12 = bgr321ToUV_half_c;
1508  break;
1509  case AV_PIX_FMT_BGR24:
1510  c->chrToYV12 = bgr24ToUV_half_c;
1511  break;
1512  case AV_PIX_FMT_BGR565LE:
1513  c->chrToYV12 = bgr16leToUV_half_c;
1514  break;
1515  case AV_PIX_FMT_BGR565BE:
1516  c->chrToYV12 = bgr16beToUV_half_c;
1517  break;
1518  case AV_PIX_FMT_BGR555LE:
1519  c->chrToYV12 = bgr15leToUV_half_c;
1520  break;
1521  case AV_PIX_FMT_BGR555BE:
1522  c->chrToYV12 = bgr15beToUV_half_c;
1523  break;
1524  case AV_PIX_FMT_GBRAP:
1525  case AV_PIX_FMT_GBRP:
1526  c->chrToYV12 = gbr24pToUV_half_c;
1527  break;
1528  case AV_PIX_FMT_BGR444LE:
1529  c->chrToYV12 = bgr12leToUV_half_c;
1530  break;
1531  case AV_PIX_FMT_BGR444BE:
1532  c->chrToYV12 = bgr12beToUV_half_c;
1533  break;
1534  case AV_PIX_FMT_BGR32:
1535  c->chrToYV12 = rgb32ToUV_half_c;
1536  break;
1537  case AV_PIX_FMT_BGR32_1:
1538  c->chrToYV12 = rgb321ToUV_half_c;
1539  break;
1540  case AV_PIX_FMT_RGB24:
1541  c->chrToYV12 = rgb24ToUV_half_c;
1542  break;
1543  case AV_PIX_FMT_RGB565LE:
1544  c->chrToYV12 = rgb16leToUV_half_c;
1545  break;
1546  case AV_PIX_FMT_RGB565BE:
1547  c->chrToYV12 = rgb16beToUV_half_c;
1548  break;
1549  case AV_PIX_FMT_RGB555LE:
1550  c->chrToYV12 = rgb15leToUV_half_c;
1551  break;
1552  case AV_PIX_FMT_RGB555BE:
1553  c->chrToYV12 = rgb15beToUV_half_c;
1554  break;
1555  case AV_PIX_FMT_RGB444LE:
1556  c->chrToYV12 = rgb12leToUV_half_c;
1557  break;
1558  case AV_PIX_FMT_RGB444BE:
1559  c->chrToYV12 = rgb12beToUV_half_c;
1560  break;
1561  case AV_PIX_FMT_X2RGB10LE:
1562  c->chrToYV12 = rgb30leToUV_half_c;
1563  break;
1564  case AV_PIX_FMT_X2BGR10LE:
1565  c->chrToYV12 = bgr30leToUV_half_c;
1566  break;
1567  case AV_PIX_FMT_RGBAF16BE:
1568  c->chrToYV12 = rgbaf16beToUV_half_c;
1569  break;
1570  case AV_PIX_FMT_RGBAF16LE:
1571  c->chrToYV12 = rgbaf16leToUV_half_c;
1572  break;
1573  }
1574  } else {
1575  switch (srcFormat) {
1576  case AV_PIX_FMT_RGBA64BE:
1577  c->chrToYV12 = rgb64BEToUV_c;
1578  break;
1579  case AV_PIX_FMT_RGBA64LE:
1580  c->chrToYV12 = rgb64LEToUV_c;
1581  break;
1582  case AV_PIX_FMT_BGRA64BE:
1583  c->chrToYV12 = bgr64BEToUV_c;
1584  break;
1585  case AV_PIX_FMT_BGRA64LE:
1586  c->chrToYV12 = bgr64LEToUV_c;
1587  break;
1588  case AV_PIX_FMT_RGB48BE:
1589  c->chrToYV12 = rgb48BEToUV_c;
1590  break;
1591  case AV_PIX_FMT_RGB48LE:
1592  c->chrToYV12 = rgb48LEToUV_c;
1593  break;
1594  case AV_PIX_FMT_BGR48BE:
1595  c->chrToYV12 = bgr48BEToUV_c;
1596  break;
1597  case AV_PIX_FMT_BGR48LE:
1598  c->chrToYV12 = bgr48LEToUV_c;
1599  break;
1600  case AV_PIX_FMT_RGB32:
1601  c->chrToYV12 = bgr32ToUV_c;
1602  break;
1603  case AV_PIX_FMT_RGB32_1:
1604  c->chrToYV12 = bgr321ToUV_c;
1605  break;
1606  case AV_PIX_FMT_BGR24:
1607  c->chrToYV12 = bgr24ToUV_c;
1608  break;
1609  case AV_PIX_FMT_BGR565LE:
1610  c->chrToYV12 = bgr16leToUV_c;
1611  break;
1612  case AV_PIX_FMT_BGR565BE:
1613  c->chrToYV12 = bgr16beToUV_c;
1614  break;
1615  case AV_PIX_FMT_BGR555LE:
1616  c->chrToYV12 = bgr15leToUV_c;
1617  break;
1618  case AV_PIX_FMT_BGR555BE:
1619  c->chrToYV12 = bgr15beToUV_c;
1620  break;
1621  case AV_PIX_FMT_BGR444LE:
1622  c->chrToYV12 = bgr12leToUV_c;
1623  break;
1624  case AV_PIX_FMT_BGR444BE:
1625  c->chrToYV12 = bgr12beToUV_c;
1626  break;
1627  case AV_PIX_FMT_BGR32:
1628  c->chrToYV12 = rgb32ToUV_c;
1629  break;
1630  case AV_PIX_FMT_BGR32_1:
1631  c->chrToYV12 = rgb321ToUV_c;
1632  break;
1633  case AV_PIX_FMT_RGB24:
1634  c->chrToYV12 = rgb24ToUV_c;
1635  break;
1636  case AV_PIX_FMT_RGB565LE:
1637  c->chrToYV12 = rgb16leToUV_c;
1638  break;
1639  case AV_PIX_FMT_RGB565BE:
1640  c->chrToYV12 = rgb16beToUV_c;
1641  break;
1642  case AV_PIX_FMT_RGB555LE:
1643  c->chrToYV12 = rgb15leToUV_c;
1644  break;
1645  case AV_PIX_FMT_RGB555BE:
1646  c->chrToYV12 = rgb15beToUV_c;
1647  break;
1648  case AV_PIX_FMT_RGB444LE:
1649  c->chrToYV12 = rgb12leToUV_c;
1650  break;
1651  case AV_PIX_FMT_RGB444BE:
1652  c->chrToYV12 = rgb12beToUV_c;
1653  break;
1654  case AV_PIX_FMT_X2RGB10LE:
1655  c->chrToYV12 = rgb30leToUV_c;
1656  break;
1657  case AV_PIX_FMT_X2BGR10LE:
1658  c->chrToYV12 = bgr30leToUV_c;
1659  break;
1660  case AV_PIX_FMT_RGBAF16BE:
1661  c->chrToYV12 = rgbaf16beToUV_c;
1662  break;
1663  case AV_PIX_FMT_RGBAF16LE:
1664  c->chrToYV12 = rgbaf16leToUV_c;
1665  break;
1666  }
1667  }
1668 
1669  c->lumToYV12 = NULL;
1670  c->alpToYV12 = NULL;
1671  switch (srcFormat) {
1672  case AV_PIX_FMT_GBRP9LE:
1673  c->readLumPlanar = planar_rgb9le_to_y;
1674  break;
1675  case AV_PIX_FMT_GBRAP10LE:
1676  c->readAlpPlanar = planar_rgb10le_to_a;
1677  case AV_PIX_FMT_GBRP10LE:
1678  c->readLumPlanar = planar_rgb10le_to_y;
1679  break;
1680  case AV_PIX_FMT_GBRAP12LE:
1681  c->readAlpPlanar = planar_rgb12le_to_a;
1682  case AV_PIX_FMT_GBRP12LE:
1683  c->readLumPlanar = planar_rgb12le_to_y;
1684  break;
1685  case AV_PIX_FMT_GBRP14LE:
1686  c->readLumPlanar = planar_rgb14le_to_y;
1687  break;
1688  case AV_PIX_FMT_GBRAP16LE:
1689  c->readAlpPlanar = planar_rgb16le_to_a;
1690  case AV_PIX_FMT_GBRP16LE:
1691  c->readLumPlanar = planar_rgb16le_to_y;
1692  break;
1693  case AV_PIX_FMT_GBRAPF32LE:
1694  c->readAlpPlanar = planar_rgbf32le_to_a;
1695  case AV_PIX_FMT_GBRPF32LE:
1696  c->readLumPlanar = planar_rgbf32le_to_y;
1697  break;
1698  case AV_PIX_FMT_GBRP9BE:
1699  c->readLumPlanar = planar_rgb9be_to_y;
1700  break;
1701  case AV_PIX_FMT_GBRAP10BE:
1702  c->readAlpPlanar = planar_rgb10be_to_a;
1703  case AV_PIX_FMT_GBRP10BE:
1704  c->readLumPlanar = planar_rgb10be_to_y;
1705  break;
1706  case AV_PIX_FMT_GBRAP12BE:
1707  c->readAlpPlanar = planar_rgb12be_to_a;
1708  case AV_PIX_FMT_GBRP12BE:
1709  c->readLumPlanar = planar_rgb12be_to_y;
1710  break;
1711  case AV_PIX_FMT_GBRP14BE:
1712  c->readLumPlanar = planar_rgb14be_to_y;
1713  break;
1714  case AV_PIX_FMT_GBRAP16BE:
1715  c->readAlpPlanar = planar_rgb16be_to_a;
1716  case AV_PIX_FMT_GBRP16BE:
1717  c->readLumPlanar = planar_rgb16be_to_y;
1718  break;
1719  case AV_PIX_FMT_GBRAPF32BE:
1720  c->readAlpPlanar = planar_rgbf32be_to_a;
1721  case AV_PIX_FMT_GBRPF32BE:
1722  c->readLumPlanar = planar_rgbf32be_to_y;
1723  break;
1724  case AV_PIX_FMT_GBRAP:
1725  c->readAlpPlanar = planar_rgb_to_a;
1726  case AV_PIX_FMT_GBRP:
1727  c->readLumPlanar = planar_rgb_to_y;
1728  break;
1729 #if HAVE_BIGENDIAN
1730  case AV_PIX_FMT_YUV420P9LE:
1731  case AV_PIX_FMT_YUV422P9LE:
1732  case AV_PIX_FMT_YUV444P9LE:
1747 
1748  case AV_PIX_FMT_GRAY9LE:
1749  case AV_PIX_FMT_GRAY10LE:
1750  case AV_PIX_FMT_GRAY12LE:
1751  case AV_PIX_FMT_GRAY14LE:
1752  case AV_PIX_FMT_GRAY16LE:
1753 
1754  case AV_PIX_FMT_P016LE:
1755  case AV_PIX_FMT_P216LE:
1756  case AV_PIX_FMT_P416LE:
1757  c->lumToYV12 = bswap16Y_c;
1758  break;
1770  c->lumToYV12 = bswap16Y_c;
1771  c->alpToYV12 = bswap16Y_c;
1772  break;
1773 #else
1774  case AV_PIX_FMT_YUV420P9BE:
1775  case AV_PIX_FMT_YUV422P9BE:
1776  case AV_PIX_FMT_YUV444P9BE:
1791 
1792  case AV_PIX_FMT_GRAY9BE:
1793  case AV_PIX_FMT_GRAY10BE:
1794  case AV_PIX_FMT_GRAY12BE:
1795  case AV_PIX_FMT_GRAY14BE:
1796  case AV_PIX_FMT_GRAY16BE:
1797 
1798  case AV_PIX_FMT_P016BE:
1799  case AV_PIX_FMT_P216BE:
1800  case AV_PIX_FMT_P416BE:
1801  c->lumToYV12 = bswap16Y_c;
1802  break;
1814  c->lumToYV12 = bswap16Y_c;
1815  c->alpToYV12 = bswap16Y_c;
1816  break;
1817 #endif
1818  case AV_PIX_FMT_YA16LE:
1819  c->lumToYV12 = read_ya16le_gray_c;
1820  break;
1821  case AV_PIX_FMT_YA16BE:
1822  c->lumToYV12 = read_ya16be_gray_c;
1823  break;
1824  case AV_PIX_FMT_VUYA:
1825  case AV_PIX_FMT_VUYX:
1826  c->lumToYV12 = read_vuyx_Y_c;
1827  break;
1828  case AV_PIX_FMT_XV30LE:
1829  c->lumToYV12 = read_xv30le_Y_c;
1830  break;
1831  case AV_PIX_FMT_AYUV64LE:
1832  c->lumToYV12 = read_ayuv64le_Y_c;
1833  break;
1834  case AV_PIX_FMT_XV36LE:
1835  c->lumToYV12 = read_xv36le_Y_c;
1836  break;
1837  case AV_PIX_FMT_YUYV422:
1838  case AV_PIX_FMT_YVYU422:
1839  case AV_PIX_FMT_YA8:
1840  c->lumToYV12 = yuy2ToY_c;
1841  break;
1842  case AV_PIX_FMT_UYVY422:
1843  c->lumToYV12 = uyvyToY_c;
1844  break;
1845  case AV_PIX_FMT_BGR24:
1846  c->lumToYV12 = bgr24ToY_c;
1847  break;
1848  case AV_PIX_FMT_BGR565LE:
1849  c->lumToYV12 = bgr16leToY_c;
1850  break;
1851  case AV_PIX_FMT_BGR565BE:
1852  c->lumToYV12 = bgr16beToY_c;
1853  break;
1854  case AV_PIX_FMT_BGR555LE:
1855  c->lumToYV12 = bgr15leToY_c;
1856  break;
1857  case AV_PIX_FMT_BGR555BE:
1858  c->lumToYV12 = bgr15beToY_c;
1859  break;
1860  case AV_PIX_FMT_BGR444LE:
1861  c->lumToYV12 = bgr12leToY_c;
1862  break;
1863  case AV_PIX_FMT_BGR444BE:
1864  c->lumToYV12 = bgr12beToY_c;
1865  break;
1866  case AV_PIX_FMT_RGB24:
1867  c->lumToYV12 = rgb24ToY_c;
1868  break;
1869  case AV_PIX_FMT_RGB565LE:
1870  c->lumToYV12 = rgb16leToY_c;
1871  break;
1872  case AV_PIX_FMT_RGB565BE:
1873  c->lumToYV12 = rgb16beToY_c;
1874  break;
1875  case AV_PIX_FMT_RGB555LE:
1876  c->lumToYV12 = rgb15leToY_c;
1877  break;
1878  case AV_PIX_FMT_RGB555BE:
1879  c->lumToYV12 = rgb15beToY_c;
1880  break;
1881  case AV_PIX_FMT_RGB444LE:
1882  c->lumToYV12 = rgb12leToY_c;
1883  break;
1884  case AV_PIX_FMT_RGB444BE:
1885  c->lumToYV12 = rgb12beToY_c;
1886  break;
1887  case AV_PIX_FMT_RGB8:
1888  case AV_PIX_FMT_BGR8:
1889  case AV_PIX_FMT_PAL8:
1890  case AV_PIX_FMT_BGR4_BYTE:
1891  case AV_PIX_FMT_RGB4_BYTE:
1892  c->lumToYV12 = palToY_c;
1893  break;
1894  case AV_PIX_FMT_MONOBLACK:
1895  c->lumToYV12 = monoblack2Y_c;
1896  break;
1897  case AV_PIX_FMT_MONOWHITE:
1898  c->lumToYV12 = monowhite2Y_c;
1899  break;
1900  case AV_PIX_FMT_RGB32:
1901  c->lumToYV12 = bgr32ToY_c;
1902  break;
1903  case AV_PIX_FMT_RGB32_1:
1904  c->lumToYV12 = bgr321ToY_c;
1905  break;
1906  case AV_PIX_FMT_BGR32:
1907  c->lumToYV12 = rgb32ToY_c;
1908  break;
1909  case AV_PIX_FMT_BGR32_1:
1910  c->lumToYV12 = rgb321ToY_c;
1911  break;
1912  case AV_PIX_FMT_RGB48BE:
1913  c->lumToYV12 = rgb48BEToY_c;
1914  break;
1915  case AV_PIX_FMT_RGB48LE:
1916  c->lumToYV12 = rgb48LEToY_c;
1917  break;
1918  case AV_PIX_FMT_BGR48BE:
1919  c->lumToYV12 = bgr48BEToY_c;
1920  break;
1921  case AV_PIX_FMT_BGR48LE:
1922  c->lumToYV12 = bgr48LEToY_c;
1923  break;
1924  case AV_PIX_FMT_RGBA64BE:
1925  c->lumToYV12 = rgb64BEToY_c;
1926  break;
1927  case AV_PIX_FMT_RGBA64LE:
1928  c->lumToYV12 = rgb64LEToY_c;
1929  break;
1930  case AV_PIX_FMT_BGRA64BE:
1931  c->lumToYV12 = bgr64BEToY_c;
1932  break;
1933  case AV_PIX_FMT_BGRA64LE:
1934  c->lumToYV12 = bgr64LEToY_c;
1935  break;
1936  case AV_PIX_FMT_P010LE:
1937  case AV_PIX_FMT_P210LE:
1938  case AV_PIX_FMT_P410LE:
1939  c->lumToYV12 = p010LEToY_c;
1940  break;
1941  case AV_PIX_FMT_P010BE:
1942  case AV_PIX_FMT_P210BE:
1943  case AV_PIX_FMT_P410BE:
1944  c->lumToYV12 = p010BEToY_c;
1945  break;
1946  case AV_PIX_FMT_P012LE:
1947  c->lumToYV12 = p012LEToY_c;
1948  break;
1949  case AV_PIX_FMT_P012BE:
1950  c->lumToYV12 = p012BEToY_c;
1951  break;
1952  case AV_PIX_FMT_GRAYF32LE:
1953  c->lumToYV12 = grayf32leToY16_c;
1954  break;
1955  case AV_PIX_FMT_GRAYF32BE:
1956  c->lumToYV12 = grayf32beToY16_c;
1957  break;
1958  case AV_PIX_FMT_Y210LE:
1959  c->lumToYV12 = y210le_Y_c;
1960  break;
1961  case AV_PIX_FMT_Y212LE:
1962  c->lumToYV12 = y212le_Y_c;
1963  break;
1964  case AV_PIX_FMT_X2RGB10LE:
1965  c->lumToYV12 = rgb30leToY_c;
1966  break;
1967  case AV_PIX_FMT_X2BGR10LE:
1968  c->lumToYV12 = bgr30leToY_c;
1969  break;
1970  case AV_PIX_FMT_RGBAF16BE:
1971  c->lumToYV12 = rgbaf16beToY_c;
1972  break;
1973  case AV_PIX_FMT_RGBAF16LE:
1974  c->lumToYV12 = rgbaf16leToY_c;
1975  break;
1976  }
1977  if (c->needAlpha) {
1978  if (is16BPS(srcFormat) || isNBPS(srcFormat)) {
1979  if (HAVE_BIGENDIAN == !isBE(srcFormat) && !c->readAlpPlanar)
1980  c->alpToYV12 = bswap16Y_c;
1981  }
1982  switch (srcFormat) {
1983  case AV_PIX_FMT_BGRA64LE:
1984  case AV_PIX_FMT_RGBA64LE: c->alpToYV12 = rgba64leToA_c; break;
1985  case AV_PIX_FMT_BGRA64BE:
1986  case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64beToA_c; break;
1987  case AV_PIX_FMT_BGRA:
1988  case AV_PIX_FMT_RGBA:
1989  c->alpToYV12 = rgbaToA_c;
1990  break;
1991  case AV_PIX_FMT_ABGR:
1992  case AV_PIX_FMT_ARGB:
1993  c->alpToYV12 = abgrToA_c;
1994  break;
1995  case AV_PIX_FMT_RGBAF16BE:
1996  c->alpToYV12 = rgbaf16beToA_c;
1997  break;
1998  case AV_PIX_FMT_RGBAF16LE:
1999  c->alpToYV12 = rgbaf16leToA_c;
2000  break;
2001  case AV_PIX_FMT_YA8:
2002  c->alpToYV12 = uyvyToY_c;
2003  break;
2004  case AV_PIX_FMT_YA16LE:
2005  c->alpToYV12 = read_ya16le_alpha_c;
2006  break;
2007  case AV_PIX_FMT_YA16BE:
2008  c->alpToYV12 = read_ya16be_alpha_c;
2009  break;
2010  case AV_PIX_FMT_VUYA:
2011  c->alpToYV12 = read_vuya_A_c;
2012  break;
2013  case AV_PIX_FMT_AYUV64LE:
2014  c->alpToYV12 = read_ayuv64le_A_c;
2015  break;
2016  case AV_PIX_FMT_PAL8 :
2017  c->alpToYV12 = palToA_c;
2018  break;
2019  }
2020  }
2021 }
be
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it be(in the first position) for now. Options ------- Then comes the options array. This is what will define the user accessible options. For example
read_xv30le_Y_c
static void read_xv30le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:713
AV_PIX_FMT_YUV420P9LE
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:147
AV_PIX_FMT_XV30LE
@ AV_PIX_FMT_XV30LE
packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channe...
Definition: pixfmt.h:412
AV_PIX_FMT_GRAY10BE
@ AV_PIX_FMT_GRAY10BE
Y , 10bpp, big-endian.
Definition: pixfmt.h:317
read_ya16le_alpha_c
static void read_ya16le_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:636
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
AV_PIX_FMT_BGR48LE
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:139
bgr24ToUV_c
static void bgr24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
Definition: input.c:866
Half2FloatTables
Definition: half2float.h:27
AV_PIX_FMT_P416BE
@ AV_PIX_FMT_P416BE
interleaved chroma YUV 4:4:4, 48bpp, big-endian
Definition: pixfmt.h:395
AV_PIX_FMT_YA8
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
Definition: pixfmt.h:133
AV_PIX_FMT_BGRA64BE
@ AV_PIX_FMT_BGRA64BE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:197
RGB64FUNCS
#define RGB64FUNCS(pattern, endianness, base_fmt)
Definition: input.c:124
AV_PIX_FMT_BGR32
#define AV_PIX_FMT_BGR32
Definition: pixfmt.h:434
AV_PIX_FMT_RGB444LE
@ AV_PIX_FMT_RGB444LE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:129
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:262
AV_PIX_FMT_GBRP16BE
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:164
rgb64ToUV_c_template
static av_always_inline void rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
Definition: input.c:59
AV_PIX_FMT_GBRP10BE
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:162
planar_rgb16_to_uv
static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src[4], int width, int bpc, int is_be, int32_t *rgb2yuv)
Definition: input.c:1028
AV_PIX_FMT_YUV422P14LE
@ AV_PIX_FMT_YUV422P14LE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:267
src1
const pixel * src1
Definition: h264pred_template.c:421
read_ya16be_gray_c
static void read_ya16be_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:644
planar_rgb_to_y
static void planar_rgb_to_y(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
Definition: input.c:957
rgbaf16ToUV_endian
static av_always_inline void rgbaf16ToUV_endian(uint16_t *dstU, uint16_t *dstV, int is_be, const uint16_t *src, int width, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
Definition: input.c:1203
AV_PIX_FMT_YUVA444P10BE
@ AV_PIX_FMT_YUVA444P10BE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:178
RV_IDX
#define RV_IDX
Definition: swscale_internal.h:446
AV_PIX_FMT_RGBA64BE
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:195
AV_PIX_FMT_YUV440P12BE
@ AV_PIX_FMT_YUV440P12BE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:298
AV_PIX_FMT_GBRAPF32LE
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
Definition: pixfmt.h:341
RU_IDX
#define RU_IDX
Definition: swscale_internal.h:443
AV_PIX_FMT_GBRPF32BE
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
Definition: pixfmt.h:338
monoblack2Y_c
static void monoblack2Y_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:530
ff_sws_init_input_funcs
void ff_sws_init_input_funcs(SwsContext *c)
b
#define b
Definition: input.c:41
GV_IDX
#define GV_IDX
Definition: swscale_internal.h:447
AV_PIX_FMT_MONOWHITE
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:75
AV_PIX_FMT_P010BE
@ AV_PIX_FMT_P010BE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:305
rgb2yuv
static const char rgb2yuv[]
Definition: vf_scale_vulkan.c:68
BV_IDX
#define BV_IDX
Definition: swscale_internal.h:448
AV_PIX_FMT_YUV420P14BE
@ AV_PIX_FMT_YUV420P14BE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:262
AV_PIX_FMT_YUV420P16LE
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:121
AV_PIX_FMT_RGB32_1
#define AV_PIX_FMT_RGB32_1
Definition: pixfmt.h:433
AV_PIX_FMT_GBRP14BE
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:274
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
rgbf32_planar_funcs_endian
#define rgbf32_planar_funcs_endian(endian_name, endian)
planar_rgbf32_to_uv
static av_always_inline void planar_rgbf32_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src[4], int width, int is_be, int32_t *rgb2yuv)
Definition: input.c:1063
AV_PIX_FMT_YUVA444P9BE
@ AV_PIX_FMT_YUVA444P9BE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:172
AV_PIX_FMT_YUV422P9BE
@ AV_PIX_FMT_YUV422P9BE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:156
planar_rgbf32_to_y
static av_always_inline void planar_rgbf32_to_y(uint8_t *_dst, const uint8_t *_src[4], int width, int is_be, int32_t *rgb2yuv)
Definition: input.c:1082
AV_PIX_FMT_GRAY10LE
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
Definition: pixfmt.h:318
AV_PIX_FMT_GRAYF32LE
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
Definition: pixfmt.h:361
read_xv30le_UV_c
static void read_xv30le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:722
rgba64beToA_c
static void rgba64beToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:442
AV_PIX_FMT_RGB555BE
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:107
AV_PIX_FMT_RGBAF16LE
@ AV_PIX_FMT_RGBAF16LE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian.
Definition: pixfmt.h:401
AV_PIX_FMT_AYUV64LE
@ AV_PIX_FMT_AYUV64LE
packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:299
AV_PIX_FMT_YUV444P16LE
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:125
S
#define S(s, c, i)
Definition: flacdsp_template.c:46
AV_PIX_FMT_GBRAP12LE
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
Definition: pixfmt.h:308
AV_PIX_FMT_GRAY16BE
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
Definition: pixfmt.h:97
is16BPS
static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:703
rgb
Definition: rpzaenc.c:59
input_pixel
#define input_pixel(pos)
Definition: input.c:251
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_YUV420P12LE
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:261
AV_PIX_FMT_GRAY9LE
@ AV_PIX_FMT_GRAY9LE
Y , 9bpp, little-endian.
Definition: pixfmt.h:336
isNBPS
static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:717
AV_PIX_FMT_YUVA444P16BE
@ AV_PIX_FMT_YUVA444P16BE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:184
r
#define r
Definition: input.c:40
AV_PIX_FMT_YUV444P10BE
@ AV_PIX_FMT_YUV444P10BE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:154
AV_PIX_FMT_YUV420P10LE
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:149
AV_PIX_FMT_VUYA
@ AV_PIX_FMT_VUYA
packed VUYA 4:4:4, 32bpp, VUYAVUYA...
Definition: pixfmt.h:398
AV_PIX_FMT_YUV444P12LE
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:269
AV_PIX_FMT_YUV422P12BE
@ AV_PIX_FMT_YUV422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:264
AV_PIX_FMT_YUV444P14LE
@ AV_PIX_FMT_YUV444P14LE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:271
AV_PIX_FMT_BGR8
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:83
avassert.h
rnd
#define rnd()
Definition: checkasm.h:118
rgb16_32ToY_c_template
static av_always_inline void rgb16_32ToY_c_template(int16_t *dst, const uint8_t *src, int width, enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, int32_t *rgb2yuv, int is_be)
Definition: input.c:262
av_cold
#define av_cold
Definition: attributes.h:90
planar_rgbf32_to_a
static av_always_inline void planar_rgbf32_to_a(uint8_t *_dst, const uint8_t *_src[4], int width, int is_be, int32_t *rgb2yuv)
Definition: input.c:1052
AV_PIX_FMT_GBRAP16BE
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-endian
Definition: pixfmt.h:206
width
#define width
intreadwrite.h
rgba64leToA_c
static void rgba64leToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:432
AV_PIX_FMT_GBRP16LE
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:165
bswap16UV_c
static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, int width, uint32_t *unused, void *opq)
Definition: input.c:615
AV_PIX_FMT_P416LE
@ AV_PIX_FMT_P416LE
interleaved chroma YUV 4:4:4, 48bpp, little-endian
Definition: pixfmt.h:396
AV_PIX_FMT_P210LE
@ AV_PIX_FMT_P210LE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian
Definition: pixfmt.h:387
g
const char * g
Definition: vf_curves.c:127
read_ayuv64le_Y_c
static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:660
rgbaf16ToA_endian
static av_always_inline void rgbaf16ToA_endian(uint16_t *dst, const uint16_t *src, int is_be, int width, Half2FloatTables *h2f_tbl)
Definition: input.c:1234
AV_PIX_FMT_P016BE
@ AV_PIX_FMT_P016BE
like NV12, with 16bpp per component, big-endian
Definition: pixfmt.h:321
AV_PIX_FMT_GBRP12LE
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:273
AV_PIX_FMT_YUVA420P16BE
@ AV_PIX_FMT_YUVA420P16BE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:180
monowhite2Y_c
static void monowhite2Y_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:512
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
AV_PIX_FMT_GBRP10LE
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:163
p01x_uv_wrapper
#define p01x_uv_wrapper(bits, shift)
Definition: input.c:796
GY_IDX
#define GY_IDX
Definition: swscale_internal.h:441
AV_PIX_FMT_BGR32_1
#define AV_PIX_FMT_BGR32_1
Definition: pixfmt.h:435
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
p01x_wrapper
#define p01x_wrapper(bits, shift)
Definition: input.c:823
AV_PIX_FMT_YUV444P10LE
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:155
rgb48ToY_c_template
static av_always_inline void rgb48ToY_c_template(uint16_t *dst, const uint16_t *src, int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
Definition: input.c:132
AV_PIX_FMT_YUVA422P10LE
@ AV_PIX_FMT_YUVA422P10LE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:177
abgrToA_c
static void abgrToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:452
grayf32ToY16_c
static av_always_inline void grayf32ToY16_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, int is_be, uint32_t *unused)
Definition: input.c:1099
AV_PIX_FMT_YUV444P9BE
@ AV_PIX_FMT_YUV444P9BE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:152
AV_PIX_FMT_YUV422P10BE
@ AV_PIX_FMT_YUV422P10BE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:150
b_r
#define b_r
read_xv36le_Y_c
static void read_xv36le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:732
AV_PIX_FMT_YUV422P16LE
@ AV_PIX_FMT_YUV422P16LE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:123
AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_RGBA64
Definition: pixfmt.h:449
AV_PIX_FMT_RGB565LE
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:106
AV_PIX_FMT_GBRAPF32BE
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
Definition: pixfmt.h:340
AV_PIX_FMT_GBRAP12BE
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
Definition: pixfmt.h:307
AV_PIX_FMT_P012LE
@ AV_PIX_FMT_P012LE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:405
AV_PIX_FMT_BGR48
#define AV_PIX_FMT_BGR48
Definition: pixfmt.h:450
NULL
#define NULL
Definition: coverity.c:32
read_ya16be_alpha_c
static void read_ya16be_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:652
rgb9plus_planar_transparency_funcs
#define rgb9plus_planar_transparency_funcs(nbits)
Definition: input.c:1126
AV_PIX_FMT_YUYV422
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:67
AV_PIX_FMT_P210BE
@ AV_PIX_FMT_P210BE
interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
Definition: pixfmt.h:386
AV_PIX_FMT_RGB48LE
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:103
AV_PIX_FMT_YA16LE
@ AV_PIX_FMT_YA16LE
16 bits gray, 16 bits alpha (little-endian)
Definition: pixfmt.h:203
planar_rgb_to_a
static void planar_rgb_to_a(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused, void *opq)
Definition: input.c:971
AV_PIX_FMT_MONOBLACK
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:76
AV_PIX_FMT_YUVA422P12LE
@ AV_PIX_FMT_YUVA422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian
Definition: pixfmt.h:364
RGB48FUNCS
#define RGB48FUNCS(pattern, endianness, base_fmt)
Definition: input.c:243
nv12ToUV_c
static void nv12ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
Definition: input.c:782
AV_PIX_FMT_BGR565LE
@ AV_PIX_FMT_BGR565LE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:111
AV_PIX_FMT_RGBA64LE
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:196
read_vuyx_UV_c
static void read_vuyx_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:687
AV_PIX_FMT_YUVA444P12BE
@ AV_PIX_FMT_YUVA444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian
Definition: pixfmt.h:365
planar_rgb16_to_y
static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_src[4], int width, int bpc, int is_be, int32_t *rgb2yuv)
Definition: input.c:998
AV_PIX_FMT_YUVA444P9LE
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:173
AV_PIX_FMT_Y210LE
@ AV_PIX_FMT_Y210LE
packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian
Definition: pixfmt.h:379
yuy2ToUV_c
static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
Definition: input.c:556
AV_PIX_FMT_YUVA420P16LE
@ AV_PIX_FMT_YUVA420P16LE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:181
AV_PIX_FMT_RGB8
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:86
rgb16_32ToUV_c_template
static av_always_inline void rgb16_32ToUV_c_template(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, int32_t *rgb2yuv, int is_be)
Definition: input.c:287
palToA_c
static void palToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *pal, void *opq)
Definition: input.c:472
AV_PIX_FMT_YUV440P10LE
@ AV_PIX_FMT_YUV440P10LE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:295
av_clipf
av_clipf
Definition: af_crystalizer.c:122
palToUV_c
static void palToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *pal, void *opq)
Definition: input.c:496
AV_PIX_FMT_BGR555BE
@ AV_PIX_FMT_BGR555BE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
Definition: pixfmt.h:112
AV_PIX_FMT_YUVA420P9LE
@ AV_PIX_FMT_YUVA420P9LE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
Definition: pixfmt.h:169
read_ayuv64le_UV_c
static void read_ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:669
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
rgb48ToUV_half_c_template
static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
Definition: input.c:170
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
AV_PIX_FMT_YUV420P14LE
@ AV_PIX_FMT_YUV420P14LE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:263
AV_PIX_FMT_YUV444P14BE
@ AV_PIX_FMT_YUV444P14BE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:270
AV_PIX_FMT_BGR4_BYTE
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:85
AV_PIX_FMT_X2RGB10LE
@ AV_PIX_FMT_X2RGB10LE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:381
AV_PIX_FMT_YUV420P9BE
@ AV_PIX_FMT_YUV420P9BE
The following 12 formats have the disadvantage of needing 1 format for each bit depth.
Definition: pixfmt.h:146
AV_PIX_FMT_X2BGR10
#define AV_PIX_FMT_X2BGR10
Definition: pixfmt.h:517
isBE
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
Definition: swscale_internal.h:724
f
f
Definition: af_crystalizer.c:122
planar_rgb16_to_a
static av_always_inline void planar_rgb16_to_a(uint8_t *_dst, const uint8_t *_src[4], int width, int bpc, int is_be, int32_t *rgb2yuv)
Definition: input.c:1015
read_ya16le_gray_c
static void read_ya16le_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:628
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
RY_IDX
#define RY_IDX
Definition: swscale_internal.h:440
AV_PIX_FMT_YUV440P12LE
@ AV_PIX_FMT_YUV440P12LE
planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
Definition: pixfmt.h:297
rgbaf16_funcs_endian
#define rgbaf16_funcs_endian(endian_name, endian)
Definition: input.c:1245
shift
static int shift(int a, int b)
Definition: bonk.c:253
AV_PIX_FMT_YUV420P12BE
@ AV_PIX_FMT_YUV420P12BE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:260
AV_PIX_FMT_YUV422P10LE
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:151
AV_PIX_FMT_RGB444BE
@ AV_PIX_FMT_RGB444BE
packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:130
rgb9plus_planar_funcs
#define rgb9plus_planar_funcs(nbits)
Definition: input.c:1140
AV_PIX_FMT_YUV422P14BE
@ AV_PIX_FMT_YUV422P14BE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:266
AV_PIX_FMT_YA16BE
@ AV_PIX_FMT_YA16BE
16 bits gray, 16 bits alpha (big-endian)
Definition: pixfmt.h:202
AV_PIX_FMT_RGB48
#define AV_PIX_FMT_RGB48
Definition: pixfmt.h:445
AV_PIX_FMT_GRAY12LE
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
Definition: pixfmt.h:316
AV_PIX_FMT_BGR555
#define AV_PIX_FMT_BGR555
Definition: pixfmt.h:452
AV_PIX_FMT_GBRP9BE
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:160
AV_PIX_FMT_YUV420P10BE
@ AV_PIX_FMT_YUV420P10BE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:148
AV_PIX_FMT_RGBAF16BE
@ AV_PIX_FMT_RGBAF16BE
IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian.
Definition: pixfmt.h:400
rgb24ToUV_half_c
static void rgb24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
Definition: input.c:938
AV_PIX_FMT_NV16
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:191
palToY_c
static void palToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *pal, void *opq)
Definition: input.c:484
AV_PIX_FMT_BGR444BE
@ AV_PIX_FMT_BGR444BE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined
Definition: pixfmt.h:132
RGB2YUV_SHIFT
#define RGB2YUV_SHIFT
AV_PIX_FMT_GBRP9LE
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:161
AV_PIX_FMT_RGB32
#define AV_PIX_FMT_RGB32
Definition: pixfmt.h:432
AV_PIX_FMT_GBRAP10LE
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
Definition: pixfmt.h:311
AV_PIX_FMT_BGR565BE
@ AV_PIX_FMT_BGR565BE
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:110
av_bswap16
#define av_bswap16
Definition: bswap.h:31
AV_PIX_FMT_P012BE
@ AV_PIX_FMT_P012BE
like NV12, with 12bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:406
AV_PIX_FMT_P410LE
@ AV_PIX_FMT_P410LE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian
Definition: pixfmt.h:390
rgb24ToUV_c
static void rgb24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
Definition: input.c:919
y21xle_wrapper
#define y21xle_wrapper(bits, shift)
Definition: input.c:578
nvXXtoUV_c
static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2, const uint8_t *src, int width)
Definition: input.c:772
AV_PIX_FMT_YUVA420P10LE
@ AV_PIX_FMT_YUVA420P10LE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:175
BY_IDX
#define BY_IDX
Definition: swscale_internal.h:442
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
AV_PIX_FMT_BGRA64LE
@ AV_PIX_FMT_BGRA64LE
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:198
rgbaToA_c
static void rgbaToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:462
AV_PIX_FMT_YUVA422P10BE
@ AV_PIX_FMT_YUVA422P10BE
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:176
AV_PIX_FMT_YUVA444P12LE
@ AV_PIX_FMT_YUVA444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian
Definition: pixfmt.h:366
AV_PIX_FMT_YUVA422P9BE
@ AV_PIX_FMT_YUVA422P9BE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
Definition: pixfmt.h:170
AV_PIX_FMT_BGRA64
#define AV_PIX_FMT_BGRA64
Definition: pixfmt.h:454
AV_PIX_FMT_RGB555LE
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:108
AV_PIX_FMT_RGB48BE
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:102
lrintf
#define lrintf(x)
Definition: libm_mips.h:72
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
nv21ToUV_c
static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
Definition: input.c:789
src2
const pixel * src2
Definition: h264pred_template.c:422
AV_PIX_FMT_GRAY9BE
@ AV_PIX_FMT_GRAY9BE
Y , 9bpp, big-endian.
Definition: pixfmt.h:335
AV_PIX_FMT_NV24
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:368
AV_PIX_FMT_BGR444
#define AV_PIX_FMT_BGR444
Definition: pixfmt.h:453
read_xv36le_UV_c
static void read_xv36le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:741
av_assert1
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition: avassert.h:53
AV_PIX_FMT_RGB555
#define AV_PIX_FMT_RGB555
Definition: pixfmt.h:447
av_always_inline
#define av_always_inline
Definition: attributes.h:49
swscale_internal.h
rgb64ToY_c_template
static av_always_inline void rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
Definition: input.c:44
AV_PIX_FMT_X2RGB10
#define AV_PIX_FMT_X2RGB10
Definition: pixfmt.h:516
gbr24pToUV_half_c
static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc, int width, uint32_t *rgb2yuv, void *opq)
Definition: input.c:412
read_vuya_A_c
static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:705
AV_PIX_FMT_NV21
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:90
AV_PIX_FMT_BGR565
#define AV_PIX_FMT_BGR565
Definition: pixfmt.h:451
AV_PIX_FMT_RGB4_BYTE
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:88
AV_PIX_FMT_YUV444P16BE
@ AV_PIX_FMT_YUV444P16BE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:126
AV_PIX_FMT_GBRPF32LE
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
Definition: pixfmt.h:339
AV_PIX_FMT_NV42
@ AV_PIX_FMT_NV42
as above, but U and V bytes are swapped
Definition: pixfmt.h:369
AV_PIX_FMT_RGB565
#define AV_PIX_FMT_RGB565
Definition: pixfmt.h:446
rdpx
#define rdpx(src)
Definition: input.c:1050
AV_PIX_FMT_GBRAP16LE
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
Definition: pixfmt.h:207
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
AV_PIX_FMT_GRAY12BE
@ AV_PIX_FMT_GRAY12BE
Y , 12bpp, big-endian.
Definition: pixfmt.h:315
AV_PIX_FMT_YVYU422
@ AV_PIX_FMT_YVYU422
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
Definition: pixfmt.h:200
bswap.h
AV_PIX_FMT_NV12
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:89
AV_PIX_FMT_Y212LE
@ AV_PIX_FMT_Y212LE
packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:409
rgb64ToUV_half_c_template
static av_always_inline void rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
Definition: input.c:78
AV_PIX_FMT_P410BE
@ AV_PIX_FMT_P410BE
interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
Definition: pixfmt.h:389
AV_PIX_FMT_P016LE
@ AV_PIX_FMT_P016LE
like NV12, with 16bpp per component, little-endian
Definition: pixfmt.h:320
AV_PIX_FMT_GRAYF32BE
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
Definition: pixfmt.h:360
AV_PIX_FMT_GBRP12BE
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:272
AV_PIX_FMT_UYVY422
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:81
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
U
#define U(x)
Definition: vpx_arith.h:37
AV_PIX_FMT_YUV444P12BE
@ AV_PIX_FMT_YUV444P12BE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:268
yuy2ToY_c
static void yuy2ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:548
AV_PIX_FMT_YUV444P9LE
@ AV_PIX_FMT_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:153
read_ayuv64le_A_c
static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:679
AV_PIX_FMT_P216LE
@ AV_PIX_FMT_P216LE
interleaved chroma YUV 4:2:2, 32bpp, little-endian
Definition: pixfmt.h:393
uyvyToUV_c
static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
Definition: input.c:761
AV_PIX_FMT_YUVA420P10BE
@ AV_PIX_FMT_YUVA420P10BE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
Definition: pixfmt.h:174
AV_PIX_FMT_RGB565BE
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:105
AV_PIX_FMT_YUV420P16BE
@ AV_PIX_FMT_YUV420P16BE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:122
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
rgb48ToUV_c_template
static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
Definition: input.c:148
AV_PIX_FMT_YUV422P16BE
@ AV_PIX_FMT_YUV422P16BE
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:124
AV_PIX_FMT_GRAY16LE
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition: pixfmt.h:98
AV_PIX_FMT_X2BGR10LE
@ AV_PIX_FMT_X2BGR10LE
packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:383
AV_PIX_FMT_P010LE
@ AV_PIX_FMT_P010LE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:304
BU_IDX
#define BU_IDX
Definition: swscale_internal.h:445
AV_PIX_FMT_YUVA444P10LE
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:179
AV_PIX_FMT_BGR555LE
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:113
AV_PIX_FMT_P216BE
@ AV_PIX_FMT_P216BE
interleaved chroma YUV 4:2:2, 32bpp, big-endian
Definition: pixfmt.h:392
AV_PIX_FMT_GRAY14LE
@ AV_PIX_FMT_GRAY14LE
Y , 14bpp, little-endian.
Definition: pixfmt.h:358
rgbaf16ToY_endian
static av_always_inline void rgbaf16ToY_endian(uint16_t *dst, const uint16_t *src, int is_be, int width, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
Definition: input.c:1220
uyvyToY_c
static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused, void *opq)
Definition: input.c:753
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
AV_PIX_FMT_XV36LE
@ AV_PIX_FMT_XV36LE
packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian,...
Definition: pixfmt.h:415
AV_PIX_FMT_GRAY14BE
@ AV_PIX_FMT_GRAY14BE
Y , 14bpp, big-endian.
Definition: pixfmt.h:357
AV_PIX_FMT_YUVA422P16BE
@ AV_PIX_FMT_YUVA422P16BE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
Definition: pixfmt.h:182
AV_PIX_FMT_YUV440P10BE
@ AV_PIX_FMT_YUV440P10BE
planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
Definition: pixfmt.h:296
RGB16_32FUNCS
#define RGB16_32FUNCS(base_fmt, endianness, name, shr, shg, shb, shp, maskr, maskg, maskb, rsh, gsh, bsh, S)
Definition: input.c:388
AV_PIX_FMT_YUV422P9LE
@ AV_PIX_FMT_YUV422P9LE
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:157
AV_PIX_FMT_YUVA422P16LE
@ AV_PIX_FMT_YUVA422P16LE
planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:183
rgb16_32ToUV_half_c_template
static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, int32_t *rgb2yuv, int is_be)
Definition: input.c:315
AV_PIX_FMT_GBRP14LE
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:275
d
d
Definition: ffmpeg_filter.c:156
int32_t
int32_t
Definition: audioconvert.c:56
planar_rgb_to_uv
static void planar_rgb_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
Definition: input.c:979
bgr24ToUV_half_c
static void bgr24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
Definition: input.c:885
AV_PIX_FMT_GBRAP10BE
@ AV_PIX_FMT_GBRAP10BE
planar GBR 4:4:4:4 40bpp, big-endian
Definition: pixfmt.h:310
r_b
#define r_b
yvy2ToUV_c
static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused, void *opq)
Definition: input.c:567
GU_IDX
#define GU_IDX
Definition: swscale_internal.h:444
AV_PIX_FMT_YUVA444P16LE
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:185
AV_PIX_FMT_VUYX
@ AV_PIX_FMT_VUYX
packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined
Definition: pixfmt.h:403
AV_PIX_FMT_YUVA422P12BE
@ AV_PIX_FMT_YUVA422P12BE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian
Definition: pixfmt.h:363
SwsContext
Definition: swscale_internal.h:299
AV_PIX_FMT_BGR444LE
@ AV_PIX_FMT_BGR444LE
packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:131
AV_PIX_FMT_YUV422P12LE
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:265
AV_PIX_FMT_YUVA420P9BE
@ AV_PIX_FMT_YUVA420P9BE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
Definition: pixfmt.h:168
read_vuyx_Y_c
static void read_vuyx_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
Definition: input.c:697
rgb24ToY_c
static void rgb24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv, void *opq)
Definition: input.c:904
AV_RB16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:98
AV_PIX_FMT_BGR48BE
@ AV_PIX_FMT_BGR48BE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:138
AV_PIX_FMT_YUVA422P9LE
@ AV_PIX_FMT_YUVA422P9LE
planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
Definition: pixfmt.h:171
AV_PIX_FMT_RGB444
#define AV_PIX_FMT_RGB444
Definition: pixfmt.h:448
AV_WN16
#define AV_WN16(p, v)
Definition: intreadwrite.h:372