Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * software YUV to RGB converter | ||
3 | * | ||
4 | * Copyright (C) 2009 Konstantin Shishkov | ||
5 | * | ||
6 | * 1,4,8bpp support and context / deglobalize stuff | ||
7 | * by Michael Niedermayer (michaelni@gmx.at) | ||
8 | * | ||
9 | * This file is part of FFmpeg. | ||
10 | * | ||
11 | * FFmpeg is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU Lesser General Public | ||
13 | * License as published by the Free Software Foundation; either | ||
14 | * version 2.1 of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * FFmpeg is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | * Lesser General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU Lesser General Public | ||
22 | * License along with FFmpeg; if not, write to the Free Software | ||
23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
24 | */ | ||
25 | |||
26 | #include <stddef.h> | ||
27 | #include <stdint.h> | ||
28 | |||
29 | #include "libavutil/bswap.h" | ||
30 | #include "libavutil/mem.h" | ||
31 | #include "config.h" | ||
32 | #include "swscale.h" | ||
33 | #include "swscale_internal.h" | ||
34 | #include "libavutil/pixdesc.h" | ||
35 | |||
36 | /* Color space conversion coefficients for YCbCr -> RGB mapping. | ||
37 | * | ||
38 | * Entries are {crv, cbu, cgu, cgv} | ||
39 | * | ||
40 | * crv = (255 / 224) * 65536 * (1 - cr) / 0.5 | ||
41 | * cbu = (255 / 224) * 65536 * (1 - cb) / 0.5 | ||
42 | * cgu = (255 / 224) * 65536 * (cb / cg) * (1 - cb) / 0.5 | ||
43 | * cgv = (255 / 224) * 65536 * (cr / cg) * (1 - cr) / 0.5 | ||
44 | * | ||
45 | * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. | ||
46 | */ | ||
47 | const int32_t ff_yuv2rgb_coeffs[11][4] = { | ||
48 | { 104597, 132201, 25675, 53279 }, /* no sequence_display_extension */ | ||
49 | { 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ | ||
50 | { 104597, 132201, 25675, 53279 }, /* unspecified */ | ||
51 | { 104597, 132201, 25675, 53279 }, /* reserved */ | ||
52 | { 104448, 132798, 24759, 53109 }, /* FCC */ | ||
53 | { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */ | ||
54 | { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */ | ||
55 | { 117579, 136230, 16907, 35559 }, /* SMPTE 240M (1987) */ | ||
56 | { 0 }, /* YCgCo */ | ||
57 | { 110013, 140363, 12277, 42626 }, /* Bt-2020-NCL */ | ||
58 | { 110013, 140363, 12277, 42626 }, /* Bt-2020-CL */ | ||
59 | }; | ||
60 | |||
61 | 5141 | const int *sws_getCoefficients(int colorspace) | |
62 | { | ||
63 |
3/6✓ Branch 0 taken 5141 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 5141 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 5141 times.
|
5141 | if (colorspace > 10 || colorspace < 0 || colorspace == 8) |
64 | ✗ | colorspace = SWS_CS_DEFAULT; | |
65 | 5141 | return ff_yuv2rgb_coeffs[colorspace]; | |
66 | } | ||
67 | |||
68 | #define LOADCHROMA(i) \ | ||
69 | U = pu[i]; \ | ||
70 | V = pv[i]; \ | ||
71 | r = (void *)c->table_rV[V+YUVRGB_TABLE_HEADROOM]; \ | ||
72 | g = (void *)(c->table_gU[U+YUVRGB_TABLE_HEADROOM] + c->table_gV[V+YUVRGB_TABLE_HEADROOM]); \ | ||
73 | b = (void *)c->table_bU[U+YUVRGB_TABLE_HEADROOM]; | ||
74 | |||
75 | #define PUTRGB(dst, src, i) \ | ||
76 | Y = src[2 * i]; \ | ||
77 | dst[2 * i] = r[Y] + g[Y] + b[Y]; \ | ||
78 | Y = src[2 * i + 1]; \ | ||
79 | dst[2 * i + 1] = r[Y] + g[Y] + b[Y]; | ||
80 | |||
81 | #define PUTRGB24(dst, src, i) \ | ||
82 | Y = src[2 * i]; \ | ||
83 | dst[6 * i + 0] = r[Y]; \ | ||
84 | dst[6 * i + 1] = g[Y]; \ | ||
85 | dst[6 * i + 2] = b[Y]; \ | ||
86 | Y = src[2 * i + 1]; \ | ||
87 | dst[6 * i + 3] = r[Y]; \ | ||
88 | dst[6 * i + 4] = g[Y]; \ | ||
89 | dst[6 * i + 5] = b[Y]; | ||
90 | |||
91 | #define PUTBGR24(dst, src, i) \ | ||
92 | Y = src[2 * i]; \ | ||
93 | dst[6 * i + 0] = b[Y]; \ | ||
94 | dst[6 * i + 1] = g[Y]; \ | ||
95 | dst[6 * i + 2] = r[Y]; \ | ||
96 | Y = src[2 * i + 1]; \ | ||
97 | dst[6 * i + 3] = b[Y]; \ | ||
98 | dst[6 * i + 4] = g[Y]; \ | ||
99 | dst[6 * i + 5] = r[Y]; | ||
100 | |||
101 | #define PUTRGBA(dst, ysrc, asrc, i, s) \ | ||
102 | Y = ysrc[2 * i]; \ | ||
103 | dst[2 * i] = r[Y] + g[Y] + b[Y] + (asrc[2 * i] << s); \ | ||
104 | Y = ysrc[2 * i + 1]; \ | ||
105 | dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << s); | ||
106 | |||
107 | #define PUTRGB48(dst, src, i) \ | ||
108 | Y = src[ 2 * i]; \ | ||
109 | dst[12 * i + 0] = dst[12 * i + 1] = r[Y]; \ | ||
110 | dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \ | ||
111 | dst[12 * i + 4] = dst[12 * i + 5] = b[Y]; \ | ||
112 | Y = src[ 2 * i + 1]; \ | ||
113 | dst[12 * i + 6] = dst[12 * i + 7] = r[Y]; \ | ||
114 | dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \ | ||
115 | dst[12 * i + 10] = dst[12 * i + 11] = b[Y]; | ||
116 | |||
117 | #define PUTBGR48(dst, src, i) \ | ||
118 | Y = src[2 * i]; \ | ||
119 | dst[12 * i + 0] = dst[12 * i + 1] = b[Y]; \ | ||
120 | dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \ | ||
121 | dst[12 * i + 4] = dst[12 * i + 5] = r[Y]; \ | ||
122 | Y = src[2 * i + 1]; \ | ||
123 | dst[12 * i + 6] = dst[12 * i + 7] = b[Y]; \ | ||
124 | dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \ | ||
125 | dst[12 * i + 10] = dst[12 * i + 11] = r[Y]; | ||
126 | |||
127 | #define YUV2RGBFUNC(func_name, dst_type, alpha) \ | ||
128 | static int func_name(SwsContext *c, const uint8_t *src[], \ | ||
129 | int srcStride[], int srcSliceY, int srcSliceH, \ | ||
130 | uint8_t *dst[], int dstStride[]) \ | ||
131 | { \ | ||
132 | int y; \ | ||
133 | \ | ||
134 | if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \ | ||
135 | srcStride[1] *= 2; \ | ||
136 | srcStride[2] *= 2; \ | ||
137 | } \ | ||
138 | for (y = 0; y < srcSliceH; y += 2) { \ | ||
139 | int yd = y + srcSliceY; \ | ||
140 | dst_type *dst_1 = \ | ||
141 | (dst_type *)(dst[0] + (yd) * dstStride[0]); \ | ||
142 | dst_type *dst_2 = \ | ||
143 | (dst_type *)(dst[0] + (yd + 1) * dstStride[0]); \ | ||
144 | dst_type av_unused *r, *g, *b; \ | ||
145 | const uint8_t *py_1 = src[0] + y * srcStride[0]; \ | ||
146 | const uint8_t *py_2 = py_1 + srcStride[0]; \ | ||
147 | const uint8_t av_unused *pu = src[1] + (y >> 1) * srcStride[1]; \ | ||
148 | const uint8_t av_unused *pv = src[2] + (y >> 1) * srcStride[2]; \ | ||
149 | const uint8_t av_unused *pa_1, *pa_2; \ | ||
150 | unsigned int h_size = c->dstW >> 3; \ | ||
151 | if (alpha) { \ | ||
152 | pa_1 = src[3] + y * srcStride[3]; \ | ||
153 | pa_2 = pa_1 + srcStride[3]; \ | ||
154 | } \ | ||
155 | while (h_size--) { \ | ||
156 | int av_unused U, V, Y; \ | ||
157 | |||
158 | #define ENDYUV2RGBLINE(dst_delta, ss) \ | ||
159 | pu += 4 >> ss; \ | ||
160 | pv += 4 >> ss; \ | ||
161 | py_1 += 8 >> ss; \ | ||
162 | py_2 += 8 >> ss; \ | ||
163 | dst_1 += dst_delta >> ss; \ | ||
164 | dst_2 += dst_delta >> ss; \ | ||
165 | } \ | ||
166 | if (c->dstW & (4 >> ss)) { \ | ||
167 | int av_unused Y, U, V; \ | ||
168 | |||
169 | #define ENDYUV2RGBFUNC() \ | ||
170 | } \ | ||
171 | } \ | ||
172 | return srcSliceH; \ | ||
173 | } | ||
174 | |||
175 | #define CLOSEYUV2RGBFUNC(dst_delta) \ | ||
176 | ENDYUV2RGBLINE(dst_delta, 0) \ | ||
177 | ENDYUV2RGBFUNC() | ||
178 | |||
179 | ✗ | YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) | |
180 | ✗ | LOADCHROMA(0); | |
181 | ✗ | PUTRGB48(dst_1, py_1, 0); | |
182 | ✗ | PUTRGB48(dst_2, py_2, 0); | |
183 | |||
184 | ✗ | LOADCHROMA(1); | |
185 | ✗ | PUTRGB48(dst_2, py_2, 1); | |
186 | ✗ | PUTRGB48(dst_1, py_1, 1); | |
187 | |||
188 | ✗ | LOADCHROMA(2); | |
189 | ✗ | PUTRGB48(dst_1, py_1, 2); | |
190 | ✗ | PUTRGB48(dst_2, py_2, 2); | |
191 | |||
192 | ✗ | LOADCHROMA(3); | |
193 | ✗ | PUTRGB48(dst_2, py_2, 3); | |
194 | ✗ | PUTRGB48(dst_1, py_1, 3); | |
195 | ✗ | ENDYUV2RGBLINE(48, 0) | |
196 | ✗ | LOADCHROMA(0); | |
197 | ✗ | PUTRGB48(dst_1, py_1, 0); | |
198 | ✗ | PUTRGB48(dst_2, py_2, 0); | |
199 | |||
200 | ✗ | LOADCHROMA(1); | |
201 | ✗ | PUTRGB48(dst_2, py_2, 1); | |
202 | ✗ | PUTRGB48(dst_1, py_1, 1); | |
203 | ✗ | ENDYUV2RGBLINE(48, 1) | |
204 | ✗ | LOADCHROMA(0); | |
205 | ✗ | PUTRGB48(dst_1, py_1, 0); | |
206 | ✗ | PUTRGB48(dst_2, py_2, 0); | |
207 | ✗ | ENDYUV2RGBFUNC() | |
208 | |||
209 | ✗ | YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) | |
210 | ✗ | LOADCHROMA(0); | |
211 | ✗ | PUTBGR48(dst_1, py_1, 0); | |
212 | ✗ | PUTBGR48(dst_2, py_2, 0); | |
213 | |||
214 | ✗ | LOADCHROMA(1); | |
215 | ✗ | PUTBGR48(dst_2, py_2, 1); | |
216 | ✗ | PUTBGR48(dst_1, py_1, 1); | |
217 | |||
218 | ✗ | LOADCHROMA(2); | |
219 | ✗ | PUTBGR48(dst_1, py_1, 2); | |
220 | ✗ | PUTBGR48(dst_2, py_2, 2); | |
221 | |||
222 | ✗ | LOADCHROMA(3); | |
223 | ✗ | PUTBGR48(dst_2, py_2, 3); | |
224 | ✗ | PUTBGR48(dst_1, py_1, 3); | |
225 | ✗ | ENDYUV2RGBLINE(48, 0) | |
226 | ✗ | LOADCHROMA(0); | |
227 | ✗ | PUTBGR48(dst_1, py_1, 0); | |
228 | ✗ | PUTBGR48(dst_2, py_2, 0); | |
229 | |||
230 | ✗ | LOADCHROMA(1); | |
231 | ✗ | PUTBGR48(dst_2, py_2, 1); | |
232 | ✗ | PUTBGR48(dst_1, py_1, 1); | |
233 | ✗ | ENDYUV2RGBLINE(48, 1) | |
234 | ✗ | LOADCHROMA(0); | |
235 | ✗ | PUTBGR48(dst_1, py_1, 0); | |
236 | ✗ | PUTBGR48(dst_2, py_2, 0); | |
237 | ✗ | ENDYUV2RGBFUNC() | |
238 | |||
239 | ✗ | YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) | |
240 | ✗ | LOADCHROMA(0); | |
241 | ✗ | PUTRGB(dst_1, py_1, 0); | |
242 | ✗ | PUTRGB(dst_2, py_2, 0); | |
243 | |||
244 | ✗ | LOADCHROMA(1); | |
245 | ✗ | PUTRGB(dst_2, py_2, 1); | |
246 | ✗ | PUTRGB(dst_1, py_1, 1); | |
247 | |||
248 | ✗ | LOADCHROMA(2); | |
249 | ✗ | PUTRGB(dst_1, py_1, 2); | |
250 | ✗ | PUTRGB(dst_2, py_2, 2); | |
251 | |||
252 | ✗ | LOADCHROMA(3); | |
253 | ✗ | PUTRGB(dst_2, py_2, 3); | |
254 | ✗ | PUTRGB(dst_1, py_1, 3); | |
255 | ✗ | ENDYUV2RGBLINE(8, 0) | |
256 | ✗ | LOADCHROMA(0); | |
257 | ✗ | PUTRGB(dst_1, py_1, 0); | |
258 | ✗ | PUTRGB(dst_2, py_2, 0); | |
259 | |||
260 | ✗ | LOADCHROMA(1); | |
261 | ✗ | PUTRGB(dst_2, py_2, 1); | |
262 | ✗ | PUTRGB(dst_1, py_1, 1); | |
263 | ✗ | ENDYUV2RGBLINE(8, 1) | |
264 | ✗ | LOADCHROMA(0); | |
265 | ✗ | PUTRGB(dst_1, py_1, 0); | |
266 | ✗ | PUTRGB(dst_2, py_2, 0); | |
267 | ✗ | ENDYUV2RGBFUNC() | |
268 | |||
269 | #if HAVE_BIGENDIAN | ||
270 | YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) | ||
271 | #else | ||
272 | ✗ | YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) | |
273 | #endif | ||
274 | ✗ | LOADCHROMA(0); | |
275 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 0, 24); | |
276 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 0, 24); | |
277 | |||
278 | ✗ | LOADCHROMA(1); | |
279 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 1, 24); | |
280 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 1, 24); | |
281 | |||
282 | ✗ | LOADCHROMA(2); | |
283 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 2, 24); | |
284 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 2, 24); | |
285 | |||
286 | ✗ | LOADCHROMA(3); | |
287 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 3, 24); | |
288 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 3, 24); | |
289 | ✗ | pa_1 += 8; | |
290 | ✗ | pa_2 += 8; | |
291 | ✗ | ENDYUV2RGBLINE(8, 0) | |
292 | ✗ | LOADCHROMA(0); | |
293 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 0, 24); | |
294 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 0, 24); | |
295 | |||
296 | ✗ | LOADCHROMA(1); | |
297 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 1, 24); | |
298 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 1, 24); | |
299 | ✗ | pa_1 += 4; | |
300 | ✗ | pa_2 += 4; | |
301 | ✗ | ENDYUV2RGBLINE(8, 1) | |
302 | ✗ | LOADCHROMA(0); | |
303 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 0, 24); | |
304 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 0, 24); | |
305 | ✗ | ENDYUV2RGBFUNC() | |
306 | |||
307 | #if HAVE_BIGENDIAN | ||
308 | YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) | ||
309 | #else | ||
310 | ✗ | YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) | |
311 | #endif | ||
312 | ✗ | LOADCHROMA(0); | |
313 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 0, 0); | |
314 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 0, 0); | |
315 | |||
316 | ✗ | LOADCHROMA(1); | |
317 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 1, 0); | |
318 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 1, 0); | |
319 | |||
320 | ✗ | LOADCHROMA(2); | |
321 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 2, 0); | |
322 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 2, 0); | |
323 | |||
324 | ✗ | LOADCHROMA(3); | |
325 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 3, 0); | |
326 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 3, 0); | |
327 | ✗ | pa_1 += 8; | |
328 | ✗ | pa_2 += 8; | |
329 | ✗ | ENDYUV2RGBLINE(8, 0) | |
330 | ✗ | LOADCHROMA(0); | |
331 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 0, 0); | |
332 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 0, 0); | |
333 | |||
334 | ✗ | LOADCHROMA(1); | |
335 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 1, 0); | |
336 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 1, 0); | |
337 | ✗ | pa_1 += 4; | |
338 | ✗ | pa_2 += 4; | |
339 | ✗ | ENDYUV2RGBLINE(8, 1) | |
340 | ✗ | LOADCHROMA(0); | |
341 | ✗ | PUTRGBA(dst_1, py_1, pa_1, 0, 0); | |
342 | ✗ | PUTRGBA(dst_2, py_2, pa_2, 0, 0); | |
343 | ✗ | ENDYUV2RGBFUNC() | |
344 | |||
345 | ✗ | YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) | |
346 | ✗ | LOADCHROMA(0); | |
347 | ✗ | PUTRGB24(dst_1, py_1, 0); | |
348 | ✗ | PUTRGB24(dst_2, py_2, 0); | |
349 | |||
350 | ✗ | LOADCHROMA(1); | |
351 | ✗ | PUTRGB24(dst_2, py_2, 1); | |
352 | ✗ | PUTRGB24(dst_1, py_1, 1); | |
353 | |||
354 | ✗ | LOADCHROMA(2); | |
355 | ✗ | PUTRGB24(dst_1, py_1, 2); | |
356 | ✗ | PUTRGB24(dst_2, py_2, 2); | |
357 | |||
358 | ✗ | LOADCHROMA(3); | |
359 | ✗ | PUTRGB24(dst_2, py_2, 3); | |
360 | ✗ | PUTRGB24(dst_1, py_1, 3); | |
361 | ✗ | ENDYUV2RGBLINE(24, 0) | |
362 | ✗ | LOADCHROMA(0); | |
363 | ✗ | PUTRGB24(dst_1, py_1, 0); | |
364 | ✗ | PUTRGB24(dst_2, py_2, 0); | |
365 | |||
366 | ✗ | LOADCHROMA(1); | |
367 | ✗ | PUTRGB24(dst_2, py_2, 1); | |
368 | ✗ | PUTRGB24(dst_1, py_1, 1); | |
369 | ✗ | ENDYUV2RGBLINE(24, 1) | |
370 | ✗ | LOADCHROMA(0); | |
371 | ✗ | PUTRGB24(dst_1, py_1, 0); | |
372 | ✗ | PUTRGB24(dst_2, py_2, 0); | |
373 | ✗ | ENDYUV2RGBFUNC() | |
374 | |||
375 | // only trivial mods from yuv2rgb_c_24_rgb | ||
376 | ✗ | YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0) | |
377 | ✗ | LOADCHROMA(0); | |
378 | ✗ | PUTBGR24(dst_1, py_1, 0); | |
379 | ✗ | PUTBGR24(dst_2, py_2, 0); | |
380 | |||
381 | ✗ | LOADCHROMA(1); | |
382 | ✗ | PUTBGR24(dst_2, py_2, 1); | |
383 | ✗ | PUTBGR24(dst_1, py_1, 1); | |
384 | |||
385 | ✗ | LOADCHROMA(2); | |
386 | ✗ | PUTBGR24(dst_1, py_1, 2); | |
387 | ✗ | PUTBGR24(dst_2, py_2, 2); | |
388 | |||
389 | ✗ | LOADCHROMA(3); | |
390 | ✗ | PUTBGR24(dst_2, py_2, 3); | |
391 | ✗ | PUTBGR24(dst_1, py_1, 3); | |
392 | ✗ | ENDYUV2RGBLINE(24, 0) | |
393 | ✗ | LOADCHROMA(0); | |
394 | ✗ | PUTBGR24(dst_1, py_1, 0); | |
395 | ✗ | PUTBGR24(dst_2, py_2, 0); | |
396 | |||
397 | ✗ | LOADCHROMA(1); | |
398 | ✗ | PUTBGR24(dst_2, py_2, 1); | |
399 | ✗ | PUTBGR24(dst_1, py_1, 1); | |
400 | ✗ | ENDYUV2RGBLINE(24, 1) | |
401 | ✗ | LOADCHROMA(0); | |
402 | ✗ | PUTBGR24(dst_1, py_1, 0); | |
403 | ✗ | PUTBGR24(dst_2, py_2, 0); | |
404 | ✗ | ENDYUV2RGBFUNC() | |
405 | |||
406 | ✗ | YUV2RGBFUNC(yuv2rgb_c_16_ordered_dither, uint16_t, 0) | |
407 | ✗ | const uint8_t *d16 = ff_dither_2x2_8[y & 1]; | |
408 | ✗ | const uint8_t *e16 = ff_dither_2x2_4[y & 1]; | |
409 | ✗ | const uint8_t *f16 = ff_dither_2x2_8[(y & 1)^1]; | |
410 | |||
411 | #define PUTRGB16(dst, src, i, o) \ | ||
412 | Y = src[2 * i]; \ | ||
413 | dst[2 * i] = r[Y + d16[0 + o]] + \ | ||
414 | g[Y + e16[0 + o]] + \ | ||
415 | b[Y + f16[0 + o]]; \ | ||
416 | Y = src[2 * i + 1]; \ | ||
417 | dst[2 * i + 1] = r[Y + d16[1 + o]] + \ | ||
418 | g[Y + e16[1 + o]] + \ | ||
419 | b[Y + f16[1 + o]]; | ||
420 | ✗ | LOADCHROMA(0); | |
421 | ✗ | PUTRGB16(dst_1, py_1, 0, 0); | |
422 | ✗ | PUTRGB16(dst_2, py_2, 0, 0 + 8); | |
423 | |||
424 | ✗ | LOADCHROMA(1); | |
425 | ✗ | PUTRGB16(dst_2, py_2, 1, 2 + 8); | |
426 | ✗ | PUTRGB16(dst_1, py_1, 1, 2); | |
427 | |||
428 | ✗ | LOADCHROMA(2); | |
429 | ✗ | PUTRGB16(dst_1, py_1, 2, 4); | |
430 | ✗ | PUTRGB16(dst_2, py_2, 2, 4 + 8); | |
431 | |||
432 | ✗ | LOADCHROMA(3); | |
433 | ✗ | PUTRGB16(dst_2, py_2, 3, 6 + 8); | |
434 | ✗ | PUTRGB16(dst_1, py_1, 3, 6); | |
435 | ✗ | CLOSEYUV2RGBFUNC(8) | |
436 | |||
437 | ✗ | YUV2RGBFUNC(yuv2rgb_c_15_ordered_dither, uint16_t, 0) | |
438 | ✗ | const uint8_t *d16 = ff_dither_2x2_8[y & 1]; | |
439 | ✗ | const uint8_t *e16 = ff_dither_2x2_8[(y & 1)^1]; | |
440 | |||
441 | #define PUTRGB15(dst, src, i, o) \ | ||
442 | Y = src[2 * i]; \ | ||
443 | dst[2 * i] = r[Y + d16[0 + o]] + \ | ||
444 | g[Y + d16[1 + o]] + \ | ||
445 | b[Y + e16[0 + o]]; \ | ||
446 | Y = src[2 * i + 1]; \ | ||
447 | dst[2 * i + 1] = r[Y + d16[1 + o]] + \ | ||
448 | g[Y + d16[0 + o]] + \ | ||
449 | b[Y + e16[1 + o]]; | ||
450 | ✗ | LOADCHROMA(0); | |
451 | ✗ | PUTRGB15(dst_1, py_1, 0, 0); | |
452 | ✗ | PUTRGB15(dst_2, py_2, 0, 0 + 8); | |
453 | |||
454 | ✗ | LOADCHROMA(1); | |
455 | ✗ | PUTRGB15(dst_2, py_2, 1, 2 + 8); | |
456 | ✗ | PUTRGB15(dst_1, py_1, 1, 2); | |
457 | |||
458 | ✗ | LOADCHROMA(2); | |
459 | ✗ | PUTRGB15(dst_1, py_1, 2, 4); | |
460 | ✗ | PUTRGB15(dst_2, py_2, 2, 4 + 8); | |
461 | |||
462 | ✗ | LOADCHROMA(3); | |
463 | ✗ | PUTRGB15(dst_2, py_2, 3, 6 + 8); | |
464 | ✗ | PUTRGB15(dst_1, py_1, 3, 6); | |
465 | ✗ | CLOSEYUV2RGBFUNC(8) | |
466 | |||
467 | // r, g, b, dst_1, dst_2 | ||
468 | ✗ | YUV2RGBFUNC(yuv2rgb_c_12_ordered_dither, uint16_t, 0) | |
469 | ✗ | const uint8_t *d16 = ff_dither_4x4_16[y & 3]; | |
470 | |||
471 | #define PUTRGB12(dst, src, i, o) \ | ||
472 | Y = src[2 * i]; \ | ||
473 | dst[2 * i] = r[Y + d16[0 + o]] + \ | ||
474 | g[Y + d16[0 + o]] + \ | ||
475 | b[Y + d16[0 + o]]; \ | ||
476 | Y = src[2 * i + 1]; \ | ||
477 | dst[2 * i + 1] = r[Y + d16[1 + o]] + \ | ||
478 | g[Y + d16[1 + o]] + \ | ||
479 | b[Y + d16[1 + o]]; | ||
480 | |||
481 | ✗ | LOADCHROMA(0); | |
482 | ✗ | PUTRGB12(dst_1, py_1, 0, 0); | |
483 | ✗ | PUTRGB12(dst_2, py_2, 0, 0 + 8); | |
484 | |||
485 | ✗ | LOADCHROMA(1); | |
486 | ✗ | PUTRGB12(dst_2, py_2, 1, 2 + 8); | |
487 | ✗ | PUTRGB12(dst_1, py_1, 1, 2); | |
488 | |||
489 | ✗ | LOADCHROMA(2); | |
490 | ✗ | PUTRGB12(dst_1, py_1, 2, 4); | |
491 | ✗ | PUTRGB12(dst_2, py_2, 2, 4 + 8); | |
492 | |||
493 | ✗ | LOADCHROMA(3); | |
494 | ✗ | PUTRGB12(dst_2, py_2, 3, 6 + 8); | |
495 | ✗ | PUTRGB12(dst_1, py_1, 3, 6); | |
496 | ✗ | CLOSEYUV2RGBFUNC(8) | |
497 | |||
498 | // r, g, b, dst_1, dst_2 | ||
499 | ✗ | YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) | |
500 | ✗ | const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; | |
501 | ✗ | const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; | |
502 | |||
503 | #define PUTRGB8(dst, src, i, o) \ | ||
504 | Y = src[2 * i]; \ | ||
505 | dst[2 * i] = r[Y + d32[0 + o]] + \ | ||
506 | g[Y + d32[0 + o]] + \ | ||
507 | b[Y + d64[0 + o]]; \ | ||
508 | Y = src[2 * i + 1]; \ | ||
509 | dst[2 * i + 1] = r[Y + d32[1 + o]] + \ | ||
510 | g[Y + d32[1 + o]] + \ | ||
511 | b[Y + d64[1 + o]]; | ||
512 | |||
513 | ✗ | LOADCHROMA(0); | |
514 | ✗ | PUTRGB8(dst_1, py_1, 0, 0); | |
515 | ✗ | PUTRGB8(dst_2, py_2, 0, 0 + 8); | |
516 | |||
517 | ✗ | LOADCHROMA(1); | |
518 | ✗ | PUTRGB8(dst_2, py_2, 1, 2 + 8); | |
519 | ✗ | PUTRGB8(dst_1, py_1, 1, 2); | |
520 | |||
521 | ✗ | LOADCHROMA(2); | |
522 | ✗ | PUTRGB8(dst_1, py_1, 2, 4); | |
523 | ✗ | PUTRGB8(dst_2, py_2, 2, 4 + 8); | |
524 | |||
525 | ✗ | LOADCHROMA(3); | |
526 | ✗ | PUTRGB8(dst_2, py_2, 3, 6 + 8); | |
527 | ✗ | PUTRGB8(dst_1, py_1, 3, 6); | |
528 | |||
529 | ✗ | ENDYUV2RGBLINE(8, 0) | |
530 | ✗ | const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; | |
531 | ✗ | const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; | |
532 | ✗ | LOADCHROMA(0); | |
533 | ✗ | PUTRGB8(dst_1, py_1, 0, 0); | |
534 | ✗ | PUTRGB8(dst_2, py_2, 0, 0 + 8); | |
535 | |||
536 | ✗ | LOADCHROMA(1); | |
537 | ✗ | PUTRGB8(dst_2, py_2, 1, 2 + 8); | |
538 | ✗ | PUTRGB8(dst_1, py_1, 1, 2); | |
539 | |||
540 | ✗ | ENDYUV2RGBLINE(8, 1) | |
541 | ✗ | const uint8_t *d32 = ff_dither_8x8_32[yd & 7]; | |
542 | ✗ | const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; | |
543 | ✗ | LOADCHROMA(0); | |
544 | ✗ | PUTRGB8(dst_1, py_1, 0, 0); | |
545 | ✗ | PUTRGB8(dst_2, py_2, 0, 0 + 8); | |
546 | |||
547 | ✗ | ENDYUV2RGBFUNC() | |
548 | |||
549 | |||
550 | ✗ | YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) | |
551 | ✗ | const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; | |
552 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
553 | int acc; | ||
554 | |||
555 | #define PUTRGB4D(dst, src, i, o) \ | ||
556 | Y = src[2 * i]; \ | ||
557 | acc = r[Y + d128[0 + o]] + \ | ||
558 | g[Y + d64[0 + o]] + \ | ||
559 | b[Y + d128[0 + o]]; \ | ||
560 | Y = src[2 * i + 1]; \ | ||
561 | acc |= (r[Y + d128[1 + o]] + \ | ||
562 | g[Y + d64[1 + o]] + \ | ||
563 | b[Y + d128[1 + o]]) << 4; \ | ||
564 | dst[i] = acc; | ||
565 | |||
566 | ✗ | LOADCHROMA(0); | |
567 | ✗ | PUTRGB4D(dst_1, py_1, 0, 0); | |
568 | ✗ | PUTRGB4D(dst_2, py_2, 0, 0 + 8); | |
569 | |||
570 | ✗ | LOADCHROMA(1); | |
571 | ✗ | PUTRGB4D(dst_2, py_2, 1, 2 + 8); | |
572 | ✗ | PUTRGB4D(dst_1, py_1, 1, 2); | |
573 | |||
574 | ✗ | LOADCHROMA(2); | |
575 | ✗ | PUTRGB4D(dst_1, py_1, 2, 4); | |
576 | ✗ | PUTRGB4D(dst_2, py_2, 2, 4 + 8); | |
577 | |||
578 | ✗ | LOADCHROMA(3); | |
579 | ✗ | PUTRGB4D(dst_2, py_2, 3, 6 + 8); | |
580 | ✗ | PUTRGB4D(dst_1, py_1, 3, 6); | |
581 | |||
582 | ✗ | ENDYUV2RGBLINE(4, 0) | |
583 | ✗ | const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; | |
584 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
585 | int acc; | ||
586 | ✗ | LOADCHROMA(0); | |
587 | ✗ | PUTRGB4D(dst_1, py_1, 0, 0); | |
588 | ✗ | PUTRGB4D(dst_2, py_2, 0, 0 + 8); | |
589 | |||
590 | ✗ | LOADCHROMA(1); | |
591 | ✗ | PUTRGB4D(dst_2, py_2, 1, 2 + 8); | |
592 | ✗ | PUTRGB4D(dst_1, py_1, 1, 2); | |
593 | |||
594 | ✗ | ENDYUV2RGBLINE(4, 1) | |
595 | ✗ | const uint8_t * d64 = ff_dither_8x8_73[yd & 7]; | |
596 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
597 | int acc; | ||
598 | ✗ | LOADCHROMA(0); | |
599 | ✗ | PUTRGB4D(dst_1, py_1, 0, 0); | |
600 | ✗ | PUTRGB4D(dst_2, py_2, 0, 0 + 8); | |
601 | ✗ | ENDYUV2RGBFUNC() | |
602 | |||
603 | ✗ | YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0) | |
604 | ✗ | const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; | |
605 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
606 | |||
607 | #define PUTRGB4DB(dst, src, i, o) \ | ||
608 | Y = src[2 * i]; \ | ||
609 | dst[2 * i] = r[Y + d128[0 + o]] + \ | ||
610 | g[Y + d64[0 + o]] + \ | ||
611 | b[Y + d128[0 + o]]; \ | ||
612 | Y = src[2 * i + 1]; \ | ||
613 | dst[2 * i + 1] = r[Y + d128[1 + o]] + \ | ||
614 | g[Y + d64[1 + o]] + \ | ||
615 | b[Y + d128[1 + o]]; | ||
616 | |||
617 | ✗ | LOADCHROMA(0); | |
618 | ✗ | PUTRGB4DB(dst_1, py_1, 0, 0); | |
619 | ✗ | PUTRGB4DB(dst_2, py_2, 0, 0 + 8); | |
620 | |||
621 | ✗ | LOADCHROMA(1); | |
622 | ✗ | PUTRGB4DB(dst_2, py_2, 1, 2 + 8); | |
623 | ✗ | PUTRGB4DB(dst_1, py_1, 1, 2); | |
624 | |||
625 | ✗ | LOADCHROMA(2); | |
626 | ✗ | PUTRGB4DB(dst_1, py_1, 2, 4); | |
627 | ✗ | PUTRGB4DB(dst_2, py_2, 2, 4 + 8); | |
628 | |||
629 | ✗ | LOADCHROMA(3); | |
630 | ✗ | PUTRGB4DB(dst_2, py_2, 3, 6 + 8); | |
631 | ✗ | PUTRGB4DB(dst_1, py_1, 3, 6); | |
632 | ✗ | ENDYUV2RGBLINE(8, 0) | |
633 | ✗ | const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; | |
634 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
635 | ✗ | LOADCHROMA(0); | |
636 | ✗ | PUTRGB4DB(dst_1, py_1, 0, 0); | |
637 | ✗ | PUTRGB4DB(dst_2, py_2, 0, 0 + 8); | |
638 | |||
639 | ✗ | LOADCHROMA(1); | |
640 | ✗ | PUTRGB4DB(dst_2, py_2, 1, 2 + 8); | |
641 | ✗ | PUTRGB4DB(dst_1, py_1, 1, 2); | |
642 | ✗ | ENDYUV2RGBLINE(8, 1) | |
643 | ✗ | const uint8_t *d64 = ff_dither_8x8_73[yd & 7]; | |
644 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
645 | ✗ | LOADCHROMA(0); | |
646 | ✗ | PUTRGB4DB(dst_1, py_1, 0, 0); | |
647 | ✗ | PUTRGB4DB(dst_2, py_2, 0, 0 + 8); | |
648 | ✗ | ENDYUV2RGBFUNC() | |
649 | |||
650 | ✗ | YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0) | |
651 | ✗ | const uint8_t *d128 = ff_dither_8x8_220[yd & 7]; | |
652 | ✗ | char out_1 = 0, out_2 = 0; | |
653 | ✗ | g = c->table_gU[128 + YUVRGB_TABLE_HEADROOM] + c->table_gV[128 + YUVRGB_TABLE_HEADROOM]; | |
654 | |||
655 | #define PUTRGB1(out, src, i, o) \ | ||
656 | Y = src[2 * i]; \ | ||
657 | out += out + g[Y + d128[0 + o]]; \ | ||
658 | Y = src[2 * i + 1]; \ | ||
659 | out += out + g[Y + d128[1 + o]]; | ||
660 | |||
661 | ✗ | PUTRGB1(out_1, py_1, 0, 0); | |
662 | ✗ | PUTRGB1(out_2, py_2, 0, 0 + 8); | |
663 | |||
664 | ✗ | PUTRGB1(out_2, py_2, 1, 2 + 8); | |
665 | ✗ | PUTRGB1(out_1, py_1, 1, 2); | |
666 | |||
667 | ✗ | PUTRGB1(out_1, py_1, 2, 4); | |
668 | ✗ | PUTRGB1(out_2, py_2, 2, 4 + 8); | |
669 | |||
670 | ✗ | PUTRGB1(out_2, py_2, 3, 6 + 8); | |
671 | ✗ | PUTRGB1(out_1, py_1, 3, 6); | |
672 | |||
673 | ✗ | dst_1[0] = out_1; | |
674 | ✗ | dst_2[0] = out_2; | |
675 | ✗ | CLOSEYUV2RGBFUNC(1) | |
676 | |||
677 | ✗ | SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) | |
678 | { | ||
679 | ✗ | SwsFunc t = NULL; | |
680 | |||
681 | #if ARCH_PPC | ||
682 | t = ff_yuv2rgb_init_ppc(c); | ||
683 | #elif ARCH_X86 | ||
684 | ✗ | t = ff_yuv2rgb_init_x86(c); | |
685 | #elif ARCH_LOONGARCH64 | ||
686 | t = ff_yuv2rgb_init_loongarch(c); | ||
687 | #endif | ||
688 | |||
689 | ✗ | if (t) | |
690 | ✗ | return t; | |
691 | |||
692 | ✗ | av_log(c, AV_LOG_WARNING, | |
693 | "No accelerated colorspace conversion found from %s to %s.\n", | ||
694 | av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat)); | ||
695 | |||
696 | ✗ | switch (c->dstFormat) { | |
697 | ✗ | case AV_PIX_FMT_BGR48BE: | |
698 | case AV_PIX_FMT_BGR48LE: | ||
699 | ✗ | return yuv2rgb_c_bgr48; | |
700 | ✗ | case AV_PIX_FMT_RGB48BE: | |
701 | case AV_PIX_FMT_RGB48LE: | ||
702 | ✗ | return yuv2rgb_c_48; | |
703 | ✗ | case AV_PIX_FMT_ARGB: | |
704 | case AV_PIX_FMT_ABGR: | ||
705 | ✗ | if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) | |
706 | ✗ | return yuva2argb_c; | |
707 | case AV_PIX_FMT_RGBA: | ||
708 | case AV_PIX_FMT_BGRA: | ||
709 | ✗ | return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32; | |
710 | ✗ | case AV_PIX_FMT_RGB24: | |
711 | ✗ | return yuv2rgb_c_24_rgb; | |
712 | ✗ | case AV_PIX_FMT_BGR24: | |
713 | ✗ | return yuv2rgb_c_24_bgr; | |
714 | ✗ | case AV_PIX_FMT_RGB565: | |
715 | case AV_PIX_FMT_BGR565: | ||
716 | ✗ | return yuv2rgb_c_16_ordered_dither; | |
717 | ✗ | case AV_PIX_FMT_RGB555: | |
718 | case AV_PIX_FMT_BGR555: | ||
719 | ✗ | return yuv2rgb_c_15_ordered_dither; | |
720 | ✗ | case AV_PIX_FMT_RGB444: | |
721 | case AV_PIX_FMT_BGR444: | ||
722 | ✗ | return yuv2rgb_c_12_ordered_dither; | |
723 | ✗ | case AV_PIX_FMT_RGB8: | |
724 | case AV_PIX_FMT_BGR8: | ||
725 | ✗ | return yuv2rgb_c_8_ordered_dither; | |
726 | ✗ | case AV_PIX_FMT_RGB4: | |
727 | case AV_PIX_FMT_BGR4: | ||
728 | ✗ | return yuv2rgb_c_4_ordered_dither; | |
729 | ✗ | case AV_PIX_FMT_RGB4_BYTE: | |
730 | case AV_PIX_FMT_BGR4_BYTE: | ||
731 | ✗ | return yuv2rgb_c_4b_ordered_dither; | |
732 | ✗ | case AV_PIX_FMT_MONOBLACK: | |
733 | ✗ | return yuv2rgb_c_1_ordered_dither; | |
734 | } | ||
735 | ✗ | return NULL; | |
736 | } | ||
737 | |||
738 | 9104 | static void fill_table(uint8_t* table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, | |
739 | const int64_t inc, void *y_tab) | ||
740 | { | ||
741 | int i; | ||
742 | 9104 | uint8_t *y_table = y_tab; | |
743 | |||
744 | 9104 | y_table -= elemsize * (inc >> 9); | |
745 | |||
746 |
2/2✓ Branch 0 taken 11653120 times.
✓ Branch 1 taken 9104 times.
|
11662224 | for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) { |
747 | 11653120 | int64_t cb = av_clip_uint8(i-YUVRGB_TABLE_HEADROOM)*inc; | |
748 | 11653120 | table[i] = y_table + elemsize * (cb >> 16); | |
749 | } | ||
750 | 9104 | } | |
751 | |||
752 | 3056 | static void fill_gv_table(int table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, const int64_t inc) | |
753 | { | ||
754 | int i; | ||
755 | 3056 | int off = -(inc >> 9); | |
756 | |||
757 |
2/2✓ Branch 0 taken 3911680 times.
✓ Branch 1 taken 3056 times.
|
3914736 | for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) { |
758 | 3911680 | int64_t cb = av_clip_uint8(i-YUVRGB_TABLE_HEADROOM)*inc; | |
759 | 3911680 | table[i] = elemsize * (off + (cb >> 16)); | |
760 | } | ||
761 | 3056 | } | |
762 | |||
763 | 39396 | static uint16_t roundToInt16(int64_t f) | |
764 | { | ||
765 | 39396 | int r = (f + (1 << 15)) >> 16; | |
766 | |||
767 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 39396 times.
|
39396 | if (r < -0x7FFF) |
768 | ✗ | return 0x8000; | |
769 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 39396 times.
|
39396 | else if (r > 0x7FFF) |
770 | ✗ | return 0x7FFF; | |
771 | else | ||
772 | 39396 | return r; | |
773 | } | ||
774 | |||
775 | 3283 | av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], | |
776 | int fullRange, int brightness, | ||
777 | int contrast, int saturation) | ||
778 | { | ||
779 | 9293 | const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 || | |
780 |
2/2✓ Branch 0 taken 2693 times.
✓ Branch 1 taken 34 times.
|
2727 | c->dstFormat == AV_PIX_FMT_RGB32_1 || |
781 |
2/2✓ Branch 0 taken 2604 times.
✓ Branch 1 taken 89 times.
|
2693 | c->dstFormat == AV_PIX_FMT_BGR24 || |
782 |
2/2✓ Branch 0 taken 2590 times.
✓ Branch 1 taken 14 times.
|
2604 | c->dstFormat == AV_PIX_FMT_RGB565BE || |
783 |
2/2✓ Branch 0 taken 2572 times.
✓ Branch 1 taken 18 times.
|
2590 | c->dstFormat == AV_PIX_FMT_RGB565LE || |
784 |
2/2✓ Branch 0 taken 2558 times.
✓ Branch 1 taken 14 times.
|
2572 | c->dstFormat == AV_PIX_FMT_RGB555BE || |
785 |
2/2✓ Branch 0 taken 2533 times.
✓ Branch 1 taken 25 times.
|
2558 | c->dstFormat == AV_PIX_FMT_RGB555LE || |
786 |
2/2✓ Branch 0 taken 2521 times.
✓ Branch 1 taken 12 times.
|
2533 | c->dstFormat == AV_PIX_FMT_RGB444BE || |
787 |
2/2✓ Branch 0 taken 2509 times.
✓ Branch 1 taken 12 times.
|
2521 | c->dstFormat == AV_PIX_FMT_RGB444LE || |
788 |
1/2✓ Branch 0 taken 2509 times.
✗ Branch 1 not taken.
|
2509 | c->dstFormat == AV_PIX_FMT_X2RGB10BE || |
789 |
2/2✓ Branch 0 taken 2497 times.
✓ Branch 1 taken 12 times.
|
2509 | c->dstFormat == AV_PIX_FMT_X2RGB10LE || |
790 |
2/2✓ Branch 0 taken 2481 times.
✓ Branch 1 taken 16 times.
|
2497 | c->dstFormat == AV_PIX_FMT_RGB8 || |
791 |
1/2✓ Branch 0 taken 2481 times.
✗ Branch 1 not taken.
|
2481 | c->dstFormat == AV_PIX_FMT_RGB4 || |
792 |
4/4✓ Branch 0 taken 2727 times.
✓ Branch 1 taken 556 times.
✓ Branch 2 taken 2467 times.
✓ Branch 3 taken 14 times.
|
8477 | c->dstFormat == AV_PIX_FMT_RGB4_BYTE || |
793 |
2/2✓ Branch 0 taken 11 times.
✓ Branch 1 taken 2456 times.
|
2467 | c->dstFormat == AV_PIX_FMT_MONOBLACK; |
794 | 9835 | const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) || | |
795 |
2/2✓ Branch 0 taken 3255 times.
✓ Branch 1 taken 14 times.
|
3269 | c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) || |
796 |
2/2✓ Branch 0 taken 3243 times.
✓ Branch 1 taken 12 times.
|
3255 | c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) || |
797 |
2/2✓ Branch 0 taken 3230 times.
✓ Branch 1 taken 13 times.
|
3243 | c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) || |
798 |
2/2✓ Branch 0 taken 3217 times.
✓ Branch 1 taken 13 times.
|
3230 | c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) || |
799 |
2/2✓ Branch 0 taken 3205 times.
✓ Branch 1 taken 12 times.
|
3217 | c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE) || |
800 |
3/4✓ Branch 0 taken 3269 times.
✓ Branch 1 taken 14 times.
✓ Branch 2 taken 3205 times.
✗ Branch 3 not taken.
|
9757 | c->dstFormat == AV_PIX_FMT_NE(X2RGB10LE, X2RGB10BE) || |
801 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 3205 times.
|
3205 | c->dstFormat == AV_PIX_FMT_NE(X2BGR10LE, X2BGR10BE); |
802 | 3283 | const int bpp = c->dstFormatBpp; | |
803 | uint8_t *y_table; | ||
804 | uint16_t *y_table16; | ||
805 | uint32_t *y_table32; | ||
806 | 3283 | int i, base, rbase, gbase, bbase, av_uninit(abase), needAlpha; | |
807 |
2/2✓ Branch 0 taken 208 times.
✓ Branch 1 taken 3075 times.
|
3283 | const int yoffs = (fullRange ? 384 : 326) + YUVRGB_TABLE_LUMA_HEADROOM; |
808 | 3283 | const int table_plane_size = 1024 + 2*YUVRGB_TABLE_LUMA_HEADROOM; | |
809 | |||
810 | 3283 | int64_t crv = inv_table[0]; | |
811 | 3283 | int64_t cbu = inv_table[1]; | |
812 | 3283 | int64_t cgu = -inv_table[2]; | |
813 | 3283 | int64_t cgv = -inv_table[3]; | |
814 | 3283 | int64_t cy = 1 << 16; | |
815 | 3283 | int64_t oy = 0; | |
816 | 3283 | int64_t yb = 0; | |
817 | |||
818 |
2/2✓ Branch 0 taken 3075 times.
✓ Branch 1 taken 208 times.
|
3283 | if (!fullRange) { |
819 | 3075 | cy = (cy * 255) / 219; | |
820 | 3075 | oy = 16 << 16; | |
821 | } else { | ||
822 | 208 | crv = (crv * 224) / 255; | |
823 | 208 | cbu = (cbu * 224) / 255; | |
824 | 208 | cgu = (cgu * 224) / 255; | |
825 | 208 | cgv = (cgv * 224) / 255; | |
826 | } | ||
827 | |||
828 | 3283 | cy = (cy * contrast) >> 16; | |
829 | 3283 | crv = (crv * contrast * saturation) >> 32; | |
830 | 3283 | cbu = (cbu * contrast * saturation) >> 32; | |
831 | 3283 | cgu = (cgu * contrast * saturation) >> 32; | |
832 | 3283 | cgv = (cgv * contrast * saturation) >> 32; | |
833 | 3283 | oy -= 256 * brightness; | |
834 | |||
835 | 3283 | c->uOffset = 0x0400040004000400LL; | |
836 | 3283 | c->vOffset = 0x0400040004000400LL; | |
837 | 3283 | c->yCoeff = roundToInt16(cy * (1 << 13)) * 0x0001000100010001ULL; | |
838 | 3283 | c->vrCoeff = roundToInt16(crv * (1 << 13)) * 0x0001000100010001ULL; | |
839 | 3283 | c->ubCoeff = roundToInt16(cbu * (1 << 13)) * 0x0001000100010001ULL; | |
840 | 3283 | c->vgCoeff = roundToInt16(cgv * (1 << 13)) * 0x0001000100010001ULL; | |
841 | 3283 | c->ugCoeff = roundToInt16(cgu * (1 << 13)) * 0x0001000100010001ULL; | |
842 | 3283 | c->yOffset = roundToInt16(oy * (1 << 3)) * 0x0001000100010001ULL; | |
843 | |||
844 | 3283 | c->yuv2rgb_y_coeff = (int16_t)roundToInt16(cy * (1 << 13)); | |
845 | 3283 | c->yuv2rgb_y_offset = (int16_t)roundToInt16(oy * (1 << 9)); | |
846 | 3283 | c->yuv2rgb_v2r_coeff = (int16_t)roundToInt16(crv * (1 << 13)); | |
847 | 3283 | c->yuv2rgb_v2g_coeff = (int16_t)roundToInt16(cgv * (1 << 13)); | |
848 | 3283 | c->yuv2rgb_u2g_coeff = (int16_t)roundToInt16(cgu * (1 << 13)); | |
849 | 3283 | c->yuv2rgb_u2b_coeff = (int16_t)roundToInt16(cbu * (1 << 13)); | |
850 | |||
851 | //scale coefficients by cy | ||
852 | 3283 | crv = ((crv * (1 << 16)) + 0x8000) / FFMAX(cy, 1); | |
853 | 3283 | cbu = ((cbu * (1 << 16)) + 0x8000) / FFMAX(cy, 1); | |
854 | 3283 | cgu = ((cgu * (1 << 16)) + 0x8000) / FFMAX(cy, 1); | |
855 | 3283 | cgv = ((cgv * (1 << 16)) + 0x8000) / FFMAX(cy, 1); | |
856 | |||
857 | 3283 | av_freep(&c->yuvTable); | |
858 | |||
859 | #define ALLOC_YUV_TABLE(x) \ | ||
860 | c->yuvTable = av_malloc(x); \ | ||
861 | if (!c->yuvTable) \ | ||
862 | return AVERROR(ENOMEM); | ||
863 |
9/9✓ Branch 0 taken 32 times.
✓ Branch 1 taken 27 times.
✓ Branch 2 taken 46 times.
✓ Branch 3 taken 48 times.
✓ Branch 4 taken 127 times.
✓ Branch 5 taken 1752 times.
✓ Branch 6 taken 56 times.
✓ Branch 7 taken 968 times.
✓ Branch 8 taken 227 times.
|
3283 | switch (bpp) { |
864 | 32 | case 1: | |
865 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 32 times.
|
32 | ALLOC_YUV_TABLE(table_plane_size); |
866 | 32 | y_table = c->yuvTable; | |
867 | 32 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
868 |
2/2✓ Branch 0 taken 62016 times.
✓ Branch 1 taken 32 times.
|
62048 | for (i = 0; i < table_plane_size - 110; i++) { |
869 | 62016 | y_table[i + 110] = av_clip_uint8((yb + 0x8000) >> 16) >> 7; | |
870 | 62016 | yb += cy; | |
871 | } | ||
872 | 32 | fill_table(c->table_gU, 1, cgu, y_table + yoffs); | |
873 | 32 | fill_gv_table(c->table_gV, 1, cgv); | |
874 | 32 | break; | |
875 | 27 | case 4: | |
876 | case 4 | 128: | ||
877 |
2/2✓ Branch 0 taken 14 times.
✓ Branch 1 taken 13 times.
|
27 | rbase = isRgb ? 3 : 0; |
878 | 27 | gbase = 1; | |
879 |
2/2✓ Branch 0 taken 14 times.
✓ Branch 1 taken 13 times.
|
27 | bbase = isRgb ? 0 : 3; |
880 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
|
27 | ALLOC_YUV_TABLE(table_plane_size * 3); |
881 | 27 | y_table = c->yuvTable; | |
882 | 27 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
883 |
2/2✓ Branch 0 taken 52326 times.
✓ Branch 1 taken 27 times.
|
52353 | for (i = 0; i < table_plane_size - 110; i++) { |
884 | 52326 | int yval = av_clip_uint8((yb + 0x8000) >> 16); | |
885 | 52326 | y_table[i + 110] = (yval >> 7) << rbase; | |
886 | 52326 | y_table[i + 37 + table_plane_size] = ((yval + 43) / 85) << gbase; | |
887 | 52326 | y_table[i + 110 + 2*table_plane_size] = (yval >> 7) << bbase; | |
888 | 52326 | yb += cy; | |
889 | } | ||
890 | 27 | fill_table(c->table_rV, 1, crv, y_table + yoffs); | |
891 | 27 | fill_table(c->table_gU, 1, cgu, y_table + yoffs + table_plane_size); | |
892 | 27 | fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2*table_plane_size); | |
893 | 27 | fill_gv_table(c->table_gV, 1, cgv); | |
894 | 27 | break; | |
895 | 46 | case 8: | |
896 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 30 times.
|
46 | rbase = isRgb ? 5 : 0; |
897 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 30 times.
|
46 | gbase = isRgb ? 2 : 3; |
898 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 30 times.
|
46 | bbase = isRgb ? 0 : 6; |
899 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 46 times.
|
46 | ALLOC_YUV_TABLE(table_plane_size * 3); |
900 | 46 | y_table = c->yuvTable; | |
901 | 46 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
902 |
2/2✓ Branch 0 taken 92460 times.
✓ Branch 1 taken 46 times.
|
92506 | for (i = 0; i < table_plane_size - 38; i++) { |
903 | 92460 | int yval = av_clip_uint8((yb + 0x8000) >> 16); | |
904 | 92460 | y_table[i + 16] = ((yval + 18) / 36) << rbase; | |
905 | 92460 | y_table[i + 16 + table_plane_size] = ((yval + 18) / 36) << gbase; | |
906 | 92460 | y_table[i + 37 + 2*table_plane_size] = ((yval + 43) / 85) << bbase; | |
907 | 92460 | yb += cy; | |
908 | } | ||
909 | 46 | fill_table(c->table_rV, 1, crv, y_table + yoffs); | |
910 | 46 | fill_table(c->table_gU, 1, cgu, y_table + yoffs + table_plane_size); | |
911 | 46 | fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2*table_plane_size); | |
912 | 46 | fill_gv_table(c->table_gV, 1, cgv); | |
913 | 46 | break; | |
914 | 48 | case 12: | |
915 |
2/2✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
|
48 | rbase = isRgb ? 8 : 0; |
916 | 48 | gbase = 4; | |
917 |
2/2✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
|
48 | bbase = isRgb ? 0 : 8; |
918 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 48 times.
|
48 | ALLOC_YUV_TABLE(table_plane_size * 3 * 2); |
919 | 48 | y_table16 = c->yuvTable; | |
920 | 48 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
921 |
2/2✓ Branch 0 taken 98304 times.
✓ Branch 1 taken 48 times.
|
98352 | for (i = 0; i < table_plane_size; i++) { |
922 | 98304 | uint8_t yval = av_clip_uint8((yb + 0x8000) >> 16); | |
923 | 98304 | y_table16[i] = (yval >> 4) << rbase; | |
924 | 98304 | y_table16[i + table_plane_size] = (yval >> 4) << gbase; | |
925 | 98304 | y_table16[i + 2*table_plane_size] = (yval >> 4) << bbase; | |
926 | 98304 | yb += cy; | |
927 | } | ||
928 |
2/2✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
|
48 | if (isNotNe) |
929 |
2/2✓ Branch 0 taken 147456 times.
✓ Branch 1 taken 24 times.
|
147480 | for (i = 0; i < table_plane_size * 3; i++) |
930 | 147456 | y_table16[i] = av_bswap16(y_table16[i]); | |
931 | 48 | fill_table(c->table_rV, 2, crv, y_table16 + yoffs); | |
932 | 48 | fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + table_plane_size); | |
933 | 48 | fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2*table_plane_size); | |
934 | 48 | fill_gv_table(c->table_gV, 2, cgv); | |
935 | 48 | break; | |
936 | 127 | case 15: | |
937 | case 16: | ||
938 |
2/2✓ Branch 0 taken 71 times.
✓ Branch 1 taken 56 times.
|
127 | rbase = isRgb ? bpp - 5 : 0; |
939 | 127 | gbase = 5; | |
940 |
2/2✓ Branch 0 taken 56 times.
✓ Branch 1 taken 71 times.
|
127 | bbase = isRgb ? 0 : (bpp - 5); |
941 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 127 times.
|
127 | ALLOC_YUV_TABLE(table_plane_size * 3 * 2); |
942 | 127 | y_table16 = c->yuvTable; | |
943 | 127 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
944 |
2/2✓ Branch 0 taken 260096 times.
✓ Branch 1 taken 127 times.
|
260223 | for (i = 0; i < table_plane_size; i++) { |
945 | 260096 | uint8_t yval = av_clip_uint8((yb + 0x8000) >> 16); | |
946 | 260096 | y_table16[i] = (yval >> 3) << rbase; | |
947 | 260096 | y_table16[i + table_plane_size] = (yval >> (18 - bpp)) << gbase; | |
948 | 260096 | y_table16[i + 2*table_plane_size] = (yval >> 3) << bbase; | |
949 | 260096 | yb += cy; | |
950 | } | ||
951 |
2/2✓ Branch 0 taken 54 times.
✓ Branch 1 taken 73 times.
|
127 | if (isNotNe) |
952 |
2/2✓ Branch 0 taken 331776 times.
✓ Branch 1 taken 54 times.
|
331830 | for (i = 0; i < table_plane_size * 3; i++) |
953 | 331776 | y_table16[i] = av_bswap16(y_table16[i]); | |
954 | 127 | fill_table(c->table_rV, 2, crv, y_table16 + yoffs); | |
955 | 127 | fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + table_plane_size); | |
956 | 127 | fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2*table_plane_size); | |
957 | 127 | fill_gv_table(c->table_gV, 2, cgv); | |
958 | 127 | break; | |
959 | 1752 | case 24: | |
960 | case 48: | ||
961 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1752 times.
|
1752 | ALLOC_YUV_TABLE(table_plane_size); |
962 | 1752 | y_table = c->yuvTable; | |
963 | 1752 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
964 |
2/2✓ Branch 0 taken 3588096 times.
✓ Branch 1 taken 1752 times.
|
3589848 | for (i = 0; i < table_plane_size; i++) { |
965 | 3588096 | y_table[i] = av_clip_uint8((yb + 0x8000) >> 16); | |
966 | 3588096 | yb += cy; | |
967 | } | ||
968 | 1752 | fill_table(c->table_rV, 1, crv, y_table + yoffs); | |
969 | 1752 | fill_table(c->table_gU, 1, cgu, y_table + yoffs); | |
970 | 1752 | fill_table(c->table_bU, 1, cbu, y_table + yoffs); | |
971 | 1752 | fill_gv_table(c->table_gV, 1, cgv); | |
972 | 1752 | break; | |
973 | 56 | case 30: | |
974 |
2/2✓ Branch 0 taken 12 times.
✓ Branch 1 taken 44 times.
|
56 | rbase = isRgb ? 20 : 0; |
975 | 56 | gbase = 10; | |
976 |
2/2✓ Branch 0 taken 12 times.
✓ Branch 1 taken 44 times.
|
56 | bbase = isRgb ? 0 : 20; |
977 | 56 | needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat); | |
978 |
1/2✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
|
56 | if (!needAlpha) |
979 | 56 | abase = 30; | |
980 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 56 times.
|
56 | ALLOC_YUV_TABLE(table_plane_size * 3 * 4); |
981 | 56 | y_table32 = c->yuvTable; | |
982 | 56 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
983 |
2/2✓ Branch 0 taken 114688 times.
✓ Branch 1 taken 56 times.
|
114744 | for (i = 0; i < table_plane_size; i++) { |
984 | 114688 | unsigned yval = av_clip_uintp2((yb + 0x8000) >> 14, 10); | |
985 |
1/2✓ Branch 0 taken 114688 times.
✗ Branch 1 not taken.
|
114688 | y_table32[i]= (yval << rbase) + (needAlpha ? 0 : (255u << abase)); |
986 | 114688 | y_table32[i + table_plane_size] = yval << gbase; | |
987 | 114688 | y_table32[i + 2 * table_plane_size] = yval << bbase; | |
988 | 114688 | yb += cy; | |
989 | } | ||
990 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
|
56 | if (isNotNe) { |
991 | ✗ | for (i = 0; i < table_plane_size * 3; i++) | |
992 | ✗ | y_table32[i] = av_bswap32(y_table32[i]); | |
993 | } | ||
994 | 56 | fill_table(c->table_rV, 4, crv, y_table32 + yoffs); | |
995 | 56 | fill_table(c->table_gU, 4, cgu, y_table32 + yoffs + table_plane_size); | |
996 | 56 | fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2 * table_plane_size); | |
997 | 56 | fill_gv_table(c->table_gV, 4, cgv); | |
998 | 56 | break; | |
999 | 968 | case 32: | |
1000 | case 64: | ||
1001 | 2870 | base = (c->dstFormat == AV_PIX_FMT_RGB32_1 || | |
1002 |
4/4✓ Branch 0 taken 934 times.
✓ Branch 1 taken 34 times.
✓ Branch 2 taken 52 times.
✓ Branch 3 taken 882 times.
|
968 | c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0; |
1003 |
2/2✓ Branch 0 taken 590 times.
✓ Branch 1 taken 378 times.
|
968 | rbase = base + (isRgb ? 16 : 0); |
1004 | 968 | gbase = base + 8; | |
1005 |
2/2✓ Branch 0 taken 590 times.
✓ Branch 1 taken 378 times.
|
968 | bbase = base + (isRgb ? 0 : 16); |
1006 | 968 | needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat); | |
1007 |
2/2✓ Branch 0 taken 437 times.
✓ Branch 1 taken 531 times.
|
968 | if (!needAlpha) |
1008 | 437 | abase = (base + 24) & 31; | |
1009 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 968 times.
|
968 | ALLOC_YUV_TABLE(table_plane_size * 3 * 4); |
1010 | 968 | y_table32 = c->yuvTable; | |
1011 | 968 | yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; | |
1012 |
2/2✓ Branch 0 taken 1982464 times.
✓ Branch 1 taken 968 times.
|
1983432 | for (i = 0; i < table_plane_size; i++) { |
1013 | 1982464 | unsigned yval = av_clip_uint8((yb + 0x8000) >> 16); | |
1014 | 3964928 | y_table32[i] = (yval << rbase) + | |
1015 |
2/2✓ Branch 0 taken 894976 times.
✓ Branch 1 taken 1087488 times.
|
1982464 | (needAlpha ? 0 : (255u << abase)); |
1016 | 1982464 | y_table32[i + table_plane_size] = yval << gbase; | |
1017 | 1982464 | y_table32[i + 2*table_plane_size] = yval << bbase; | |
1018 | 1982464 | yb += cy; | |
1019 | } | ||
1020 | 968 | fill_table(c->table_rV, 4, crv, y_table32 + yoffs); | |
1021 | 968 | fill_table(c->table_gU, 4, cgu, y_table32 + yoffs + table_plane_size); | |
1022 | 968 | fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2*table_plane_size); | |
1023 | 968 | fill_gv_table(c->table_gV, 4, cgv); | |
1024 | 968 | break; | |
1025 | 227 | default: | |
1026 |
2/4✓ Branch 1 taken 227 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 227 times.
|
227 | if(!isPlanar(c->dstFormat) || bpp <= 24) |
1027 | ✗ | av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp); | |
1028 | 227 | return AVERROR(EINVAL); | |
1029 | } | ||
1030 | 3056 | return 0; | |
1031 | } | ||
1032 |