FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libswscale/input.c
Date: 2025-04-25 22:50:00
Exec Total Coverage
Lines: 1115 1391 80.2%
Functions: 202 264 76.5%
Branches: 593 846 70.1%

Line Branch Exec Source
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 <stddef.h>
23 #include <stdint.h>
24
25 #include "libavutil/bswap.h"
26 #include "libavutil/intreadwrite.h"
27 #include "libavutil/avassert.h"
28 #include "libavutil/intfloat.h"
29 #include "config.h"
30 #include "swscale_internal.h"
31
32 #define input_pixel(pos) (is_be ? AV_RB16(pos) : AV_RL16(pos))
33
34 #define IS_BE_LE 0
35 #define IS_BE_BE 1
36 #define IS_BE_ 0
37 /* ENDIAN_IDENTIFIER needs to be "BE", "LE" or "". The latter is intended
38 * for single-byte cases where the concept of endianness does not apply. */
39 #define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER
40
41 #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)
42 #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)
43
44 static av_always_inline void
45 1479 rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width,
46 enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
47 {
48 1479 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
49 int i;
50
2/2
✓ Branch 0 taken 441216 times.
✓ Branch 1 taken 1479 times.
442695 for (i = 0; i < width; i++) {
51
2/2
✓ Branch 0 taken 220032 times.
✓ Branch 1 taken 221184 times.
441216 unsigned int r_b = input_pixel(&src[i*4+0]);
52
2/2
✓ Branch 0 taken 220032 times.
✓ Branch 1 taken 221184 times.
441216 unsigned int g = input_pixel(&src[i*4+1]);
53
2/2
✓ Branch 0 taken 220032 times.
✓ Branch 1 taken 221184 times.
441216 unsigned int b_r = input_pixel(&src[i*4+2]);
54
55
12/16
✓ Branch 0 taken 441216 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 441216 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 339840 times.
✓ Branch 5 taken 101376 times.
✓ Branch 6 taken 110592 times.
✓ Branch 7 taken 229248 times.
✓ Branch 8 taken 441216 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 441216 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 339840 times.
✓ Branch 13 taken 101376 times.
✓ Branch 14 taken 110592 times.
✓ Branch 15 taken 229248 times.
441216 dst[i] = (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
56 }
57 1479 }
58
59 static av_always_inline void
60 1479 rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV,
61 const uint16_t *src1, const uint16_t *src2,
62 int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
63 {
64 int i;
65 1479 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
66 1479 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
67 av_assert1(src1==src2);
68
2/2
✓ Branch 0 taken 441216 times.
✓ Branch 1 taken 1479 times.
442695 for (i = 0; i < width; i++) {
69
2/2
✓ Branch 0 taken 220032 times.
✓ Branch 1 taken 221184 times.
441216 unsigned int r_b = input_pixel(&src1[i*4+0]);
70
2/2
✓ Branch 0 taken 220032 times.
✓ Branch 1 taken 221184 times.
441216 unsigned int g = input_pixel(&src1[i*4+1]);
71
2/2
✓ Branch 0 taken 220032 times.
✓ Branch 1 taken 221184 times.
441216 unsigned int b_r = input_pixel(&src1[i*4+2]);
72
73
12/16
✓ Branch 0 taken 441216 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 441216 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 339840 times.
✓ Branch 5 taken 101376 times.
✓ Branch 6 taken 110592 times.
✓ Branch 7 taken 229248 times.
✓ Branch 8 taken 441216 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 441216 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 339840 times.
✓ Branch 13 taken 101376 times.
✓ Branch 14 taken 110592 times.
✓ Branch 15 taken 229248 times.
441216 dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
74
12/16
✓ Branch 0 taken 441216 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 441216 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 339840 times.
✓ Branch 5 taken 101376 times.
✓ Branch 6 taken 110592 times.
✓ Branch 7 taken 229248 times.
✓ Branch 8 taken 441216 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 441216 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 339840 times.
✓ Branch 13 taken 101376 times.
✓ Branch 14 taken 110592 times.
✓ Branch 15 taken 229248 times.
441216 dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
75 }
76 1479 }
77
78 static av_always_inline void
79 rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV,
80 const uint16_t *src1, const uint16_t *src2,
81 int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be)
82 {
83 int i;
84 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
85 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
86 av_assert1(src1==src2);
87 for (i = 0; i < width; i++) {
88 unsigned r_b = (input_pixel(&src1[8 * i + 0]) + input_pixel(&src1[8 * i + 4]) + 1) >> 1;
89 unsigned g = (input_pixel(&src1[8 * i + 1]) + input_pixel(&src1[8 * i + 5]) + 1) >> 1;
90 unsigned b_r = (input_pixel(&src1[8 * i + 2]) + input_pixel(&src1[8 * i + 6]) + 1) >> 1;
91
92 dstU[i]= (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
93 dstV[i]= (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
94 }
95 }
96
97 #define RGB64FUNCS_EXT(pattern, BE_LE, origin, is_be) \
98 static void pattern ## 64 ## BE_LE ## ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, const uint8_t *unused1,\
99 int width, uint32_t *rgb2yuv, void *opq) \
100 { \
101 const uint16_t *src = (const uint16_t *) _src; \
102 uint16_t *dst = (uint16_t *) _dst; \
103 rgb64ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
104 } \
105 \
106 static void pattern ## 64 ## BE_LE ## ToUV_c(uint8_t *_dstU, uint8_t *_dstV, \
107 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
108 int width, uint32_t *rgb2yuv, void *opq) \
109 { \
110 const uint16_t *src1 = (const uint16_t *) _src1, \
111 *src2 = (const uint16_t *) _src2; \
112 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
113 rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
114 } \
115 \
116 static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, \
117 const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \
118 int width, uint32_t *rgb2yuv, void *opq) \
119 { \
120 const uint16_t *src1 = (const uint16_t *) _src1, \
121 *src2 = (const uint16_t *) _src2; \
122 uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \
123 rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
124 }
125 #define RGB64FUNCS(pattern, endianness, base_fmt) \
126 RGB64FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
127
128 1536 RGB64FUNCS(rgb, LE, AV_PIX_FMT_RGBA64)
129 1692 RGB64FUNCS(rgb, BE, AV_PIX_FMT_RGBA64)
130 1536 RGB64FUNCS(bgr, LE, AV_PIX_FMT_BGRA64)
131 1152 RGB64FUNCS(bgr, BE, AV_PIX_FMT_BGRA64)
132
133 878723 static av_always_inline void rgb48ToY_c_template(uint16_t *dst,
134 const uint16_t *src, int width,
135 enum AVPixelFormat origin,
136 int32_t *rgb2yuv, int is_be)
137 {
138 878723 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
139 int i;
140
2/2
✓ Branch 0 taken 308690504 times.
✓ Branch 1 taken 878723 times.
309569227 for (i = 0; i < width; i++) {
141
2/2
✓ Branch 0 taken 321408 times.
✓ Branch 1 taken 308369096 times.
308690504 unsigned int r_b = input_pixel(&src[i * 3 + 0]);
142
2/2
✓ Branch 0 taken 321408 times.
✓ Branch 1 taken 308369096 times.
308690504 unsigned int g = input_pixel(&src[i * 3 + 1]);
143
2/2
✓ Branch 0 taken 321408 times.
✓ Branch 1 taken 308369096 times.
308690504 unsigned int b_r = input_pixel(&src[i * 3 + 2]);
144
145
12/16
✓ Branch 0 taken 308589128 times.
✓ Branch 1 taken 101376 times.
✓ Branch 2 taken 308478536 times.
✓ Branch 3 taken 110592 times.
✓ Branch 4 taken 308478536 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 308478536 times.
✓ Branch 8 taken 308589128 times.
✓ Branch 9 taken 101376 times.
✓ Branch 10 taken 308478536 times.
✓ Branch 11 taken 110592 times.
✓ Branch 12 taken 308478536 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 308478536 times.
308690504 dst[i] = (ry*r + gy*g + by*b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
146 }
147 878723 }
148
149 486047 static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
150 uint16_t *dstV,
151 const uint16_t *src1,
152 const uint16_t *src2,
153 int width,
154 enum AVPixelFormat origin,
155 int32_t *rgb2yuv, int is_be)
156 {
157 int i;
158 486047 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
159 486047 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
160 av_assert1(src1 == src2);
161
2/2
✓ Branch 0 taken 171009152 times.
✓ Branch 1 taken 486047 times.
171495199 for (i = 0; i < width; i++) {
162
2/2
✓ Branch 0 taken 321408 times.
✓ Branch 1 taken 170687744 times.
171009152 unsigned r_b = input_pixel(&src1[i * 3 + 0]);
163
2/2
✓ Branch 0 taken 321408 times.
✓ Branch 1 taken 170687744 times.
171009152 unsigned g = input_pixel(&src1[i * 3 + 1]);
164
2/2
✓ Branch 0 taken 321408 times.
✓ Branch 1 taken 170687744 times.
171009152 unsigned b_r = input_pixel(&src1[i * 3 + 2]);
165
166
12/16
✓ Branch 0 taken 170907776 times.
✓ Branch 1 taken 101376 times.
✓ Branch 2 taken 170797184 times.
✓ Branch 3 taken 110592 times.
✓ Branch 4 taken 170797184 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 170797184 times.
✓ Branch 8 taken 170907776 times.
✓ Branch 9 taken 101376 times.
✓ Branch 10 taken 170797184 times.
✓ Branch 11 taken 110592 times.
✓ Branch 12 taken 170797184 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 170797184 times.
171009152 dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
167
12/16
✓ Branch 0 taken 170907776 times.
✓ Branch 1 taken 101376 times.
✓ Branch 2 taken 170797184 times.
✓ Branch 3 taken 110592 times.
✓ Branch 4 taken 170797184 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 170797184 times.
✓ Branch 8 taken 170907776 times.
✓ Branch 9 taken 101376 times.
✓ Branch 10 taken 170797184 times.
✓ Branch 11 taken 110592 times.
✓ Branch 12 taken 170797184 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 170797184 times.
171009152 dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
168 }
169 486047 }
170
171 401672 static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
172 uint16_t *dstV,
173 const uint16_t *src1,
174 const uint16_t *src2,
175 int width,
176 enum AVPixelFormat origin,
177 int32_t *rgb2yuv, int is_be)
178 {
179 int i;
180 401672 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
181 401672 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
182 av_assert1(src1 == src2);
183
2/2
✓ Branch 0 taken 70423972 times.
✓ Branch 1 taken 401672 times.
70825644 for (i = 0; i < width; i++) {
184
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 70423972 times.
70423972 unsigned r_b = (input_pixel(&src1[6 * i + 0]) +
185
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 70423972 times.
70423972 input_pixel(&src1[6 * i + 3]) + 1) >> 1;
186
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 70423972 times.
70423972 unsigned g = (input_pixel(&src1[6 * i + 1]) +
187
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 70423972 times.
70423972 input_pixel(&src1[6 * i + 4]) + 1) >> 1;
188
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 70423972 times.
70423972 unsigned b_r = (input_pixel(&src1[6 * i + 2]) +
189
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 70423972 times.
70423972 input_pixel(&src1[6 * i + 5]) + 1) >> 1;
190
191
8/16
✓ Branch 0 taken 70423972 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 70423972 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 70423972 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 70423972 times.
✓ Branch 8 taken 70423972 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 70423972 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 70423972 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 70423972 times.
70423972 dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
192
8/16
✓ Branch 0 taken 70423972 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 70423972 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 70423972 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 70423972 times.
✓ Branch 8 taken 70423972 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 70423972 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 70423972 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 70423972 times.
70423972 dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
193 }
194 401672 }
195
196 #undef r
197 #undef b
198 #undef input_pixel
199
200 #define RGB48FUNCS_EXT(pattern, BE_LE, origin, is_be) \
201 static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst, \
202 const uint8_t *_src, \
203 const uint8_t *unused0, const uint8_t *unused1,\
204 int width, \
205 uint32_t *rgb2yuv, \
206 void *opq) \
207 { \
208 const uint16_t *src = (const uint16_t *)_src; \
209 uint16_t *dst = (uint16_t *)_dst; \
210 rgb48ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \
211 } \
212 \
213 static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU, \
214 uint8_t *_dstV, \
215 const uint8_t *unused0, \
216 const uint8_t *_src1, \
217 const uint8_t *_src2, \
218 int width, \
219 uint32_t *rgb2yuv, \
220 void *opq) \
221 { \
222 const uint16_t *src1 = (const uint16_t *)_src1, \
223 *src2 = (const uint16_t *)_src2; \
224 uint16_t *dstU = (uint16_t *)_dstU, \
225 *dstV = (uint16_t *)_dstV; \
226 rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
227 } \
228 \
229 static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \
230 uint8_t *_dstV, \
231 const uint8_t *unused0, \
232 const uint8_t *_src1, \
233 const uint8_t *_src2, \
234 int width, \
235 uint32_t *rgb2yuv, \
236 void *opq) \
237 { \
238 const uint16_t *src1 = (const uint16_t *)_src1, \
239 *src2 = (const uint16_t *)_src2; \
240 uint16_t *dstU = (uint16_t *)_dstU, \
241 *dstV = (uint16_t *)_dstV; \
242 rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \
243 }
244 #define RGB48FUNCS(pattern, endianness, base_fmt) \
245 RGB48FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness))
246
247 3527352 RGB48FUNCS(rgb, LE, AV_PIX_FMT_RGB48)
248 2844 RGB48FUNCS(rgb, BE, AV_PIX_FMT_RGB48)
249 1536 RGB48FUNCS(bgr, LE, AV_PIX_FMT_BGR48)
250 1152 RGB48FUNCS(bgr, BE, AV_PIX_FMT_BGR48)
251
252 #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \
253 origin == AV_PIX_FMT_BGRA || \
254 origin == AV_PIX_FMT_ARGB || \
255 origin == AV_PIX_FMT_ABGR) \
256 ? AV_RN32A(&src[(i) * 4]) \
257 : ((origin == AV_PIX_FMT_X2RGB10LE || \
258 origin == AV_PIX_FMT_X2BGR10LE) \
259 ? AV_RL32(&src[(i) * 4]) \
260 : (is_be ? AV_RB16(&src[(i) * 2]) \
261 : AV_RL16(&src[(i) * 2]))))
262
263 1083338 static av_always_inline void rgb16_32ToY_c_template(int16_t *dst,
264 const uint8_t *src,
265 int width,
266 enum AVPixelFormat origin,
267 int shr, int shg,
268 int shb, int shp,
269 int maskr, int maskg,
270 int maskb, int rsh,
271 int gsh, int bsh, int S,
272 int32_t *rgb2yuv, int is_be)
273 {
274 1083338 const int ry = rgb2yuv[RY_IDX]<<rsh, gy = rgb2yuv[GY_IDX]<<gsh, by = rgb2yuv[BY_IDX]<<bsh;
275 1083338 const unsigned rnd = (32<<((S)-1)) + (1<<(S-7));
276 int i;
277
278
2/2
✓ Branch 0 taken 380846257 times.
✓ Branch 1 taken 1083338 times.
381929595 for (i = 0; i < width; i++) {
279
14/14
✓ Branch 0 taken 183813216 times.
✓ Branch 1 taken 197033041 times.
✓ Branch 2 taken 183488672 times.
✓ Branch 3 taken 324544 times.
✓ Branch 4 taken 183276512 times.
✓ Branch 5 taken 212160 times.
✓ Branch 6 taken 289728 times.
✓ Branch 7 taken 182986784 times.
✓ Branch 8 taken 159529504 times.
✓ Branch 9 taken 23457280 times.
✓ Branch 10 taken 23457280 times.
✓ Branch 11 taken 136072224 times.
✓ Branch 12 taken 608256 times.
✓ Branch 13 taken 135463968 times.
380846257 int px = input_pixel(i) >> shp;
280 380846257 int b = (px & maskb) >> shb;
281 380846257 int g = (px & maskg) >> shg;
282 380846257 int r = (px & maskr) >> shr;
283
284 380846257 dst[i] = (ry * r + gy * g + by * b + rnd) >> ((S)-6);
285 }
286 1083338 }
287
288 632440 static av_always_inline void rgb16_32ToUV_c_template(int16_t *dstU,
289 int16_t *dstV,
290 const uint8_t *src,
291 int width,
292 enum AVPixelFormat origin,
293 int shr, int shg,
294 int shb, int shp,
295 int maskr, int maskg,
296 int maskb, int rsh,
297 int gsh, int bsh, int S,
298 int32_t *rgb2yuv, int is_be)
299 {
300 632440 const int ru = rgb2yuv[RU_IDX] * (1 << rsh), gu = rgb2yuv[GU_IDX] * (1 << gsh), bu = rgb2yuv[BU_IDX] * (1 << bsh),
301 632440 rv = rgb2yuv[RV_IDX] * (1 << rsh), gv = rgb2yuv[GV_IDX] * (1 << gsh), bv = rgb2yuv[BV_IDX] * (1 << bsh);
302 632440 const unsigned rnd = (256u<<((S)-1)) + (1<<(S-7));
303 int i;
304
305
2/2
✓ Branch 0 taken 193316233 times.
✓ Branch 1 taken 632440 times.
193948673 for (i = 0; i < width; i++) {
306
13/14
✓ Branch 0 taken 106178112 times.
✓ Branch 1 taken 87138121 times.
✓ Branch 2 taken 105931392 times.
✓ Branch 3 taken 246720 times.
✓ Branch 4 taken 105719232 times.
✓ Branch 5 taken 212160 times.
✓ Branch 6 taken 212160 times.
✓ Branch 7 taken 105507072 times.
✓ Branch 8 taken 82049792 times.
✓ Branch 9 taken 23457280 times.
✓ Branch 10 taken 23457280 times.
✓ Branch 11 taken 58592512 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 58592512 times.
193316233 int px = input_pixel(i) >> shp;
307 193316233 int b = (px & maskb) >> shb;
308 193316233 int g = (px & maskg) >> shg;
309 193316233 int r = (px & maskr) >> shr;
310
311 193316233 dstU[i] = (ru * r + gu * g + bu * b + rnd) >> ((S)-6);
312 193316233 dstV[i] = (rv * r + gv * g + bv * b + rnd) >> ((S)-6);
313 }
314 632440 }
315
316 388372 static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU,
317 int16_t *dstV,
318 const uint8_t *src,
319 int width,
320 enum AVPixelFormat origin,
321 int shr, int shg,
322 int shb, int shp,
323 int maskr, int maskg,
324 int maskb, int rsh,
325 int gsh, int bsh, int S,
326 int32_t *rgb2yuv, int is_be)
327 {
328 388372 const int ru = rgb2yuv[RU_IDX] * (1 << rsh), gu = rgb2yuv[GU_IDX] * (1 << gsh), bu = rgb2yuv[BU_IDX] * (1 << bsh),
329 388372 rv = rgb2yuv[RV_IDX] * (1 << rsh), gv = rgb2yuv[GV_IDX] * (1 << gsh), bv = rgb2yuv[BV_IDX] * (1 << bsh),
330 388372 maskgx = ~(maskr | maskb);
331 388372 const unsigned rnd = (256U<<(S)) + (1<<(S-6));
332 int i;
333
334 388372 maskr |= maskr << 1;
335 388372 maskb |= maskb << 1;
336 388372 maskg |= maskg << 1;
337
2/2
✓ Branch 0 taken 84050870 times.
✓ Branch 1 taken 388372 times.
84439242 for (i = 0; i < width; i++) {
338
12/14
✓ Branch 0 taken 38827984 times.
✓ Branch 1 taken 45222886 times.
✓ Branch 2 taken 38785296 times.
✓ Branch 3 taken 42688 times.
✓ Branch 4 taken 38782160 times.
✓ Branch 5 taken 3136 times.
✓ Branch 6 taken 42304 times.
✓ Branch 7 taken 38739856 times.
✓ Branch 8 taken 38739856 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 38739856 times.
✓ Branch 12 taken 304128 times.
✓ Branch 13 taken 38435728 times.
84050870 unsigned px0 = input_pixel(2 * i + 0) >> shp;
339
12/14
✓ Branch 0 taken 38827984 times.
✓ Branch 1 taken 45222886 times.
✓ Branch 2 taken 38785296 times.
✓ Branch 3 taken 42688 times.
✓ Branch 4 taken 38782160 times.
✓ Branch 5 taken 3136 times.
✓ Branch 6 taken 42304 times.
✓ Branch 7 taken 38739856 times.
✓ Branch 8 taken 38739856 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 38739856 times.
✓ Branch 12 taken 304128 times.
✓ Branch 13 taken 38435728 times.
84050870 unsigned px1 = input_pixel(2 * i + 1) >> shp;
340 84050870 int b, r, g = (px0 & maskgx) + (px1 & maskgx);
341 84050870 int rb = px0 + px1 - g;
342
343 84050870 b = (rb & maskb) >> shb;
344
4/4
✓ Branch 0 taken 84005430 times.
✓ Branch 1 taken 45440 times.
✓ Branch 2 taken 83954742 times.
✓ Branch 3 taken 50688 times.
84050870 if (shp ||
345
4/4
✓ Branch 0 taken 83904054 times.
✓ Branch 1 taken 50688 times.
✓ Branch 2 taken 76221266 times.
✓ Branch 3 taken 7682788 times.
83954742 origin == AV_PIX_FMT_BGR565LE || origin == AV_PIX_FMT_BGR565BE ||
346
2/2
✓ Branch 0 taken 50688 times.
✓ Branch 1 taken 76170578 times.
76221266 origin == AV_PIX_FMT_RGB565LE || origin == AV_PIX_FMT_RGB565BE) {
347 7880292 g >>= shg;
348 } else {
349 76170578 g = (g & maskg) >> shg;
350 }
351 84050870 r = (rb & maskr) >> shr;
352
353 84050870 dstU[i] = (ru * r + gu * g + bu * b + (unsigned)rnd) >> ((S)-6+1);
354 84050870 dstV[i] = (rv * r + gv * g + bv * b + (unsigned)rnd) >> ((S)-6+1);
355 }
356 388372 }
357
358 #undef input_pixel
359
360 #define RGB16_32FUNCS_EXT(fmt, name, shr, shg, shb, shp, maskr, \
361 maskg, maskb, rsh, gsh, bsh, S, is_be) \
362 static void name ## ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, \
363 int width, uint32_t *tab, void *opq) \
364 { \
365 rgb16_32ToY_c_template((int16_t*)dst, src, width, fmt, shr, shg, shb, shp, \
366 maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
367 } \
368 \
369 static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
370 const uint8_t *unused0, const uint8_t *src, const uint8_t *dummy, \
371 int width, uint32_t *tab, void *opq) \
372 { \
373 rgb16_32ToUV_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
374 shr, shg, shb, shp, \
375 maskr, maskg, maskb, rsh, gsh, bsh, S, tab, is_be); \
376 } \
377 \
378 static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
379 const uint8_t *unused0, const uint8_t *src, \
380 const uint8_t *dummy, \
381 int width, uint32_t *tab, void *opq) \
382 { \
383 rgb16_32ToUV_half_c_template((int16_t*)dstU, (int16_t*)dstV, src, width, fmt, \
384 shr, shg, shb, shp, \
385 maskr, maskg, maskb, \
386 rsh, gsh, bsh, S, tab, is_be); \
387 }
388
389 #define RGB16_32FUNCS(base_fmt, endianness, name, shr, shg, shb, shp, maskr, \
390 maskg, maskb, rsh, gsh, bsh, S) \
391 RGB16_32FUNCS_EXT(base_fmt ## endianness, name, shr, shg, shb, shp, maskr, \
392 maskg, maskb, rsh, gsh, bsh, S, IS_BE(endianness))
393
394 2092478 RGB16_32FUNCS(AV_PIX_FMT_BGR32, , bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
395 2368 RGB16_32FUNCS(AV_PIX_FMT_BGR32_1, , bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
396 5900 RGB16_32FUNCS(AV_PIX_FMT_RGB32, , rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
397 3586 RGB16_32FUNCS(AV_PIX_FMT_RGB32_1, , rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
398 1152 RGB16_32FUNCS(AV_PIX_FMT_BGR565, LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
399 1152 RGB16_32FUNCS(AV_PIX_FMT_BGR555, LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
400 1152 RGB16_32FUNCS(AV_PIX_FMT_BGR444, LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
401 513664 RGB16_32FUNCS(AV_PIX_FMT_RGB565, LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
402 1045664 RGB16_32FUNCS(AV_PIX_FMT_RGB555, LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
403 1152 RGB16_32FUNCS(AV_PIX_FMT_RGB444, LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
404 1152 RGB16_32FUNCS(AV_PIX_FMT_BGR565, BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
405 1152 RGB16_32FUNCS(AV_PIX_FMT_BGR555, BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
406 1152 RGB16_32FUNCS(AV_PIX_FMT_BGR444, BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
407 1152 RGB16_32FUNCS(AV_PIX_FMT_RGB565, BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
408 1152 RGB16_32FUNCS(AV_PIX_FMT_RGB555, BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
409 1152 RGB16_32FUNCS(AV_PIX_FMT_RGB444, BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
410 266560 RGB16_32FUNCS(AV_PIX_FMT_X2RGB10, LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4, RGB2YUV_SHIFT + 6)
411 266560 RGB16_32FUNCS(AV_PIX_FMT_X2BGR10, LE, bgr30le, 0, 6, 16, 0, 0x3FF, 0xFFC00, 0x3FF00000, 4, 0, 0, RGB2YUV_SHIFT + 6)
412
413 363972 static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV,
414 const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
415 int width, uint32_t *rgb2yuv, void *opq)
416 {
417 363972 uint16_t *dstU = (uint16_t *)_dstU;
418 363972 uint16_t *dstV = (uint16_t *)_dstV;
419 363972 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
420 363972 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
421
422 int i;
423
2/2
✓ Branch 0 taken 64059072 times.
✓ Branch 1 taken 363972 times.
64423044 for (i = 0; i < width; i++) {
424 64059072 unsigned int g = gsrc[2*i] + gsrc[2*i+1];
425 64059072 unsigned int b = bsrc[2*i] + bsrc[2*i+1];
426 64059072 unsigned int r = rsrc[2*i] + rsrc[2*i+1];
427
428 64059072 dstU[i] = (ru*r + gu*g + bu*b + (0x4001<<(RGB2YUV_SHIFT-6))) >> (RGB2YUV_SHIFT-6+1);
429 64059072 dstV[i] = (rv*r + gv*g + bv*b + (0x4001<<(RGB2YUV_SHIFT-6))) >> (RGB2YUV_SHIFT-6+1);
430 }
431 363972 }
432
433 576 static void rgba64leToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
434 const uint8_t *unused2, int width, uint32_t *unused, void *opq)
435 {
436 576 int16_t *dst = (int16_t *)_dst;
437 576 const uint16_t *src = (const uint16_t *)_src;
438 int i;
439
2/2
✓ Branch 0 taken 202752 times.
✓ Branch 1 taken 576 times.
203328 for (i = 0; i < width; i++)
440 202752 dst[i] = AV_RL16(src + 4 * i + 3);
441 576 }
442
443 576 static void rgba64beToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
444 const uint8_t *unused2, int width, uint32_t *unused, void *opq)
445 {
446 576 int16_t *dst = (int16_t *)_dst;
447 576 const uint16_t *src = (const uint16_t *)_src;
448 int i;
449
2/2
✓ Branch 0 taken 202752 times.
✓ Branch 1 taken 576 times.
203328 for (i = 0; i < width; i++)
450 202752 dst[i] = AV_RB16(src + 4 * i + 3);
451 576 }
452
453 1455 static void abgrToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
454 const uint8_t *unused2, int width, uint32_t *unused, void *opq)
455 {
456 1455 int16_t *dst = (int16_t *)_dst;
457 int i;
458
2/2
✓ Branch 0 taken 483072 times.
✓ Branch 1 taken 1455 times.
484527 for (i=0; i<width; i++) {
459 483072 dst[i]= src[4*i]<<6 | src[4*i]>>2;
460 }
461 1455 }
462
463 96602 static void rgbaToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
464 const uint8_t *unused2, int width, uint32_t *unused, void *opq)
465 {
466 96602 int16_t *dst = (int16_t *)_dst;
467 int i;
468
2/2
✓ Branch 0 taken 67879432 times.
✓ Branch 1 taken 96602 times.
67976034 for (i=0; i<width; i++) {
469 67879432 dst[i]= src[4*i+3]<<6 | src[4*i+3]>>2;
470 }
471 96602 }
472
473 static void palToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
474 const uint8_t *unused2, int width, uint32_t *pal, void *opq)
475 {
476 int16_t *dst = (int16_t *)_dst;
477 int i;
478 for (i=0; i<width; i++) {
479 int d= src[i];
480
481 dst[i]= (pal[d] >> 24)<<6 | pal[d]>>26;
482 }
483 }
484
485 184760 static void palToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
486 const uint8_t *unused2, int width, uint32_t *pal, void *opq)
487 {
488 184760 int16_t *dst = (int16_t *)_dst;
489 int i;
490
2/2
✓ Branch 0 taken 63240280 times.
✓ Branch 1 taken 184760 times.
63425040 for (i = 0; i < width; i++) {
491 63240280 int d = src[i];
492
493 63240280 dst[i] = (pal[d] & 0xFF)<<6;
494 }
495 184760 }
496
497 184760 static void palToUV_c(uint8_t *_dstU, uint8_t *_dstV,
498 const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2,
499 int width, uint32_t *pal, void *opq)
500 {
501 184760 uint16_t *dstU = (uint16_t *)_dstU;
502 184760 int16_t *dstV = (int16_t *)_dstV;
503 int i;
504 av_assert1(src1 == src2);
505
2/2
✓ Branch 0 taken 63240280 times.
✓ Branch 1 taken 184760 times.
63425040 for (i = 0; i < width; i++) {
506 63240280 int p = pal[src1[i]];
507
508 63240280 dstU[i] = (uint8_t)(p>> 8)<<6;
509 63240280 dstV[i] = (uint8_t)(p>>16)<<6;
510 }
511 184760 }
512
513 103160 static void monowhite2Y_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
514 const uint8_t *unused2, int width, uint32_t *unused, void *opq)
515 {
516 103160 int16_t *dst = (int16_t *)_dst;
517 int i, j;
518 103160 width = (width + 7) >> 3;
519
2/2
✓ Branch 0 taken 4107740 times.
✓ Branch 1 taken 103160 times.
4210900 for (i = 0; i < width; i++) {
520 4107740 int d = ~src[i];
521
2/2
✓ Branch 0 taken 32861920 times.
✓ Branch 1 taken 4107740 times.
36969660 for (j = 0; j < 8; j++)
522 32861920 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
523 }
524
1/2
✓ Branch 0 taken 103160 times.
✗ Branch 1 not taken.
103160 if(width&7){
525 103160 int d= ~src[i];
526
2/2
✓ Branch 0 taken 435340 times.
✓ Branch 1 taken 103160 times.
538500 for (j = 0; j < (width&7); j++)
527 435340 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
528 }
529 103160 }
530
531 91810 static void monoblack2Y_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
532 const uint8_t *unused2, int width, uint32_t *unused, void *opq)
533 {
534 91810 int16_t *dst = (int16_t *)_dst;
535 int i, j;
536 91810 width = (width + 7) >> 3;
537
2/2
✓ Branch 0 taken 4039640 times.
✓ Branch 1 taken 91810 times.
4131450 for (i = 0; i < width; i++) {
538 4039640 int d = src[i];
539
2/2
✓ Branch 0 taken 32317120 times.
✓ Branch 1 taken 4039640 times.
36356760 for (j = 0; j < 8; j++)
540 32317120 dst[8*i+j]= ((d>>(7-j))&1) * 16383;
541 }
542
1/2
✓ Branch 0 taken 91810 times.
✗ Branch 1 not taken.
91810 if(width&7){
543 91810 int d = src[i];
544
2/2
✓ Branch 0 taken 367240 times.
✓ Branch 1 taken 91810 times.
459050 for (j = 0; j < (width&7); j++)
545 367240 dst[8*i+j] = ((d>>(7-j))&1) * 16383;
546 }
547 91810 }
548
549 184178 static void yuy2ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
550 uint32_t *unused, void *opq)
551 {
552 int i;
553
2/2
✓ Branch 0 taken 64770176 times.
✓ Branch 1 taken 184178 times.
64954354 for (i = 0; i < width; i++)
554 64770176 dst[i] = src[2 * i];
555 184178 }
556
557 91810 static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
558 const uint8_t *src2, int width, uint32_t *unused, void *opq)
559 {
560 int i;
561
2/2
✓ Branch 0 taken 16158560 times.
✓ Branch 1 taken 91810 times.
16250370 for (i = 0; i < width; i++) {
562 16158560 dstU[i] = src1[4 * i + 1];
563 16158560 dstV[i] = src1[4 * i + 3];
564 }
565 av_assert1(src1 == src2);
566 91810 }
567
568 91810 static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
569 const uint8_t *src2, int width, uint32_t *unused, void *opq)
570 {
571 int i;
572
2/2
✓ Branch 0 taken 16158560 times.
✓ Branch 1 taken 91810 times.
16250370 for (i = 0; i < width; i++) {
573 16158560 dstV[i] = src1[4 * i + 1];
574 16158560 dstU[i] = src1[4 * i + 3];
575 }
576 av_assert1(src1 == src2);
577 91810 }
578
579 #define y21xle_wrapper(bits, shift) \
580 static void y2 ## bits ## le_UV_c(uint8_t *dstU, uint8_t *dstV, \
581 const uint8_t *unused0, \
582 const uint8_t *src, \
583 const uint8_t *unused1, int width, \
584 uint32_t *unused2, void *opq) \
585 { \
586 int i; \
587 for (i = 0; i < width; i++) { \
588 AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> shift); \
589 AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> shift); \
590 } \
591 } \
592 \
593 static void y2 ## bits ## le_Y_c(uint8_t *dst, const uint8_t *src, \
594 const uint8_t *unused0, \
595 const uint8_t *unused1, int width, \
596 uint32_t *unused2, void *opq) \
597 { \
598 int i; \
599 for (i = 0; i < width; i++) \
600 AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> shift); \
601 }
602
603
2/2
✓ Branch 0 taken 48323616 times.
✓ Branch 1 taken 183044 times.
97013320 y21xle_wrapper(10, 6)
604
2/2
✓ Branch 0 taken 48323616 times.
✓ Branch 1 taken 183044 times.
97013320 y21xle_wrapper(12, 4)
605
2/2
✓ Branch 0 taken 57082080 times.
✓ Branch 1 taken 216220 times.
114596600 y21xle_wrapper(16, 0)
606
607 1587638 static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
608 uint32_t *unused, void *opq)
609 {
610 int i;
611 1587638 const uint16_t *src = (const uint16_t *)_src;
612 1587638 uint16_t *dst = (uint16_t *)_dst;
613
2/2
✓ Branch 0 taken 558788096 times.
✓ Branch 1 taken 1587638 times.
560375734 for (i = 0; i < width; i++)
614 558788096 dst[i] = av_bswap16(src[i]);
615 1587638 }
616
617 773390 static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *_src1,
618 const uint8_t *_src2, int width, uint32_t *unused, void *opq)
619 {
620 int i;
621 773390 const uint16_t *src1 = (const uint16_t *)_src1,
622 773390 *src2 = (const uint16_t *)_src2;
623 773390 uint16_t *dstU = (uint16_t *)_dstU, *dstV = (uint16_t *)_dstV;
624
2/2
✓ Branch 0 taken 192295136 times.
✓ Branch 1 taken 773390 times.
193068526 for (i = 0; i < width; i++) {
625 192295136 dstU[i] = av_bswap16(src1[i]);
626 192295136 dstV[i] = av_bswap16(src2[i]);
627 }
628 773390 }
629
630 288 static void read_ya16le_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
631 uint32_t *unused, void *opq)
632 {
633 int i;
634
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++)
635 101376 AV_WN16(dst + i * 2, AV_RL16(src + i * 4));
636 288 }
637
638 288 static void read_ya16le_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
639 uint32_t *unused, void *opq)
640 {
641 int i;
642
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++)
643 101376 AV_WN16(dst + i * 2, AV_RL16(src + i * 4 + 2));
644 288 }
645
646 558 static void read_ya16be_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
647 uint32_t *unused, void *opq)
648 {
649 int i;
650
2/2
✓ Branch 0 taken 135936 times.
✓ Branch 1 taken 558 times.
136494 for (i = 0; i < width; i++)
651 135936 AV_WN16(dst + i * 2, AV_RB16(src + i * 4));
652 558 }
653
654 288 static void read_ya16be_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
655 uint32_t *unused, void *opq)
656 {
657 int i;
658
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++)
659 101376 AV_WN16(dst + i * 2, AV_RB16(src + i * 4 + 2));
660 288 }
661
662 108398 static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
663 uint32_t *unused2, void *opq)
664 {
665 int i;
666
2/2
✓ Branch 0 taken 38156096 times.
✓ Branch 1 taken 108398 times.
38264494 for (i = 0; i < width; i++)
667 38156096 AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2));
668 108398 }
669
670 108398 static void read_ayuv64be_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
671 uint32_t *unused2, void *opq)
672 {
673 int i;
674
2/2
✓ Branch 0 taken 38156096 times.
✓ Branch 1 taken 108398 times.
38264494 for (i = 0; i < width; i++)
675 38156096 AV_WN16(dst + i * 2, AV_RB16(src + i * 8 + 2));
676 108398 }
677
678 108398 static av_always_inline void ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, int width,
679 int u_offset, int v_offset)
680 {
681 int i;
682
2/2
✓ Branch 0 taken 38156096 times.
✓ Branch 1 taken 108398 times.
38264494 for (i = 0; i < width; i++) {
683 38156096 AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + u_offset));
684 38156096 AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + v_offset));
685 }
686 108398 }
687
688 108398 static av_always_inline void ayuv64be_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, int width,
689 int u_offset, int v_offset)
690 {
691 int i;
692
2/2
✓ Branch 0 taken 38156096 times.
✓ Branch 1 taken 108398 times.
38264494 for (i = 0; i < width; i++) {
693 38156096 AV_WN16(dstU + i * 2, AV_RB16(src + i * 8 + u_offset));
694 38156096 AV_WN16(dstV + i * 2, AV_RB16(src + i * 8 + v_offset));
695 }
696 108398 }
697
698 #define ayuv64_UV_funcs(pixfmt, U, V) \
699 static void read_ ## pixfmt ## le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, \
700 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
701 { \
702 ayuv64le_UV_c(dstU, dstV, src, width, U, V); \
703 } \
704 \
705 static void read_ ## pixfmt ## be_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, \
706 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
707 { \
708 ayuv64be_UV_c(dstU, dstV, src, width, U, V); \
709 }
710
711 1152 ayuv64_UV_funcs(ayuv64, 4, 6)
712 432440 ayuv64_UV_funcs(xv48, 0, 4)
713
714 288 static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
715 uint32_t *unused2, void *opq)
716 {
717 int i;
718
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++)
719 101376 AV_WN16(dst + i * 2, AV_RL16(src + i * 8));
720 288 }
721
722 288 static void read_ayuv64be_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
723 uint32_t *unused2, void *opq)
724 {
725 int i;
726
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++)
727 101376 AV_WN16(dst + i * 2, AV_RB16(src + i * 8));
728 288 }
729
730 92098 static void read_vuyx_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
731 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
732 {
733 int i;
734
2/2
✓ Branch 0 taken 32418496 times.
✓ Branch 1 taken 92098 times.
32510594 for (i = 0; i < width; i++) {
735 32418496 dstU[i] = src[i * 4 + 1];
736 32418496 dstV[i] = src[i * 4];
737 }
738 92098 }
739
740 92098 static void read_vuyx_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
741 uint32_t *unused2, void *opq)
742 {
743 int i;
744
2/2
✓ Branch 0 taken 32418496 times.
✓ Branch 1 taken 92098 times.
32510594 for (i = 0; i < width; i++)
745 32418496 dst[i] = src[i * 4 + 2];
746 92098 }
747
748 576 static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
749 uint32_t *unused2, void *opq)
750 {
751 int i;
752
2/2
✓ Branch 0 taken 202752 times.
✓ Branch 1 taken 576 times.
203328 for (i = 0; i < width; i++)
753 202752 dst[i] = src[i * 4 + 3];
754 576 }
755
756 288 static void read_ayuv_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
757 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
758 {
759 int i;
760
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++) {
761 101376 dstU[i] = src[i * 4 + 2];
762 101376 dstV[i] = src[i * 4 + 3];
763 }
764 288 }
765
766 45476 static void read_ayuv_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
767 uint32_t *unused2, void *opq)
768 {
769 int i;
770
2/2
✓ Branch 0 taken 15466952 times.
✓ Branch 1 taken 45476 times.
15512428 for (i = 0; i < width; i++)
771 15466952 dst[i] = src[i * 4 + 1];
772 45476 }
773
774 288 static void read_ayuv_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
775 uint32_t *unused2, void *opq)
776 {
777 int i;
778
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 288 times.
101664 for (i = 0; i < width; i++)
779 101376 dst[i] = src[i * 4];
780 288 }
781
782 22738 static void read_uyva_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
783 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
784 {
785 int i;
786
2/2
✓ Branch 0 taken 7733476 times.
✓ Branch 1 taken 22738 times.
7756214 for (i = 0; i < width; i++) {
787 7733476 dstU[i] = src[i * 4];
788 7733476 dstV[i] = src[i * 4 + 2];
789 }
790 22738 }
791
792 136710 static void vyuToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
793 uint32_t *unused2, void *opq)
794 {
795 int i;
796
2/2
✓ Branch 0 taken 47581320 times.
✓ Branch 1 taken 136710 times.
47718030 for (i = 0; i < width; i++)
797 47581320 dst[i] = src[i * 3 + 1];
798 136710 }
799
800 114260 static void vyuToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
801 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
802 {
803 int i;
804
2/2
✓ Branch 0 taken 39949220 times.
✓ Branch 1 taken 114260 times.
40063480 for (i = 0; i < width; i++) {
805 39949220 dstU[i] = src[i * 3 + 2];
806 39949220 dstV[i] = src[i * 3];
807 }
808 114260 }
809
810 136693 static void read_v30xle_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
811 uint32_t *unused2, void *opq)
812 {
813 int i;
814
2/2
✓ Branch 0 taken 47549320 times.
✓ Branch 1 taken 136693 times.
47686013 for (i = 0; i < width; i++)
815 47549320 AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 12) & 0x3FFu);
816 136693 }
817
818
819 114243 static void read_v30xle_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
820 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
821 {
822 int i;
823
2/2
✓ Branch 0 taken 39917220 times.
✓ Branch 1 taken 114243 times.
40031463 for (i = 0; i < width; i++) {
824 39917220 unsigned int uv = AV_RL32(src + i * 4);
825 39917220 AV_WN16(dstU + i * 2, (uv >> 2) & 0x3FFu);
826 39917220 AV_WN16(dstV + i * 2, (uv >> 22) & 0x3FFu);
827 }
828 114243 }
829
830 91522 static void read_xv30le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
831 uint32_t *unused2, void *opq)
832 {
833 int i;
834
2/2
✓ Branch 0 taken 32215744 times.
✓ Branch 1 taken 91522 times.
32307266 for (i = 0; i < width; i++)
835 32215744 AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 10) & 0x3FFu);
836 91522 }
837
838
839 91522 static void read_xv30le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
840 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
841 {
842 int i;
843
2/2
✓ Branch 0 taken 32215744 times.
✓ Branch 1 taken 91522 times.
32307266 for (i = 0; i < width; i++) {
844 32215744 AV_WN16(dstU + i * 2, AV_RL32(src + i * 4) & 0x3FFu);
845 32215744 AV_WN16(dstV + i * 2, (AV_RL32(src + i * 4) >> 20) & 0x3FFu);
846 }
847 91522 }
848
849 91522 static void read_xv36le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
850 uint32_t *unused2, void *opq)
851 {
852 int i;
853
2/2
✓ Branch 0 taken 32215744 times.
✓ Branch 1 taken 91522 times.
32307266 for (i = 0; i < width; i++)
854 32215744 AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2) >> 4);
855 91522 }
856
857
858 91522 static void read_xv36le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
859 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
860 {
861 int i;
862
2/2
✓ Branch 0 taken 32215744 times.
✓ Branch 1 taken 91522 times.
32307266 for (i = 0; i < width; i++) {
863 32215744 AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 0) >> 4);
864 32215744 AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 4) >> 4);
865 }
866 91522 }
867
868 91522 static void read_xv36be_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
869 uint32_t *unused2, void *opq)
870 {
871 int i;
872
2/2
✓ Branch 0 taken 32215744 times.
✓ Branch 1 taken 91522 times.
32307266 for (i = 0; i < width; i++)
873 32215744 AV_WN16(dst + i * 2, AV_RB16(src + i * 8 + 2) >> 4);
874 91522 }
875
876
877 91522 static void read_xv36be_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
878 const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
879 {
880 int i;
881
2/2
✓ Branch 0 taken 32215744 times.
✓ Branch 1 taken 91522 times.
32307266 for (i = 0; i < width; i++) {
882 32215744 AV_WN16(dstU + i * 2, AV_RB16(src + i * 8 + 0) >> 4);
883 32215744 AV_WN16(dstV + i * 2, AV_RB16(src + i * 8 + 4) >> 4);
884 }
885 91522 }
886
887 /* This is almost identical to the previous, end exists only because
888 * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
889 92098 static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
890 uint32_t *unused, void *opq)
891 {
892 int i;
893
2/2
✓ Branch 0 taken 32418496 times.
✓ Branch 1 taken 92098 times.
32510594 for (i = 0; i < width; i++)
894 32418496 dst[i] = src[2 * i + 1];
895 92098 }
896
897 91810 static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
898 const uint8_t *src2, int width, uint32_t *unused, void *opq)
899 {
900 int i;
901
2/2
✓ Branch 0 taken 16158560 times.
✓ Branch 1 taken 91810 times.
16250370 for (i = 0; i < width; i++) {
902 16158560 dstU[i] = src1[4 * i + 0];
903 16158560 dstV[i] = src1[4 * i + 2];
904 }
905 av_assert1(src1 == src2);
906 91810 }
907
908 static void uyyvyyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2,
909 int width, uint32_t *unused, void *opq)
910 {
911 for (int i = 0; i < width; i++)
912 dst[i] = src[3 * (i >> 1) + 1 + (i & 1)];
913 }
914
915 static void uyyvyyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1,
916 const uint8_t *src2, int width, uint32_t *unused, void *opq)
917 {
918 for (int i = 0; i < width; i++) {
919 dstU[i] = src1[6 * i + 0];
920 dstV[i] = src1[6 * i + 3];
921 }
922 av_assert1(src1 == src2);
923 }
924
925 891954 static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2,
926 const uint8_t *src, int width)
927 {
928 int i;
929
2/2
✓ Branch 0 taken 288874080 times.
✓ Branch 1 taken 891954 times.
289766034 for (i = 0; i < width; i++) {
930 288874080 dst1[i] = src[2 * i + 0];
931 288874080 dst2[i] = src[2 * i + 1];
932 }
933 891954 }
934
935 891522 static void nv12ToUV_c(uint8_t *dstU, uint8_t *dstV,
936 const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2,
937 int width, uint32_t *unused, void *opq)
938 {
939 891522 nvXXtoUV_c(dstU, dstV, src1, width);
940 891522 }
941
942 432 static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV,
943 const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2,
944 int width, uint32_t *unused, void *opq)
945 {
946 432 nvXXtoUV_c(dstV, dstU, src1, width);
947 432 }
948
949 #define p01x_uv_wrapper(fmt, shift) \
950 static void fmt ## LEToUV ## _c(uint8_t *dstU, \
951 uint8_t *dstV, \
952 const uint8_t *unused0, \
953 const uint8_t *src1, \
954 const uint8_t *src2, int width, \
955 uint32_t *unused, void *opq) \
956 { \
957 int i; \
958 for (i = 0; i < width; i++) { \
959 AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> shift); \
960 AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> shift); \
961 } \
962 } \
963 \
964 static void fmt ## BEToUV ## _c(uint8_t *dstU, \
965 uint8_t *dstV, \
966 const uint8_t *unused0, \
967 const uint8_t *src1, \
968 const uint8_t *src2, int width, \
969 uint32_t *unused, void *opq) \
970 { \
971 int i; \
972 for (i = 0; i < width; i++) { \
973 AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> shift); \
974 AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> shift); \
975 } \
976 }
977
978 #define p01x_wrapper(fmt, shift) \
979 static void fmt ## LEToY ## _c(uint8_t *dst, \
980 const uint8_t *src, \
981 const uint8_t *unused1, \
982 const uint8_t *unused2, int width, \
983 uint32_t *unused, void *opq) \
984 { \
985 int i; \
986 for (i = 0; i < width; i++) { \
987 AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> shift); \
988 } \
989 } \
990 \
991 static void fmt ## BEToY ## _c(uint8_t *dst, \
992 const uint8_t *src, \
993 const uint8_t *unused1, \
994 const uint8_t *unused2, int width, \
995 uint32_t *unused, void *opq) \
996 { \
997 int i; \
998 for (i = 0; i < width; i++) { \
999 AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> shift); \
1000 } \
1001 } \
1002 p01x_uv_wrapper(fmt, shift)
1003
1004
2/2
✓ Branch 0 taken 304128 times.
✓ Branch 1 taken 1152 times.
610560 p01x_wrapper(nv20, 0)
1005
2/2
✓ Branch 0 taken 769392448 times.
✓ Branch 1 taken 2327776 times.
1543440448 p01x_wrapper(p010, 6)
1006
2/2
✓ Branch 0 taken 769392448 times.
✓ Branch 1 taken 2327776 times.
1543440448 p01x_wrapper(p012, 4)
1007
2/2
✓ Branch 0 taken 164971840 times.
✓ Branch 1 taken 636412 times.
331216504 p01x_uv_wrapper(p016, 0)
1008
1009 300053 static void bgr24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2,
1010 int width, uint32_t *rgb2yuv, void *opq)
1011 {
1012 300053 int16_t *dst = (int16_t *)_dst;
1013 300053 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1014 int i;
1015
2/2
✓ Branch 0 taken 102920840 times.
✓ Branch 1 taken 300053 times.
103220893 for (i = 0; i < width; i++) {
1016 102920840 int b = src[i * 3 + 0];
1017 102920840 int g = src[i * 3 + 1];
1018 102920840 int r = src[i * 3 + 2];
1019
1020 102920840 dst[i] = ((ry*r + gy*g + by*b + (32<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6));
1021 }
1022 300053 }
1023
1024 75234 static void bgr24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
1025 const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
1026 {
1027 75234 int16_t *dstU = (int16_t *)_dstU;
1028 75234 int16_t *dstV = (int16_t *)_dstV;
1029 75234 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1030 75234 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1031 int i;
1032
2/2
✓ Branch 0 taken 26487552 times.
✓ Branch 1 taken 75234 times.
26562786 for (i = 0; i < width; i++) {
1033 26487552 int b = src1[3 * i + 0];
1034 26487552 int g = src1[3 * i + 1];
1035 26487552 int r = src1[3 * i + 2];
1036
1037 26487552 dstU[i] = (ru*r + gu*g + bu*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
1038 26487552 dstV[i] = (rv*r + gv*g + bv*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
1039 }
1040 av_assert1(src1 == src2);
1041 75234 }
1042
1043 224844 static void bgr24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
1044 const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
1045 {
1046 224844 int16_t *dstU = (int16_t *)_dstU;
1047 224844 int16_t *dstV = (int16_t *)_dstV;
1048 int i;
1049 224844 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1050 224844 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1051
2/2
✓ Branch 0 taken 38222772 times.
✓ Branch 1 taken 224844 times.
38447616 for (i = 0; i < width; i++) {
1052 38222772 int b = src1[6 * i + 0] + src1[6 * i + 3];
1053 38222772 int g = src1[6 * i + 1] + src1[6 * i + 4];
1054 38222772 int r = src1[6 * i + 2] + src1[6 * i + 5];
1055
1056 38222772 dstU[i] = (ru*r + gu*g + bu*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
1057 38222772 dstV[i] = (rv*r + gv*g + bv*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
1058 }
1059 av_assert1(src1 == src2);
1060 224844 }
1061
1062 1108946 static void rgb24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
1063 uint32_t *rgb2yuv, void *opq)
1064 {
1065 1108946 int16_t *dst = (int16_t *)_dst;
1066 1108946 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1067 int i;
1068
2/2
✓ Branch 0 taken 378674332 times.
✓ Branch 1 taken 1108946 times.
379783278 for (i = 0; i < width; i++) {
1069 378674332 int r = src[i * 3 + 0];
1070 378674332 int g = src[i * 3 + 1];
1071 378674332 int b = src[i * 3 + 2];
1072
1073 378674332 dst[i] = ((ry*r + gy*g + by*b + (32<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6));
1074 }
1075 1108946 }
1076
1077 468323 static void rgb24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
1078 const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
1079 {
1080 468323 int16_t *dstU = (int16_t *)_dstU;
1081 468323 int16_t *dstV = (int16_t *)_dstV;
1082 int i;
1083 468323 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1084 468323 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1085 av_assert1(src1 == src2);
1086
2/2
✓ Branch 0 taken 164718676 times.
✓ Branch 1 taken 468323 times.
165186999 for (i = 0; i < width; i++) {
1087 164718676 int r = src1[3 * i + 0];
1088 164718676 int g = src1[3 * i + 1];
1089 164718676 int b = src1[3 * i + 2];
1090
1091 164718676 dstU[i] = (ru*r + gu*g + bu*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
1092 164718676 dstV[i] = (rv*r + gv*g + bv*b + (256<<(RGB2YUV_SHIFT-1)) + (1<<(RGB2YUV_SHIFT-7)))>>(RGB2YUV_SHIFT-6);
1093 }
1094 468323 }
1095
1096 654276 static void rgb24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1,
1097 const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq)
1098 {
1099 654276 int16_t *dstU = (int16_t *)_dstU;
1100 654276 int16_t *dstV = (int16_t *)_dstV;
1101 int i;
1102 654276 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1103 654276 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1104 av_assert1(src1 == src2);
1105
2/2
✓ Branch 0 taken 108830484 times.
✓ Branch 1 taken 654276 times.
109484760 for (i = 0; i < width; i++) {
1106 108830484 int r = src1[6 * i + 0] + src1[6 * i + 3];
1107 108830484 int g = src1[6 * i + 1] + src1[6 * i + 4];
1108 108830484 int b = src1[6 * i + 2] + src1[6 * i + 5];
1109
1110 108830484 dstU[i] = (ru*r + gu*g + bu*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
1111 108830484 dstV[i] = (rv*r + gv*g + bv*b + (256<<RGB2YUV_SHIFT) + (1<<(RGB2YUV_SHIFT-6)))>>(RGB2YUV_SHIFT-5);
1112 }
1113 654276 }
1114
1115 747984 static void planar_rgb_to_y(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
1116 {
1117 747984 uint16_t *dst = (uint16_t *)_dst;
1118 747984 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1119 int i;
1120
2/2
✓ Branch 0 taken 262998528 times.
✓ Branch 1 taken 747984 times.
263746512 for (i = 0; i < width; i++) {
1121 262998528 int g = src[0][i];
1122 262998528 int b = src[1][i];
1123 262998528 int r = src[2][i];
1124
1125 262998528 dst[i] = (ry*r + gy*g + by*b + (0x801<<(RGB2YUV_SHIFT-7))) >> (RGB2YUV_SHIFT-6);
1126 }
1127 747984 }
1128
1129 561 static void planar_rgb_to_a(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused, void *opq)
1130 {
1131 561 uint16_t *dst = (uint16_t *)_dst;
1132 int i;
1133
2/2
✓ Branch 0 taken 122952 times.
✓ Branch 1 taken 561 times.
123513 for (i = 0; i < width; i++)
1134 122952 dst[i] = src[3][i] << 6;
1135 561 }
1136
1137 385808 static void planar_rgb_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq)
1138 {
1139 385808 uint16_t *dstU = (uint16_t *)_dstU;
1140 385808 uint16_t *dstV = (uint16_t *)_dstV;
1141 385808 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1142 385808 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1143 int i;
1144
2/2
✓ Branch 0 taken 135512576 times.
✓ Branch 1 taken 385808 times.
135898384 for (i = 0; i < width; i++) {
1145 135512576 int g = src[0][i];
1146 135512576 int b = src[1][i];
1147 135512576 int r = src[2][i];
1148
1149 135512576 dstU[i] = (ru*r + gu*g + bu*b + (0x4001<<(RGB2YUV_SHIFT-7))) >> (RGB2YUV_SHIFT-6);
1150 135512576 dstV[i] = (rv*r + gv*g + bv*b + (0x4001<<(RGB2YUV_SHIFT-7))) >> (RGB2YUV_SHIFT-6);
1151 }
1152 385808 }
1153
1154 #define rdpx(src) \
1155 (is_be ? AV_RB16(src) : AV_RL16(src))
1156 2131732 static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_src[4],
1157 int width, int bpc, int is_be, int32_t *rgb2yuv)
1158 {
1159 int i;
1160 2131732 const uint16_t **src = (const uint16_t **)_src;
1161 2131732 uint16_t *dst = (uint16_t *)_dst;
1162 2131732 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1163
2/2
✓ Branch 0 taken 1761872 times.
✓ Branch 1 taken 369860 times.
2131732 int shift = bpc < 16 ? bpc : 14;
1164
2/2
✓ Branch 0 taken 749178064 times.
✓ Branch 1 taken 2131732 times.
751309796 for (i = 0; i < width; i++) {
1165
2/2
✓ Branch 0 taken 85637824 times.
✓ Branch 1 taken 663540240 times.
749178064 int g = rdpx(src[0] + i);
1166
2/2
✓ Branch 0 taken 85637824 times.
✓ Branch 1 taken 663540240 times.
749178064 int b = rdpx(src[1] + i);
1167
2/2
✓ Branch 0 taken 85637824 times.
✓ Branch 1 taken 663540240 times.
749178064 int r = rdpx(src[2] + i);
1168
1169 749178064 dst[i] = (ry*r + gy*g + by*b + (16 << (RGB2YUV_SHIFT + bpc - 8)) + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14);
1170 }
1171 2131732 }
1172
1173 2412 static av_always_inline void planar_rgb16_to_a(uint8_t *_dst, const uint8_t *_src[4],
1174 int width, int bpc, int is_be, int32_t *rgb2yuv)
1175 {
1176 int i;
1177 2412 const uint16_t **src = (const uint16_t **)_src;
1178 2412 uint16_t *dst = (uint16_t *)_dst;
1179
2/2
✓ Branch 0 taken 1800 times.
✓ Branch 1 taken 612 times.
2412 int shift = bpc < 16 ? bpc : 14;
1180
1181
2/2
✓ Branch 0 taken 830304 times.
✓ Branch 1 taken 2412 times.
832716 for (i = 0; i < width; i++) {
1182
2/2
✓ Branch 0 taken 415152 times.
✓ Branch 1 taken 415152 times.
830304 dst[i] = rdpx(src[3] + i) << (14 - shift);
1183 }
1184 2412 }
1185
1186 2129042 static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
1187 const uint8_t *_src[4], int width,
1188 int bpc, int is_be, int32_t *rgb2yuv)
1189 {
1190 int i;
1191 2129042 const uint16_t **src = (const uint16_t **)_src;
1192 2129042 uint16_t *dstU = (uint16_t *)_dstU;
1193 2129042 uint16_t *dstV = (uint16_t *)_dstV;
1194 2129042 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1195 2129042 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1196
2/2
✓ Branch 0 taken 1779864 times.
✓ Branch 1 taken 349178 times.
2129042 int shift = bpc < 16 ? bpc : 14;
1197
2/2
✓ Branch 0 taken 748501484 times.
✓ Branch 1 taken 2129042 times.
750630526 for (i = 0; i < width; i++) {
1198
2/2
✓ Branch 0 taken 85637824 times.
✓ Branch 1 taken 662863660 times.
748501484 int g = rdpx(src[0] + i);
1199
2/2
✓ Branch 0 taken 85637824 times.
✓ Branch 1 taken 662863660 times.
748501484 int b = rdpx(src[1] + i);
1200
2/2
✓ Branch 0 taken 85637824 times.
✓ Branch 1 taken 662863660 times.
748501484 int r = rdpx(src[2] + i);
1201
1202 748501484 dstU[i] = (ru*r + gu*g + bu*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14);
1203 748501484 dstV[i] = (rv*r + gv*g + bv*b + (128 << (RGB2YUV_SHIFT + bpc - 8)) + (1 << (RGB2YUV_SHIFT + shift - 15))) >> (RGB2YUV_SHIFT + shift - 14);
1204 }
1205 2129042 }
1206 #undef rdpx
1207
1208 #define rdpx(src) (is_be ? av_int2float(AV_RB32(src)): av_int2float(AV_RL32(src)))
1209
1210 612 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)
1211 {
1212 int i;
1213 612 const float **src = (const float **)_src;
1214 612 uint16_t *dst = (uint16_t *)_dst;
1215
1216
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 612 times.
209796 for (i = 0; i < width; i++) {
1217
2/2
✓ Branch 0 taken 104592 times.
✓ Branch 1 taken 104592 times.
209184 dst[i] = lrintf(av_clipf(65535.0f * rdpx(src[3] + i), 0.0f, 65535.0f));
1218 }
1219 612 }
1220
1221 1224 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)
1222 {
1223 int i;
1224 1224 const float **src = (const float **)_src;
1225 1224 uint16_t *dstU = (uint16_t *)_dstU;
1226 1224 uint16_t *dstV = (uint16_t *)_dstV;
1227 1224 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1228 1224 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1229
1230
2/2
✓ Branch 0 taken 418368 times.
✓ Branch 1 taken 1224 times.
419592 for (i = 0; i < width; i++) {
1231
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 209184 times.
418368 int g = lrintf(av_clipf(65535.0f * rdpx(src[0] + i), 0.0f, 65535.0f));
1232
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 209184 times.
418368 int b = lrintf(av_clipf(65535.0f * rdpx(src[1] + i), 0.0f, 65535.0f));
1233
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 209184 times.
418368 int r = lrintf(av_clipf(65535.0f * rdpx(src[2] + i), 0.0f, 65535.0f));
1234
1235 418368 dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1236 418368 dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1237 }
1238 1224 }
1239
1240 1224 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)
1241 {
1242 int i;
1243 1224 const float **src = (const float **)_src;
1244 1224 uint16_t *dst = (uint16_t *)_dst;
1245
1246 1224 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1247
1248
2/2
✓ Branch 0 taken 418368 times.
✓ Branch 1 taken 1224 times.
419592 for (i = 0; i < width; i++) {
1249
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 209184 times.
418368 int g = lrintf(av_clipf(65535.0f * rdpx(src[0] + i), 0.0f, 65535.0f));
1250
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 209184 times.
418368 int b = lrintf(av_clipf(65535.0f * rdpx(src[1] + i), 0.0f, 65535.0f));
1251
2/2
✓ Branch 0 taken 209184 times.
✓ Branch 1 taken 209184 times.
418368 int r = lrintf(av_clipf(65535.0f * rdpx(src[2] + i), 0.0f, 65535.0f));
1252
1253 418368 dst[i] = (ry*r + gy*g + by*b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1254 }
1255 1224 }
1256
1257 static av_always_inline void rgbf32_to_uv_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused1,
1258 const uint8_t *_src, const uint8_t *unused2,
1259 int width, int is_be, int32_t *rgb2yuv)
1260 {
1261 int i;
1262 const float *src = (const float *)_src;
1263 uint16_t *dstU = (uint16_t *)_dstU;
1264 uint16_t *dstV = (uint16_t *)_dstV;
1265 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1266 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1267
1268 for (i = 0; i < width; i++) {
1269 int r = lrintf(av_clipf(65535.0f * rdpx(&src[3*i]), 0.0f, 65535.0f));
1270 int g = lrintf(av_clipf(65535.0f * rdpx(&src[3*i + 1]), 0.0f, 65535.0f));
1271 int b = lrintf(av_clipf(65535.0f * rdpx(&src[3*i + 2]), 0.0f, 65535.0f));
1272
1273 dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1274 dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1275 }
1276 }
1277
1278 static av_always_inline void rgbf32_to_y_c(uint8_t *_dst, const uint8_t *_src,
1279 const uint8_t *unused1, const uint8_t *unused2,
1280 int width, int is_be, int32_t *rgb2yuv)
1281 {
1282 int i;
1283 const float *src = (const float *)_src;
1284 uint16_t *dst = (uint16_t *)_dst;
1285
1286 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1287
1288 for (i = 0; i < width; i++) {
1289 int r = lrintf(av_clipf(65535.0f * rdpx(&src[3*i]), 0.0f, 65535.0f));
1290 int g = lrintf(av_clipf(65535.0f * rdpx(&src[3*i + 1]), 0.0f, 65535.0f));
1291 int b = lrintf(av_clipf(65535.0f * rdpx(&src[3*i + 2]), 0.0f, 65535.0f));
1292
1293 dst[i] = (ry*r + gy*g + by*b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
1294 }
1295 }
1296
1297 576 static av_always_inline void grayf32ToY16_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
1298 const uint8_t *unused2, int width, int is_be, uint32_t *unused)
1299 {
1300 int i;
1301 576 const float *src = (const float *)_src;
1302 576 uint16_t *dst = (uint16_t *)_dst;
1303
1304
2/2
✓ Branch 0 taken 202752 times.
✓ Branch 1 taken 576 times.
203328 for (i = 0; i < width; ++i){
1305
2/2
✓ Branch 0 taken 101376 times.
✓ Branch 1 taken 101376 times.
202752 dst[i] = lrintf(av_clipf(65535.0f * rdpx(src + i), 0.0f, 65535.0f));
1306 }
1307 576 }
1308
1309 static av_always_inline void read_yaf32_gray_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
1310 const uint8_t *unused2, int width, int is_be, uint32_t *unused)
1311 {
1312 int i;
1313 const float *src = (const float *)_src;
1314 uint16_t *dst = (uint16_t *)_dst;
1315
1316 for (i = 0; i < width; ++i)
1317 dst[i] = lrintf(av_clipf(65535.0f * rdpx(src + i*2), 0.0f, 65535.0f));
1318 }
1319
1320 static av_always_inline void read_yaf32_alpha_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
1321 const uint8_t *unused2, int width, int is_be, uint32_t *unused)
1322 {
1323 int i;
1324 const float *src = (const float *)_src;
1325 uint16_t *dst = (uint16_t *)_dst;
1326
1327 for (i = 0; i < width; ++i)
1328 dst[i] = lrintf(av_clipf(65535.0f * rdpx(src + i*2 + 1), 0.0f, 65535.0f));
1329 }
1330
1331 #undef rdpx
1332
1333 #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
1334 static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1335 int w, int32_t *rgb2yuv, void *opq) \
1336 { \
1337 planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
1338 } \
1339 static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1340 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1341 void *opq) \
1342 { \
1343 planar_rgb16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \
1344 } \
1345
1346 #define rgb9plus_planar_transparency_funcs(nbits) \
1347 static void planar_rgb##nbits##le_to_a(uint8_t *dst, const uint8_t *src[4], \
1348 int w, int32_t *rgb2yuv, \
1349 void *opq) \
1350 { \
1351 planar_rgb16_to_a(dst, src, w, nbits, 0, rgb2yuv); \
1352 } \
1353 static void planar_rgb##nbits##be_to_a(uint8_t *dst, const uint8_t *src[4], \
1354 int w, int32_t *rgb2yuv, \
1355 void *opq) \
1356 { \
1357 planar_rgb16_to_a(dst, src, w, nbits, 1, rgb2yuv); \
1358 }
1359
1360 #define rgb9plus_planar_funcs(nbits) \
1361 rgb9plus_planar_funcs_endian(nbits, le, 0) \
1362 rgb9plus_planar_funcs_endian(nbits, be, 1)
1363
1364 2448 rgb9plus_planar_funcs(9)
1365 3627936 rgb9plus_planar_funcs(10)
1366 3448336 rgb9plus_planar_funcs(12)
1367 4752 rgb9plus_planar_funcs(14)
1368 1438076 rgb9plus_planar_funcs(16)
1369
1370 1224 rgb9plus_planar_transparency_funcs(10)
1371 1224 rgb9plus_planar_transparency_funcs(12)
1372 1152 rgb9plus_planar_transparency_funcs(14)
1373 1224 rgb9plus_planar_transparency_funcs(16)
1374
1375 #define rgbf32_funcs_endian(endian_name, endian) \
1376 static void planar_rgbf32##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1377 int w, int32_t *rgb2yuv, void *opq) \
1378 { \
1379 planar_rgbf32_to_y(dst, src, w, endian, rgb2yuv); \
1380 } \
1381 static void planar_rgbf32##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1382 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1383 void *opq) \
1384 { \
1385 planar_rgbf32_to_uv(dstU, dstV, src, w, endian, rgb2yuv); \
1386 } \
1387 static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1388 int w, int32_t *rgb2yuv, void *opq) \
1389 { \
1390 planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \
1391 } \
1392 static void rgbf32##endian_name##_to_y_c(uint8_t *dst, const uint8_t *src, \
1393 const uint8_t *unused1, const uint8_t *unused2, \
1394 int w, uint32_t *rgb2yuv, void *opq) \
1395 { \
1396 rgbf32_to_y_c(dst, src, unused1, unused2, w, endian, rgb2yuv); \
1397 } \
1398 static void rgbf32##endian_name##_to_uv_c(uint8_t *dstU, uint8_t *dstV, \
1399 const uint8_t *unused1, \
1400 const uint8_t *src, const uint8_t *unused2, \
1401 int w, uint32_t *rgb2yuv, \
1402 void *opq) \
1403 { \
1404 rgbf32_to_uv_c(dstU, dstV, unused1, src, unused2, w, endian, rgb2yuv); \
1405 } \
1406 static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1407 const uint8_t *unused1, const uint8_t *unused2, \
1408 int width, uint32_t *unused, void *opq) \
1409 { \
1410 grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \
1411 } \
1412 static void read_yaf32##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \
1413 const uint8_t *unused1, const uint8_t *unused2, \
1414 int width, uint32_t *unused, void *opq) \
1415 { \
1416 read_yaf32_gray_c(dst, src, unused1, unused2, width, endian, unused); \
1417 } \
1418 static void read_yaf32##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \
1419 const uint8_t *unused1, const uint8_t *unused2, \
1420 int width, uint32_t *unused, void *opq) \
1421 { \
1422 read_yaf32_alpha_c(dst, src, unused1, unused2, width, endian, unused); \
1423 }
1424
1425 3636 rgbf32_funcs_endian(le, 0)
1426 3636 rgbf32_funcs_endian(be, 1)
1427
1428 #define rdpx(src) av_int2float(half2float(is_be ? AV_RB16(&src) : AV_RL16(&src), h2f_tbl))
1429 #define rdpx2(src) av_int2float(half2float(is_be ? AV_RB16(src) : AV_RL16(src), h2f_tbl))
1430
1431 3121 static av_always_inline void planar_rgbf16_to_a(uint8_t *dst, const uint8_t *src[4], int width, int is_be, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1432 {
1433 int i;
1434
1435
2/2
✓ Branch 0 taken 1859160 times.
✓ Branch 1 taken 3121 times.
1862281 for (i = 0; i < width; i++) {
1436
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1859160 times.
1859160 AV_WN16(dst + 2*i, lrintf(av_clipf(65535.0f * rdpx2(src[3] + 2*i), 0.0f, 65535.0f)));
1437 }
1438 3121 }
1439
1440 6612 static av_always_inline void planar_rgbf16_to_uv(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], int width, int is_be, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1441 {
1442 int i;
1443 6612 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1444 6612 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1445
1446
2/2
✓ Branch 0 taken 3537889 times.
✓ Branch 1 taken 6612 times.
3544501 for (i = 0; i < width; i++) {
1447
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3537889 times.
3537889 int g = lrintf(av_clipf(65535.0f * rdpx2(src[0] + 2*i), 0.0f, 65535.0f));
1448
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3537889 times.
3537889 int b = lrintf(av_clipf(65535.0f * rdpx2(src[1] + 2*i), 0.0f, 65535.0f));
1449
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3537889 times.
3537889 int r = lrintf(av_clipf(65535.0f * rdpx2(src[2] + 2*i), 0.0f, 65535.0f));
1450
1451 3537889 AV_WN16(dstU + 2*i, (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
1452 3537889 AV_WN16(dstV + 2*i, (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
1453 }
1454 6612 }
1455
1456 6612 static av_always_inline void planar_rgbf16_to_y(uint8_t *dst, const uint8_t *src[4], int width, int is_be, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1457 {
1458 int i;
1459
1460 6612 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1461
1462
2/2
✓ Branch 0 taken 3537889 times.
✓ Branch 1 taken 6612 times.
3544501 for (i = 0; i < width; i++) {
1463
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3537889 times.
3537889 int g = lrintf(av_clipf(65535.0f * rdpx2(src[0] + 2*i), 0.0f, 65535.0f));
1464
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3537889 times.
3537889 int b = lrintf(av_clipf(65535.0f * rdpx2(src[1] + 2*i), 0.0f, 65535.0f));
1465
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3537889 times.
3537889 int r = lrintf(av_clipf(65535.0f * rdpx2(src[2] + 2*i), 0.0f, 65535.0f));
1466
1467 3537889 AV_WN16(dst + 2*i, (ry*r + gy*g + by*b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
1468 }
1469 6612 }
1470
1471 24 static av_always_inline void grayf16ToY16_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1,
1472 const uint8_t *unused2, int width, int is_be, uint32_t *unused, Half2FloatTables *h2f_tbl)
1473 {
1474 int i;
1475
1476
2/2
✓ Branch 0 taken 288 times.
✓ Branch 1 taken 24 times.
312 for (i = 0; i < width; ++i){
1477
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 288 times.
288 AV_WN16(dst + 2*i, lrintf(av_clipf(65535.0f * rdpx2(src + 2*i), 0.0f, 65535.0f)));
1478 }
1479 24 }
1480
1481 12 static av_always_inline void read_yaf16_gray_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
1482 const uint8_t *unused2, int width, int is_be, uint32_t *unused, Half2FloatTables *h2f_tbl)
1483 {
1484 12 uint16_t *dst = (uint16_t *)_dst;
1485
1486
2/2
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 12 times.
156 for (int i = 0; i < width; i++)
1487
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 144 times.
144 dst[i] = lrintf(av_clipf(65535.0f * rdpx2(src + 4*i), 0.0f, 65535.0f));
1488 12 }
1489
1490 12 static av_always_inline void read_yaf16_alpha_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1,
1491 const uint8_t *unused2, int width, int is_be, uint32_t *unused, Half2FloatTables *h2f_tbl)
1492 {
1493 12 uint16_t *dst = (uint16_t *)_dst;
1494
1495
2/2
✓ Branch 0 taken 144 times.
✓ Branch 1 taken 12 times.
156 for (int i = 0; i < width; i++)
1496
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 144 times.
144 dst[i] = lrintf(av_clipf(65535.0f * rdpx2(src + 4*i + 2), 0.0f, 65535.0f));
1497 12 }
1498
1499 static av_always_inline void rgbaf16ToUV_half_endian(uint16_t *dstU, uint16_t *dstV, int is_be,
1500 const uint16_t *src, int width,
1501 int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1502 {
1503 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1504 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1505 int i;
1506 for (i = 0; i < width; i++) {
1507 int r = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+0]), 0.0f, 65535.0f)) +
1508 lrintf(av_clipf(65535.0f * rdpx(src[i*8+4]), 0.0f, 65535.0f))) >> 1;
1509 int g = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+1]), 0.0f, 65535.0f)) +
1510 lrintf(av_clipf(65535.0f * rdpx(src[i*8+5]), 0.0f, 65535.0f))) >> 1;
1511 int b = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+2]), 0.0f, 65535.0f)) +
1512 lrintf(av_clipf(65535.0f * rdpx(src[i*8+6]), 0.0f, 65535.0f))) >> 1;
1513
1514 dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1515 dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1516 }
1517 }
1518
1519 static av_always_inline void rgbaf16ToUV_endian(uint16_t *dstU, uint16_t *dstV, int is_be,
1520 const uint16_t *src, int width,
1521 int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1522 {
1523 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1524 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1525 int i;
1526 for (i = 0; i < width; i++) {
1527 int r = lrintf(av_clipf(65535.0f * rdpx(src[i*4+0]), 0.0f, 65535.0f));
1528 int g = lrintf(av_clipf(65535.0f * rdpx(src[i*4+1]), 0.0f, 65535.0f));
1529 int b = lrintf(av_clipf(65535.0f * rdpx(src[i*4+2]), 0.0f, 65535.0f));
1530
1531 dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1532 dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1533 }
1534 }
1535
1536 static av_always_inline void rgbaf16ToY_endian(uint16_t *dst, const uint16_t *src, int is_be,
1537 int width, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1538 {
1539 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1540 int i;
1541 for (i = 0; i < width; i++) {
1542 int r = lrintf(av_clipf(65535.0f * rdpx(src[i*4+0]), 0.0f, 65535.0f));
1543 int g = lrintf(av_clipf(65535.0f * rdpx(src[i*4+1]), 0.0f, 65535.0f));
1544 int b = lrintf(av_clipf(65535.0f * rdpx(src[i*4+2]), 0.0f, 65535.0f));
1545
1546 dst[i] = (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1547 }
1548 }
1549
1550 static av_always_inline void rgbaf16ToA_endian(uint16_t *dst, const uint16_t *src, int is_be,
1551 int width, Half2FloatTables *h2f_tbl)
1552 {
1553 int i;
1554 for (i=0; i<width; i++) {
1555 dst[i] = lrintf(av_clipf(65535.0f * rdpx(src[i*4+3]), 0.0f, 65535.0f));
1556 }
1557 }
1558
1559 static av_always_inline void rgbf16ToUV_half_endian(uint16_t *dstU, uint16_t *dstV, int is_be,
1560 const uint16_t *src, int width,
1561 int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1562 {
1563 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1564 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1565 int i;
1566 for (i = 0; i < width; i++) {
1567 int r = (lrintf(av_clipf(65535.0f * rdpx(src[i*6+0]), 0.0f, 65535.0f)) +
1568 lrintf(av_clipf(65535.0f * rdpx(src[i*6+3]), 0.0f, 65535.0f))) >> 1;
1569 int g = (lrintf(av_clipf(65535.0f * rdpx(src[i*6+1]), 0.0f, 65535.0f)) +
1570 lrintf(av_clipf(65535.0f * rdpx(src[i*6+4]), 0.0f, 65535.0f))) >> 1;
1571 int b = (lrintf(av_clipf(65535.0f * rdpx(src[i*6+2]), 0.0f, 65535.0f)) +
1572 lrintf(av_clipf(65535.0f * rdpx(src[i*6+5]), 0.0f, 65535.0f))) >> 1;
1573
1574 dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1575 dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1576 }
1577 }
1578
1579 static av_always_inline void rgbf16ToUV_endian(uint16_t *dstU, uint16_t *dstV, int is_be,
1580 const uint16_t *src, int width,
1581 int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1582 {
1583 int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
1584 int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
1585 int i;
1586 for (i = 0; i < width; i++) {
1587 int r = lrintf(av_clipf(65535.0f * rdpx(src[i*3+0]), 0.0f, 65535.0f));
1588 int g = lrintf(av_clipf(65535.0f * rdpx(src[i*3+1]), 0.0f, 65535.0f));
1589 int b = lrintf(av_clipf(65535.0f * rdpx(src[i*3+2]), 0.0f, 65535.0f));
1590
1591 dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1592 dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1593 }
1594 }
1595
1596 static av_always_inline void rgbf16ToY_endian(uint16_t *dst, const uint16_t *src, int is_be,
1597 int width, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl)
1598 {
1599 int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
1600 int i;
1601 for (i = 0; i < width; i++) {
1602 int r = lrintf(av_clipf(65535.0f * rdpx(src[i*3+0]), 0.0f, 65535.0f));
1603 int g = lrintf(av_clipf(65535.0f * rdpx(src[i*3+1]), 0.0f, 65535.0f));
1604 int b = lrintf(av_clipf(65535.0f * rdpx(src[i*3+2]), 0.0f, 65535.0f));
1605
1606 dst[i] = (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
1607 }
1608 }
1609
1610 #undef rdpx
1611
1612 #define rgbaf16_funcs_endian(endian_name, endian) \
1613 static void planar_rgbf16##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
1614 int w, int32_t *rgb2yuv, void *opq) \
1615 { \
1616 planar_rgbf16_to_y(dst, src, w, endian, rgb2yuv, opq); \
1617 } \
1618 static void planar_rgbf16##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
1619 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
1620 void *opq) \
1621 { \
1622 planar_rgbf16_to_uv(dstU, dstV, src, w, endian, rgb2yuv, opq); \
1623 } \
1624 static void planar_rgbf16##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
1625 int w, int32_t *rgb2yuv, void *opq) \
1626 { \
1627 planar_rgbf16_to_a(dst, src, w, endian, rgb2yuv, opq); \
1628 } \
1629 static void grayf16##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
1630 const uint8_t *unused1, const uint8_t *unused2, \
1631 int width, uint32_t *unused, void *opq) \
1632 { \
1633 grayf16ToY16_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1634 } \
1635 static void read_yaf16##endian_name##_gray_c(uint8_t *dst, const uint8_t *src, \
1636 const uint8_t *unused1, const uint8_t *unused2, \
1637 int width, uint32_t *unused, void *opq) \
1638 { \
1639 read_yaf16_gray_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1640 } \
1641 static void read_yaf16##endian_name##_alpha_c(uint8_t *dst, const uint8_t *src, \
1642 const uint8_t *unused1, const uint8_t *unused2, \
1643 int width, uint32_t *unused, void *opq) \
1644 { \
1645 read_yaf16_alpha_c(dst, src, unused1, unused2, width, endian, unused, opq); \
1646 } \
1647 \
1648 static void rgbaf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1649 const uint8_t *src1, const uint8_t *src2, \
1650 int width, uint32_t *_rgb2yuv, void *opq) \
1651 { \
1652 const uint16_t *src = (const uint16_t*)src1; \
1653 uint16_t *dstU = (uint16_t*)_dstU; \
1654 uint16_t *dstV = (uint16_t*)_dstV; \
1655 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1656 av_assert1(src1==src2); \
1657 rgbaf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1658 } \
1659 static void rgbaf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1660 const uint8_t *src1, const uint8_t *src2, \
1661 int width, uint32_t *_rgb2yuv, void *opq) \
1662 { \
1663 const uint16_t *src = (const uint16_t*)src1; \
1664 uint16_t *dstU = (uint16_t*)_dstU; \
1665 uint16_t *dstV = (uint16_t*)_dstV; \
1666 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1667 av_assert1(src1==src2); \
1668 rgbaf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1669 } \
1670 static void rgbaf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1671 const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1672 { \
1673 const uint16_t *src = (const uint16_t*)_src; \
1674 uint16_t *dst = (uint16_t*)_dst; \
1675 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1676 rgbaf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1677 } \
1678 static void rgbaf16##endian_name##ToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1679 const uint8_t *unused1, int width, uint32_t *unused2, void *opq) \
1680 { \
1681 const uint16_t *src = (const uint16_t*)_src; \
1682 uint16_t *dst = (uint16_t*)_dst; \
1683 rgbaf16ToA_endian(dst, src, endian, width, opq); \
1684 } \
1685 static void rgbf16##endian_name##ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1686 const uint8_t *src1, const uint8_t *src2, \
1687 int width, uint32_t *_rgb2yuv, void *opq) \
1688 { \
1689 const uint16_t *src = (const uint16_t*)src1; \
1690 uint16_t *dstU = (uint16_t*)_dstU; \
1691 uint16_t *dstV = (uint16_t*)_dstV; \
1692 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1693 av_assert1(src1==src2); \
1694 rgbf16ToUV_half_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1695 } \
1696 static void rgbf16##endian_name##ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused, \
1697 const uint8_t *src1, const uint8_t *src2, \
1698 int width, uint32_t *_rgb2yuv, void *opq) \
1699 { \
1700 const uint16_t *src = (const uint16_t*)src1; \
1701 uint16_t *dstU = (uint16_t*)_dstU; \
1702 uint16_t *dstV = (uint16_t*)_dstV; \
1703 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1704 av_assert1(src1==src2); \
1705 rgbf16ToUV_endian(dstU, dstV, endian, src, width, rgb2yuv, opq); \
1706 } \
1707 static void rgbf16##endian_name##ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, \
1708 const uint8_t *unused1, int width, uint32_t *_rgb2yuv, void *opq) \
1709 { \
1710 const uint16_t *src = (const uint16_t*)_src; \
1711 uint16_t *dst = (uint16_t*)_dst; \
1712 int32_t *rgb2yuv = (int32_t*)_rgb2yuv; \
1713 rgbf16ToY_endian(dst, src, endian, width, rgb2yuv, opq); \
1714 } \
1715
1716 32786 rgbaf16_funcs_endian(le, 0)
1717 rgbaf16_funcs_endian(be, 1)
1718
1719 38530 av_cold void ff_sws_init_input_funcs(SwsInternal *c,
1720 planar1_YV12_fn *lumToYV12,
1721 planar1_YV12_fn *alpToYV12,
1722 planar2_YV12_fn *chrToYV12,
1723 planarX_YV12_fn *readLumPlanar,
1724 planarX_YV12_fn *readAlpPlanar,
1725 planarX2_YV12_fn *readChrPlanar)
1726 {
1727 38530 enum AVPixelFormat srcFormat = c->opts.src_format;
1728
1729 38530 *chrToYV12 = NULL;
1730
45/49
✓ Branch 0 taken 112 times.
✓ Branch 1 taken 112 times.
✓ Branch 2 taken 112 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 116 times.
✓ Branch 5 taken 1115 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 30 times.
✓ Branch 8 taken 158 times.
✓ Branch 9 taken 1338 times.
✓ Branch 10 taken 1334 times.
✓ Branch 11 taken 159 times.
✓ Branch 12 taken 678 times.
✓ Branch 13 taken 422 times.
✓ Branch 14 taken 384 times.
✓ Branch 15 taken 157 times.
✓ Branch 16 taken 482 times.
✓ Branch 17 taken 482 times.
✓ Branch 18 taken 158 times.
✓ Branch 19 taken 522 times.
✓ Branch 20 taken 392 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 1315 times.
✓ Branch 23 taken 1208 times.
✓ Branch 24 taken 113 times.
✓ Branch 25 taken 111 times.
✓ Branch 26 taken 125 times.
✓ Branch 27 taken 1 times.
✓ Branch 28 taken 1 times.
✓ Branch 29 taken 1 times.
✓ Branch 30 taken 5 times.
✓ Branch 31 taken 111 times.
✓ Branch 32 taken 111 times.
✓ Branch 33 taken 131 times.
✓ Branch 34 taken 131 times.
✓ Branch 35 taken 1 times.
✓ Branch 36 taken 1143 times.
✓ Branch 37 taken 1 times.
✓ Branch 38 taken 303 times.
✓ Branch 39 taken 1143 times.
✓ Branch 40 taken 303 times.
✓ Branch 41 taken 533 times.
✓ Branch 42 taken 353 times.
✓ Branch 43 taken 111 times.
✓ Branch 44 taken 111 times.
✓ Branch 45 taken 131 times.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✓ Branch 48 taken 22768 times.
38530 switch (srcFormat) {
1731 112 case AV_PIX_FMT_YUYV422:
1732 112 *chrToYV12 = yuy2ToUV_c;
1733 112 break;
1734 112 case AV_PIX_FMT_YVYU422:
1735 112 *chrToYV12 = yvy2ToUV_c;
1736 112 break;
1737 112 case AV_PIX_FMT_UYVY422:
1738 112 *chrToYV12 = uyvyToUV_c;
1739 112 break;
1740 case AV_PIX_FMT_UYYVYY411:
1741 *chrToYV12 = uyyvyyToUV_c;
1742 break;
1743 116 case AV_PIX_FMT_VYU444:
1744 116 *chrToYV12 = vyuToUV_c;
1745 116 break;
1746 1115 case AV_PIX_FMT_NV12:
1747 case AV_PIX_FMT_NV16:
1748 case AV_PIX_FMT_NV24:
1749 1115 *chrToYV12 = nv12ToUV_c;
1750 1115 break;
1751 2 case AV_PIX_FMT_NV21:
1752 case AV_PIX_FMT_NV42:
1753 2 *chrToYV12 = nv21ToUV_c;
1754 2 break;
1755 30 case AV_PIX_FMT_RGB8:
1756 case AV_PIX_FMT_BGR8:
1757 case AV_PIX_FMT_PAL8:
1758 case AV_PIX_FMT_BGR4_BYTE:
1759 case AV_PIX_FMT_RGB4_BYTE:
1760 30 *chrToYV12 = palToUV_c;
1761 30 break;
1762 158 case AV_PIX_FMT_GBRP9LE:
1763 158 *readChrPlanar = planar_rgb9le_to_uv;
1764 158 break;
1765 1338 case AV_PIX_FMT_GBRAP10LE:
1766 case AV_PIX_FMT_GBRP10LE:
1767 1338 *readChrPlanar = planar_rgb10le_to_uv;
1768 1338 break;
1769 1334 case AV_PIX_FMT_GBRAP12LE:
1770 case AV_PIX_FMT_GBRP12LE:
1771 1334 *readChrPlanar = planar_rgb12le_to_uv;
1772 1334 break;
1773 159 case AV_PIX_FMT_GBRAP14LE:
1774 case AV_PIX_FMT_GBRP14LE:
1775 159 *readChrPlanar = planar_rgb14le_to_uv;
1776 159 break;
1777 678 case AV_PIX_FMT_GBRAP16LE:
1778 case AV_PIX_FMT_GBRP16LE:
1779 678 *readChrPlanar = planar_rgb16le_to_uv;
1780 678 break;
1781 422 case AV_PIX_FMT_GBRAPF32LE:
1782 case AV_PIX_FMT_GBRPF32LE:
1783 422 *readChrPlanar = planar_rgbf32le_to_uv;
1784 422 break;
1785 384 case AV_PIX_FMT_GBRAPF16LE:
1786 case AV_PIX_FMT_GBRPF16LE:
1787 384 *readChrPlanar = planar_rgbf16le_to_uv;
1788 384 break;
1789 157 case AV_PIX_FMT_GBRP9BE:
1790 157 *readChrPlanar = planar_rgb9be_to_uv;
1791 157 break;
1792 482 case AV_PIX_FMT_GBRAP10BE:
1793 case AV_PIX_FMT_GBRP10BE:
1794 482 *readChrPlanar = planar_rgb10be_to_uv;
1795 482 break;
1796 482 case AV_PIX_FMT_GBRAP12BE:
1797 case AV_PIX_FMT_GBRP12BE:
1798 482 *readChrPlanar = planar_rgb12be_to_uv;
1799 482 break;
1800 158 case AV_PIX_FMT_GBRAP14BE:
1801 case AV_PIX_FMT_GBRP14BE:
1802 158 *readChrPlanar = planar_rgb14be_to_uv;
1803 158 break;
1804 522 case AV_PIX_FMT_GBRAP16BE:
1805 case AV_PIX_FMT_GBRP16BE:
1806 522 *readChrPlanar = planar_rgb16be_to_uv;
1807 522 break;
1808 392 case AV_PIX_FMT_GBRAPF32BE:
1809 case AV_PIX_FMT_GBRPF32BE:
1810 392 *readChrPlanar = planar_rgbf32be_to_uv;
1811 392 break;
1812 case AV_PIX_FMT_GBRAPF16BE:
1813 case AV_PIX_FMT_GBRPF16BE:
1814 *readChrPlanar = planar_rgbf16be_to_uv;
1815 break;
1816 1315 case AV_PIX_FMT_GBRAP:
1817 case AV_PIX_FMT_GBRP:
1818 1315 *readChrPlanar = planar_rgb_to_uv;
1819 1315 break;
1820 #if HAVE_BIGENDIAN
1821 case AV_PIX_FMT_YUV420P9LE:
1822 case AV_PIX_FMT_YUV422P9LE:
1823 case AV_PIX_FMT_YUV444P9LE:
1824 case AV_PIX_FMT_YUV420P10LE:
1825 case AV_PIX_FMT_YUV422P10LE:
1826 case AV_PIX_FMT_YUV440P10LE:
1827 case AV_PIX_FMT_YUV444P10LE:
1828 case AV_PIX_FMT_YUV420P12LE:
1829 case AV_PIX_FMT_YUV422P12LE:
1830 case AV_PIX_FMT_YUV440P12LE:
1831 case AV_PIX_FMT_YUV444P12LE:
1832 case AV_PIX_FMT_YUV420P14LE:
1833 case AV_PIX_FMT_YUV422P14LE:
1834 case AV_PIX_FMT_YUV444P14LE:
1835 case AV_PIX_FMT_YUV420P16LE:
1836 case AV_PIX_FMT_YUV422P16LE:
1837 case AV_PIX_FMT_YUV444P16LE:
1838
1839 case AV_PIX_FMT_YUVA420P9LE:
1840 case AV_PIX_FMT_YUVA422P9LE:
1841 case AV_PIX_FMT_YUVA444P9LE:
1842 case AV_PIX_FMT_YUVA420P10LE:
1843 case AV_PIX_FMT_YUVA422P10LE:
1844 case AV_PIX_FMT_YUVA444P10LE:
1845 case AV_PIX_FMT_YUVA422P12LE:
1846 case AV_PIX_FMT_YUVA444P12LE:
1847 case AV_PIX_FMT_YUVA420P16LE:
1848 case AV_PIX_FMT_YUVA422P16LE:
1849 case AV_PIX_FMT_YUVA444P16LE:
1850 *chrToYV12 = bswap16UV_c;
1851 break;
1852 #else
1853 1208 case AV_PIX_FMT_YUV420P9BE:
1854 case AV_PIX_FMT_YUV422P9BE:
1855 case AV_PIX_FMT_YUV444P9BE:
1856 case AV_PIX_FMT_YUV420P10BE:
1857 case AV_PIX_FMT_YUV422P10BE:
1858 case AV_PIX_FMT_YUV440P10BE:
1859 case AV_PIX_FMT_YUV444P10BE:
1860 case AV_PIX_FMT_YUV420P12BE:
1861 case AV_PIX_FMT_YUV422P12BE:
1862 case AV_PIX_FMT_YUV440P12BE:
1863 case AV_PIX_FMT_YUV444P12BE:
1864 case AV_PIX_FMT_YUV420P14BE:
1865 case AV_PIX_FMT_YUV422P14BE:
1866 case AV_PIX_FMT_YUV444P14BE:
1867 case AV_PIX_FMT_YUV420P16BE:
1868 case AV_PIX_FMT_YUV422P16BE:
1869 case AV_PIX_FMT_YUV444P16BE:
1870
1871 case AV_PIX_FMT_YUVA420P9BE:
1872 case AV_PIX_FMT_YUVA422P9BE:
1873 case AV_PIX_FMT_YUVA444P9BE:
1874 case AV_PIX_FMT_YUVA420P10BE:
1875 case AV_PIX_FMT_YUVA422P10BE:
1876 case AV_PIX_FMT_YUVA444P10BE:
1877 case AV_PIX_FMT_YUVA422P12BE:
1878 case AV_PIX_FMT_YUVA444P12BE:
1879 case AV_PIX_FMT_YUVA420P16BE:
1880 case AV_PIX_FMT_YUVA422P16BE:
1881 case AV_PIX_FMT_YUVA444P16BE:
1882 1208 *chrToYV12 = bswap16UV_c;
1883 1208 break;
1884 #endif
1885 113 case AV_PIX_FMT_VUYA:
1886 case AV_PIX_FMT_VUYX:
1887 113 *chrToYV12 = read_vuyx_UV_c;
1888 113 break;
1889 111 case AV_PIX_FMT_XV30LE:
1890 111 *chrToYV12 = read_xv30le_UV_c;
1891 111 break;
1892 125 case AV_PIX_FMT_V30XLE:
1893 125 *chrToYV12 = read_v30xle_UV_c;
1894 125 break;
1895 1 case AV_PIX_FMT_AYUV:
1896 1 *chrToYV12 = read_ayuv_UV_c;
1897 1 break;
1898 1 case AV_PIX_FMT_AYUV64LE:
1899 1 *chrToYV12 = read_ayuv64le_UV_c;
1900 1 break;
1901 1 case AV_PIX_FMT_AYUV64BE:
1902 1 *chrToYV12 = read_ayuv64be_UV_c;
1903 1 break;
1904 5 case AV_PIX_FMT_UYVA:
1905 5 *chrToYV12 = read_uyva_UV_c;
1906 5 break;
1907 111 case AV_PIX_FMT_XV36LE:
1908 111 *chrToYV12 = read_xv36le_UV_c;
1909 111 break;
1910 111 case AV_PIX_FMT_XV36BE:
1911 111 *chrToYV12 = read_xv36be_UV_c;
1912 111 break;
1913 131 case AV_PIX_FMT_XV48LE:
1914 131 *chrToYV12 = read_xv48le_UV_c;
1915 131 break;
1916 131 case AV_PIX_FMT_XV48BE:
1917 131 *chrToYV12 = read_xv48be_UV_c;
1918 131 break;
1919 1 case AV_PIX_FMT_NV20LE:
1920 1 *chrToYV12 = nv20LEToUV_c;
1921 1 break;
1922 1143 case AV_PIX_FMT_P010LE:
1923 case AV_PIX_FMT_P210LE:
1924 case AV_PIX_FMT_P410LE:
1925 1143 *chrToYV12 = p010LEToUV_c;
1926 1143 break;
1927 1 case AV_PIX_FMT_NV20BE:
1928 1 *chrToYV12 = nv20BEToUV_c;
1929 1 break;
1930 303 case AV_PIX_FMT_P010BE:
1931 case AV_PIX_FMT_P210BE:
1932 case AV_PIX_FMT_P410BE:
1933 303 *chrToYV12 = p010BEToUV_c;
1934 303 break;
1935 1143 case AV_PIX_FMT_P012LE:
1936 case AV_PIX_FMT_P212LE:
1937 case AV_PIX_FMT_P412LE:
1938 1143 *chrToYV12 = p012LEToUV_c;
1939 1143 break;
1940 303 case AV_PIX_FMT_P012BE:
1941 case AV_PIX_FMT_P212BE:
1942 case AV_PIX_FMT_P412BE:
1943 303 *chrToYV12 = p012BEToUV_c;
1944 303 break;
1945 533 case AV_PIX_FMT_P016LE:
1946 case AV_PIX_FMT_P216LE:
1947 case AV_PIX_FMT_P416LE:
1948 533 *chrToYV12 = p016LEToUV_c;
1949 533 break;
1950 353 case AV_PIX_FMT_P016BE:
1951 case AV_PIX_FMT_P216BE:
1952 case AV_PIX_FMT_P416BE:
1953 353 *chrToYV12 = p016BEToUV_c;
1954 353 break;
1955 111 case AV_PIX_FMT_Y210LE:
1956 111 *chrToYV12 = y210le_UV_c;
1957 111 break;
1958 111 case AV_PIX_FMT_Y212LE:
1959 111 *chrToYV12 = y212le_UV_c;
1960 111 break;
1961 131 case AV_PIX_FMT_Y216LE:
1962 131 *chrToYV12 = y216le_UV_c;
1963 131 break;
1964 case AV_PIX_FMT_RGBF32LE:
1965 *chrToYV12 = rgbf32le_to_uv_c;
1966 break;
1967 case AV_PIX_FMT_RGBF32BE:
1968 *chrToYV12 = rgbf32be_to_uv_c;
1969 break;
1970 }
1971
2/2
✓ Branch 0 taken 23619 times.
✓ Branch 1 taken 14911 times.
38530 if (c->chrSrcHSubSample) {
1972
21/34
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 424 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 58 times.
✓ Branch 9 taken 26 times.
✓ Branch 10 taken 56 times.
✓ Branch 11 taken 1 times.
✓ Branch 12 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 15 taken 811 times.
✓ Branch 16 taken 1 times.
✓ Branch 17 taken 1 times.
✓ Branch 18 taken 64 times.
✓ Branch 19 taken 36 times.
✓ Branch 20 taken 532 times.
✓ Branch 21 taken 5 times.
✓ Branch 22 taken 1 times.
✓ Branch 23 taken 16 times.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✓ Branch 33 taken 21581 times.
23619 switch (srcFormat) {
1973 case AV_PIX_FMT_RGBA64BE:
1974 *chrToYV12 = rgb64BEToUV_half_c;
1975 break;
1976 case AV_PIX_FMT_RGBA64LE:
1977 *chrToYV12 = rgb64LEToUV_half_c;
1978 break;
1979 case AV_PIX_FMT_BGRA64BE:
1980 *chrToYV12 = bgr64BEToUV_half_c;
1981 break;
1982 case AV_PIX_FMT_BGRA64LE:
1983 *chrToYV12 = bgr64LEToUV_half_c;
1984 break;
1985 case AV_PIX_FMT_RGB48BE:
1986 *chrToYV12 = rgb48BEToUV_half_c;
1987 break;
1988 424 case AV_PIX_FMT_RGB48LE:
1989 424 *chrToYV12 = rgb48LEToUV_half_c;
1990 424 break;
1991 case AV_PIX_FMT_BGR48BE:
1992 *chrToYV12 = bgr48BEToUV_half_c;
1993 break;
1994 case AV_PIX_FMT_BGR48LE:
1995 *chrToYV12 = bgr48LEToUV_half_c;
1996 break;
1997 58 case AV_PIX_FMT_RGB32:
1998 58 *chrToYV12 = bgr32ToUV_half_c;
1999 58 break;
2000 26 case AV_PIX_FMT_RGB32_1:
2001 26 *chrToYV12 = bgr321ToUV_half_c;
2002 26 break;
2003 56 case AV_PIX_FMT_BGR24:
2004 56 *chrToYV12 = bgr24ToUV_half_c;
2005 56 break;
2006 1 case AV_PIX_FMT_BGR565LE:
2007 1 *chrToYV12 = bgr16leToUV_half_c;
2008 1 break;
2009 1 case AV_PIX_FMT_BGR565BE:
2010 1 *chrToYV12 = bgr16beToUV_half_c;
2011 1 break;
2012 1 case AV_PIX_FMT_BGR555LE:
2013 1 *chrToYV12 = bgr15leToUV_half_c;
2014 1 break;
2015 1 case AV_PIX_FMT_BGR555BE:
2016 1 *chrToYV12 = bgr15beToUV_half_c;
2017 1 break;
2018 811 case AV_PIX_FMT_GBRAP:
2019 case AV_PIX_FMT_GBRP:
2020 811 *chrToYV12 = gbr24pToUV_half_c;
2021 811 break;
2022 1 case AV_PIX_FMT_BGR444LE:
2023 1 *chrToYV12 = bgr12leToUV_half_c;
2024 1 break;
2025 1 case AV_PIX_FMT_BGR444BE:
2026 1 *chrToYV12 = bgr12beToUV_half_c;
2027 1 break;
2028 64 case AV_PIX_FMT_BGR32:
2029 64 *chrToYV12 = rgb32ToUV_half_c;
2030 64 break;
2031 36 case AV_PIX_FMT_BGR32_1:
2032 36 *chrToYV12 = rgb321ToUV_half_c;
2033 36 break;
2034 532 case AV_PIX_FMT_RGB24:
2035 532 *chrToYV12 = rgb24ToUV_half_c;
2036 532 break;
2037 5 case AV_PIX_FMT_RGB565LE:
2038 5 *chrToYV12 = rgb16leToUV_half_c;
2039 5 break;
2040 1 case AV_PIX_FMT_RGB565BE:
2041 1 *chrToYV12 = rgb16beToUV_half_c;
2042 1 break;
2043 16 case AV_PIX_FMT_RGB555LE:
2044 16 *chrToYV12 = rgb15leToUV_half_c;
2045 16 break;
2046 1 case AV_PIX_FMT_RGB555BE:
2047 1 *chrToYV12 = rgb15beToUV_half_c;
2048 1 break;
2049 1 case AV_PIX_FMT_RGB444LE:
2050 1 *chrToYV12 = rgb12leToUV_half_c;
2051 1 break;
2052 1 case AV_PIX_FMT_RGB444BE:
2053 1 *chrToYV12 = rgb12beToUV_half_c;
2054 1 break;
2055 case AV_PIX_FMT_X2RGB10LE:
2056 *chrToYV12 = rgb30leToUV_half_c;
2057 break;
2058 case AV_PIX_FMT_X2BGR10LE:
2059 *chrToYV12 = bgr30leToUV_half_c;
2060 break;
2061 case AV_PIX_FMT_RGBAF16BE:
2062 *chrToYV12 = rgbaf16beToUV_half_c;
2063 break;
2064 case AV_PIX_FMT_RGBAF16LE:
2065 *chrToYV12 = rgbaf16leToUV_half_c;
2066 break;
2067 case AV_PIX_FMT_RGBF16BE:
2068 *chrToYV12 = rgbf16beToUV_half_c;
2069 break;
2070 case AV_PIX_FMT_RGBF16LE:
2071 *chrToYV12 = rgbf16leToUV_half_c;
2072 break;
2073 }
2074 } else {
2075
19/33
✓ Branch 0 taken 11 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 12 times.
✓ Branch 5 taken 584 times.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 228 times.
✓ Branch 9 taken 30 times.
✓ Branch 10 taken 106 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 50 times.
✓ Branch 18 taken 30 times.
✓ Branch 19 taken 607 times.
✓ Branch 20 taken 101 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 101 times.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 81 times.
✓ Branch 27 taken 81 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 12881 times.
14911 switch (srcFormat) {
2076 11 case AV_PIX_FMT_RGBA64BE:
2077 11 *chrToYV12 = rgb64BEToUV_c;
2078 11 break;
2079 2 case AV_PIX_FMT_RGBA64LE:
2080 2 *chrToYV12 = rgb64LEToUV_c;
2081 2 break;
2082 1 case AV_PIX_FMT_BGRA64BE:
2083 1 *chrToYV12 = bgr64BEToUV_c;
2084 1 break;
2085 2 case AV_PIX_FMT_BGRA64LE:
2086 2 *chrToYV12 = bgr64LEToUV_c;
2087 2 break;
2088 12 case AV_PIX_FMT_RGB48BE:
2089 12 *chrToYV12 = rgb48BEToUV_c;
2090 12 break;
2091 584 case AV_PIX_FMT_RGB48LE:
2092 584 *chrToYV12 = rgb48LEToUV_c;
2093 584 break;
2094 1 case AV_PIX_FMT_BGR48BE:
2095 1 *chrToYV12 = bgr48BEToUV_c;
2096 1 break;
2097 2 case AV_PIX_FMT_BGR48LE:
2098 2 *chrToYV12 = bgr48LEToUV_c;
2099 2 break;
2100 228 case AV_PIX_FMT_RGB32:
2101 228 *chrToYV12 = bgr32ToUV_c;
2102 228 break;
2103 30 case AV_PIX_FMT_RGB32_1:
2104 30 *chrToYV12 = bgr321ToUV_c;
2105 30 break;
2106 106 case AV_PIX_FMT_BGR24:
2107 106 *chrToYV12 = bgr24ToUV_c;
2108 106 break;
2109 case AV_PIX_FMT_BGR565LE:
2110 *chrToYV12 = bgr16leToUV_c;
2111 break;
2112 case AV_PIX_FMT_BGR565BE:
2113 *chrToYV12 = bgr16beToUV_c;
2114 break;
2115 case AV_PIX_FMT_BGR555LE:
2116 *chrToYV12 = bgr15leToUV_c;
2117 break;
2118 case AV_PIX_FMT_BGR555BE:
2119 *chrToYV12 = bgr15beToUV_c;
2120 break;
2121 case AV_PIX_FMT_BGR444LE:
2122 *chrToYV12 = bgr12leToUV_c;
2123 break;
2124 case AV_PIX_FMT_BGR444BE:
2125 *chrToYV12 = bgr12beToUV_c;
2126 break;
2127 50 case AV_PIX_FMT_BGR32:
2128 50 *chrToYV12 = rgb32ToUV_c;
2129 50 break;
2130 30 case AV_PIX_FMT_BGR32_1:
2131 30 *chrToYV12 = rgb321ToUV_c;
2132 30 break;
2133 607 case AV_PIX_FMT_RGB24:
2134 607 *chrToYV12 = rgb24ToUV_c;
2135 607 break;
2136 101 case AV_PIX_FMT_RGB565LE:
2137 101 *chrToYV12 = rgb16leToUV_c;
2138 101 break;
2139 case AV_PIX_FMT_RGB565BE:
2140 *chrToYV12 = rgb16beToUV_c;
2141 break;
2142 101 case AV_PIX_FMT_RGB555LE:
2143 101 *chrToYV12 = rgb15leToUV_c;
2144 101 break;
2145 case AV_PIX_FMT_RGB555BE:
2146 *chrToYV12 = rgb15beToUV_c;
2147 break;
2148 case AV_PIX_FMT_RGB444LE:
2149 *chrToYV12 = rgb12leToUV_c;
2150 break;
2151 case AV_PIX_FMT_RGB444BE:
2152 *chrToYV12 = rgb12beToUV_c;
2153 break;
2154 81 case AV_PIX_FMT_X2RGB10LE:
2155 81 *chrToYV12 = rgb30leToUV_c;
2156 81 break;
2157 81 case AV_PIX_FMT_X2BGR10LE:
2158 81 *chrToYV12 = bgr30leToUV_c;
2159 81 break;
2160 case AV_PIX_FMT_RGBAF16BE:
2161 *chrToYV12 = rgbaf16beToUV_c;
2162 break;
2163 case AV_PIX_FMT_RGBAF16LE:
2164 *chrToYV12 = rgbaf16leToUV_c;
2165 break;
2166 case AV_PIX_FMT_RGBF16BE:
2167 *chrToYV12 = rgbf16beToUV_c;
2168 break;
2169 case AV_PIX_FMT_RGBF16LE:
2170 *chrToYV12 = rgbf16leToUV_c;
2171 break;
2172 }
2173 }
2174
2175 38530 *lumToYV12 = NULL;
2176 38530 *alpToYV12 = NULL;
2177
86/99
✓ Branch 0 taken 158 times.
✓ Branch 1 taken 236 times.
✓ Branch 2 taken 1102 times.
✓ Branch 3 taken 236 times.
✓ Branch 4 taken 1098 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 158 times.
✓ Branch 7 taken 236 times.
✓ Branch 8 taken 442 times.
✓ Branch 9 taken 235 times.
✓ Branch 10 taken 187 times.
✓ Branch 11 taken 115 times.
✓ Branch 12 taken 269 times.
✓ Branch 13 taken 157 times.
✓ Branch 14 taken 235 times.
✓ Branch 15 taken 247 times.
✓ Branch 16 taken 235 times.
✓ Branch 17 taken 247 times.
✓ Branch 18 taken 1 times.
✓ Branch 19 taken 157 times.
✓ Branch 20 taken 245 times.
✓ Branch 21 taken 277 times.
✓ Branch 22 taken 235 times.
✓ Branch 23 taken 157 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 276 times.
✓ Branch 27 taken 1039 times.
✓ Branch 28 taken 1925 times.
✓ Branch 29 taken 11 times.
✓ Branch 30 taken 1 times.
✓ Branch 31 taken 21 times.
✓ Branch 32 taken 9 times.
✗ Branch 33 not taken.
✓ Branch 34 taken 113 times.
✓ Branch 35 taken 111 times.
✓ Branch 36 taken 125 times.
✓ Branch 37 taken 6 times.
✓ Branch 38 taken 132 times.
✓ Branch 39 taken 132 times.
✓ Branch 40 taken 111 times.
✓ Branch 41 taken 111 times.
✓ Branch 42 taken 245 times.
✓ Branch 43 taken 112 times.
✗ Branch 44 not taken.
✓ Branch 45 taken 116 times.
✓ Branch 46 taken 162 times.
✓ Branch 47 taken 1 times.
✓ Branch 48 taken 1 times.
✓ Branch 49 taken 1 times.
✓ Branch 50 taken 1 times.
✓ Branch 51 taken 1 times.
✓ Branch 52 taken 1 times.
✓ Branch 53 taken 1139 times.
✓ Branch 54 taken 106 times.
✓ Branch 55 taken 1 times.
✓ Branch 56 taken 117 times.
✓ Branch 57 taken 1 times.
✓ Branch 58 taken 1 times.
✓ Branch 59 taken 1 times.
✓ Branch 60 taken 30 times.
✓ Branch 61 taken 112 times.
✓ Branch 62 taken 116 times.
✓ Branch 63 taken 286 times.
✓ Branch 64 taken 56 times.
✓ Branch 65 taken 114 times.
✓ Branch 66 taken 66 times.
✓ Branch 67 taken 12 times.
✓ Branch 68 taken 1008 times.
✓ Branch 69 taken 1 times.
✓ Branch 70 taken 2 times.
✓ Branch 71 taken 11 times.
✓ Branch 72 taken 2 times.
✓ Branch 73 taken 1 times.
✓ Branch 74 taken 2 times.
✓ Branch 75 taken 1 times.
✓ Branch 76 taken 1143 times.
✓ Branch 77 taken 1 times.
✓ Branch 78 taken 303 times.
✓ Branch 79 taken 1143 times.
✓ Branch 80 taken 303 times.
✓ Branch 81 taken 1 times.
✓ Branch 82 taken 1 times.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✓ Branch 85 taken 18 times.
✗ Branch 86 not taken.
✓ Branch 87 taken 111 times.
✓ Branch 88 taken 111 times.
✓ Branch 89 taken 131 times.
✓ Branch 90 taken 81 times.
✓ Branch 91 taken 81 times.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✓ Branch 98 taken 20486 times.
38530 switch (srcFormat) {
2178 158 case AV_PIX_FMT_GBRP9LE:
2179 158 *readLumPlanar = planar_rgb9le_to_y;
2180 158 break;
2181 236 case AV_PIX_FMT_GBRAP10LE:
2182 236 *readAlpPlanar = planar_rgb10le_to_a;
2183 1338 case AV_PIX_FMT_GBRP10LE:
2184 1338 *readLumPlanar = planar_rgb10le_to_y;
2185 1338 break;
2186 236 case AV_PIX_FMT_GBRAP12LE:
2187 236 *readAlpPlanar = planar_rgb12le_to_a;
2188 1334 case AV_PIX_FMT_GBRP12LE:
2189 1334 *readLumPlanar = planar_rgb12le_to_y;
2190 1334 break;
2191 1 case AV_PIX_FMT_GBRAP14LE:
2192 1 *readAlpPlanar = planar_rgb14le_to_a;
2193 159 case AV_PIX_FMT_GBRP14LE:
2194 159 *readLumPlanar = planar_rgb14le_to_y;
2195 159 break;
2196 236 case AV_PIX_FMT_GBRAP16LE:
2197 236 *readAlpPlanar = planar_rgb16le_to_a;
2198 678 case AV_PIX_FMT_GBRP16LE:
2199 678 *readLumPlanar = planar_rgb16le_to_y;
2200 678 break;
2201 235 case AV_PIX_FMT_GBRAPF32LE:
2202 235 *readAlpPlanar = planar_rgbf32le_to_a;
2203 422 case AV_PIX_FMT_GBRPF32LE:
2204 422 *readLumPlanar = planar_rgbf32le_to_y;
2205 422 break;
2206 115 case AV_PIX_FMT_GBRAPF16LE:
2207 115 *readAlpPlanar = planar_rgbf16le_to_a;
2208 384 case AV_PIX_FMT_GBRPF16LE:
2209 384 *readLumPlanar = planar_rgbf16le_to_y;
2210 384 break;
2211 157 case AV_PIX_FMT_GBRP9BE:
2212 157 *readLumPlanar = planar_rgb9be_to_y;
2213 157 break;
2214 235 case AV_PIX_FMT_GBRAP10BE:
2215 235 *readAlpPlanar = planar_rgb10be_to_a;
2216 482 case AV_PIX_FMT_GBRP10BE:
2217 482 *readLumPlanar = planar_rgb10be_to_y;
2218 482 break;
2219 235 case AV_PIX_FMT_GBRAP12BE:
2220 235 *readAlpPlanar = planar_rgb12be_to_a;
2221 482 case AV_PIX_FMT_GBRP12BE:
2222 482 *readLumPlanar = planar_rgb12be_to_y;
2223 482 break;
2224 1 case AV_PIX_FMT_GBRAP14BE:
2225 1 *readAlpPlanar = planar_rgb14be_to_a;
2226 158 case AV_PIX_FMT_GBRP14BE:
2227 158 *readLumPlanar = planar_rgb14be_to_y;
2228 158 break;
2229 245 case AV_PIX_FMT_GBRAP16BE:
2230 245 *readAlpPlanar = planar_rgb16be_to_a;
2231 522 case AV_PIX_FMT_GBRP16BE:
2232 522 *readLumPlanar = planar_rgb16be_to_y;
2233 522 break;
2234 235 case AV_PIX_FMT_GBRAPF32BE:
2235 235 *readAlpPlanar = planar_rgbf32be_to_a;
2236 392 case AV_PIX_FMT_GBRPF32BE:
2237 392 *readLumPlanar = planar_rgbf32be_to_y;
2238 392 break;
2239 case AV_PIX_FMT_GBRAPF16BE:
2240 *readAlpPlanar = planar_rgbf16be_to_a;
2241 case AV_PIX_FMT_GBRPF16BE:
2242 *readLumPlanar = planar_rgbf16be_to_y;
2243 break;
2244 276 case AV_PIX_FMT_GBRAP:
2245 276 *readAlpPlanar = planar_rgb_to_a;
2246 1315 case AV_PIX_FMT_GBRP:
2247 1315 *readLumPlanar = planar_rgb_to_y;
2248 1315 break;
2249 #if HAVE_BIGENDIAN
2250 case AV_PIX_FMT_YUV420P9LE:
2251 case AV_PIX_FMT_YUV422P9LE:
2252 case AV_PIX_FMT_YUV444P9LE:
2253 case AV_PIX_FMT_YUV420P10LE:
2254 case AV_PIX_FMT_YUV422P10LE:
2255 case AV_PIX_FMT_YUV440P10LE:
2256 case AV_PIX_FMT_YUV444P10LE:
2257 case AV_PIX_FMT_YUV420P12LE:
2258 case AV_PIX_FMT_YUV422P12LE:
2259 case AV_PIX_FMT_YUV440P12LE:
2260 case AV_PIX_FMT_YUV444P12LE:
2261 case AV_PIX_FMT_YUV420P14LE:
2262 case AV_PIX_FMT_YUV422P14LE:
2263 case AV_PIX_FMT_YUV444P14LE:
2264 case AV_PIX_FMT_YUV420P16LE:
2265 case AV_PIX_FMT_YUV422P16LE:
2266 case AV_PIX_FMT_YUV444P16LE:
2267
2268 case AV_PIX_FMT_GRAY9LE:
2269 case AV_PIX_FMT_GRAY10LE:
2270 case AV_PIX_FMT_GRAY12LE:
2271 case AV_PIX_FMT_GRAY14LE:
2272 case AV_PIX_FMT_GRAY16LE:
2273
2274 case AV_PIX_FMT_P016LE:
2275 case AV_PIX_FMT_P216LE:
2276 case AV_PIX_FMT_P416LE:
2277 *lumToYV12 = bswap16Y_c;
2278 break;
2279 case AV_PIX_FMT_YUVA420P9LE:
2280 case AV_PIX_FMT_YUVA422P9LE:
2281 case AV_PIX_FMT_YUVA444P9LE:
2282 case AV_PIX_FMT_YUVA420P10LE:
2283 case AV_PIX_FMT_YUVA422P10LE:
2284 case AV_PIX_FMT_YUVA444P10LE:
2285 case AV_PIX_FMT_YUVA422P12LE:
2286 case AV_PIX_FMT_YUVA444P12LE:
2287 case AV_PIX_FMT_YUVA420P16LE:
2288 case AV_PIX_FMT_YUVA422P16LE:
2289 case AV_PIX_FMT_YUVA444P16LE:
2290 *lumToYV12 = bswap16Y_c;
2291 *alpToYV12 = bswap16Y_c;
2292 break;
2293 #else
2294 1925 case AV_PIX_FMT_YUV420P9BE:
2295 case AV_PIX_FMT_YUV422P9BE:
2296 case AV_PIX_FMT_YUV444P9BE:
2297 case AV_PIX_FMT_YUV420P10BE:
2298 case AV_PIX_FMT_YUV422P10BE:
2299 case AV_PIX_FMT_YUV440P10BE:
2300 case AV_PIX_FMT_YUV444P10BE:
2301 case AV_PIX_FMT_YUV420P12BE:
2302 case AV_PIX_FMT_YUV422P12BE:
2303 case AV_PIX_FMT_YUV440P12BE:
2304 case AV_PIX_FMT_YUV444P12BE:
2305 case AV_PIX_FMT_YUV420P14BE:
2306 case AV_PIX_FMT_YUV422P14BE:
2307 case AV_PIX_FMT_YUV444P14BE:
2308 case AV_PIX_FMT_YUV420P16BE:
2309 case AV_PIX_FMT_YUV422P16BE:
2310 case AV_PIX_FMT_YUV444P16BE:
2311
2312 case AV_PIX_FMT_GRAY9BE:
2313 case AV_PIX_FMT_GRAY10BE:
2314 case AV_PIX_FMT_GRAY12BE:
2315 case AV_PIX_FMT_GRAY14BE:
2316 case AV_PIX_FMT_GRAY16BE:
2317
2318 case AV_PIX_FMT_P016BE:
2319 case AV_PIX_FMT_P216BE:
2320 case AV_PIX_FMT_P416BE:
2321 1925 *lumToYV12 = bswap16Y_c;
2322 1925 break;
2323 11 case AV_PIX_FMT_YUVA420P9BE:
2324 case AV_PIX_FMT_YUVA422P9BE:
2325 case AV_PIX_FMT_YUVA444P9BE:
2326 case AV_PIX_FMT_YUVA420P10BE:
2327 case AV_PIX_FMT_YUVA422P10BE:
2328 case AV_PIX_FMT_YUVA444P10BE:
2329 case AV_PIX_FMT_YUVA422P12BE:
2330 case AV_PIX_FMT_YUVA444P12BE:
2331 case AV_PIX_FMT_YUVA420P16BE:
2332 case AV_PIX_FMT_YUVA422P16BE:
2333 case AV_PIX_FMT_YUVA444P16BE:
2334 11 *lumToYV12 = bswap16Y_c;
2335 11 *alpToYV12 = bswap16Y_c;
2336 11 break;
2337 #endif
2338 1 case AV_PIX_FMT_YA16LE:
2339 1 *lumToYV12 = read_ya16le_gray_c;
2340 1 break;
2341 21 case AV_PIX_FMT_YA16BE:
2342 21 *lumToYV12 = read_ya16be_gray_c;
2343 21 break;
2344 9 case AV_PIX_FMT_YAF16LE:
2345 9 *lumToYV12 = read_yaf16le_gray_c;
2346 9 break;
2347 case AV_PIX_FMT_YAF16BE:
2348 *lumToYV12 = read_yaf16be_gray_c;
2349 break;
2350 113 case AV_PIX_FMT_VUYA:
2351 case AV_PIX_FMT_VUYX:
2352 113 *lumToYV12 = read_vuyx_Y_c;
2353 113 break;
2354 111 case AV_PIX_FMT_XV30LE:
2355 111 *lumToYV12 = read_xv30le_Y_c;
2356 111 break;
2357 125 case AV_PIX_FMT_V30XLE:
2358 125 *lumToYV12 = read_v30xle_Y_c;
2359 125 break;
2360 6 case AV_PIX_FMT_AYUV:
2361 case AV_PIX_FMT_UYVA:
2362 6 *lumToYV12 = read_ayuv_Y_c;
2363 6 break;
2364 132 case AV_PIX_FMT_AYUV64LE:
2365 case AV_PIX_FMT_XV48LE:
2366 132 *lumToYV12 = read_ayuv64le_Y_c;
2367 132 break;
2368 132 case AV_PIX_FMT_AYUV64BE:
2369 case AV_PIX_FMT_XV48BE:
2370 132 *lumToYV12 = read_ayuv64be_Y_c;
2371 132 break;
2372 111 case AV_PIX_FMT_XV36LE:
2373 111 *lumToYV12 = read_xv36le_Y_c;
2374 111 break;
2375 111 case AV_PIX_FMT_XV36BE:
2376 111 *lumToYV12 = read_xv36be_Y_c;
2377 111 break;
2378 245 case AV_PIX_FMT_YUYV422:
2379 case AV_PIX_FMT_YVYU422:
2380 case AV_PIX_FMT_YA8:
2381 245 *lumToYV12 = yuy2ToY_c;
2382 245 break;
2383 112 case AV_PIX_FMT_UYVY422:
2384 112 *lumToYV12 = uyvyToY_c;
2385 112 break;
2386 case AV_PIX_FMT_UYYVYY411:
2387 *lumToYV12 = uyyvyyToY_c;
2388 break;
2389 116 case AV_PIX_FMT_VYU444:
2390 116 *lumToYV12 = vyuToY_c;
2391 116 break;
2392 162 case AV_PIX_FMT_BGR24:
2393 162 *lumToYV12 = bgr24ToY_c;
2394 162 break;
2395 1 case AV_PIX_FMT_BGR565LE:
2396 1 *lumToYV12 = bgr16leToY_c;
2397 1 break;
2398 1 case AV_PIX_FMT_BGR565BE:
2399 1 *lumToYV12 = bgr16beToY_c;
2400 1 break;
2401 1 case AV_PIX_FMT_BGR555LE:
2402 1 *lumToYV12 = bgr15leToY_c;
2403 1 break;
2404 1 case AV_PIX_FMT_BGR555BE:
2405 1 *lumToYV12 = bgr15beToY_c;
2406 1 break;
2407 1 case AV_PIX_FMT_BGR444LE:
2408 1 *lumToYV12 = bgr12leToY_c;
2409 1 break;
2410 1 case AV_PIX_FMT_BGR444BE:
2411 1 *lumToYV12 = bgr12beToY_c;
2412 1 break;
2413 1139 case AV_PIX_FMT_RGB24:
2414 1139 *lumToYV12 = rgb24ToY_c;
2415 1139 break;
2416 106 case AV_PIX_FMT_RGB565LE:
2417 106 *lumToYV12 = rgb16leToY_c;
2418 106 break;
2419 1 case AV_PIX_FMT_RGB565BE:
2420 1 *lumToYV12 = rgb16beToY_c;
2421 1 break;
2422 117 case AV_PIX_FMT_RGB555LE:
2423 117 *lumToYV12 = rgb15leToY_c;
2424 117 break;
2425 1 case AV_PIX_FMT_RGB555BE:
2426 1 *lumToYV12 = rgb15beToY_c;
2427 1 break;
2428 1 case AV_PIX_FMT_RGB444LE:
2429 1 *lumToYV12 = rgb12leToY_c;
2430 1 break;
2431 1 case AV_PIX_FMT_RGB444BE:
2432 1 *lumToYV12 = rgb12beToY_c;
2433 1 break;
2434 30 case AV_PIX_FMT_RGB8:
2435 case AV_PIX_FMT_BGR8:
2436 case AV_PIX_FMT_PAL8:
2437 case AV_PIX_FMT_BGR4_BYTE:
2438 case AV_PIX_FMT_RGB4_BYTE:
2439 30 *lumToYV12 = palToY_c;
2440 30 break;
2441 112 case AV_PIX_FMT_MONOBLACK:
2442 112 *lumToYV12 = monoblack2Y_c;
2443 112 break;
2444 116 case AV_PIX_FMT_MONOWHITE:
2445 116 *lumToYV12 = monowhite2Y_c;
2446 116 break;
2447 286 case AV_PIX_FMT_RGB32:
2448 286 *lumToYV12 = bgr32ToY_c;
2449 286 break;
2450 56 case AV_PIX_FMT_RGB32_1:
2451 56 *lumToYV12 = bgr321ToY_c;
2452 56 break;
2453 114 case AV_PIX_FMT_BGR32:
2454 114 *lumToYV12 = rgb32ToY_c;
2455 114 break;
2456 66 case AV_PIX_FMT_BGR32_1:
2457 66 *lumToYV12 = rgb321ToY_c;
2458 66 break;
2459 12 case AV_PIX_FMT_RGB48BE:
2460 12 *lumToYV12 = rgb48BEToY_c;
2461 12 break;
2462 1008 case AV_PIX_FMT_RGB48LE:
2463 1008 *lumToYV12 = rgb48LEToY_c;
2464 1008 break;
2465 1 case AV_PIX_FMT_BGR48BE:
2466 1 *lumToYV12 = bgr48BEToY_c;
2467 1 break;
2468 2 case AV_PIX_FMT_BGR48LE:
2469 2 *lumToYV12 = bgr48LEToY_c;
2470 2 break;
2471 11 case AV_PIX_FMT_RGBA64BE:
2472 11 *lumToYV12 = rgb64BEToY_c;
2473 11 break;
2474 2 case AV_PIX_FMT_RGBA64LE:
2475 2 *lumToYV12 = rgb64LEToY_c;
2476 2 break;
2477 1 case AV_PIX_FMT_BGRA64BE:
2478 1 *lumToYV12 = bgr64BEToY_c;
2479 1 break;
2480 2 case AV_PIX_FMT_BGRA64LE:
2481 2 *lumToYV12 = bgr64LEToY_c;
2482 2 break;
2483 1 case AV_PIX_FMT_NV20LE:
2484 1 *lumToYV12 = nv20LEToY_c;
2485 1 break;
2486 1143 case AV_PIX_FMT_P010LE:
2487 case AV_PIX_FMT_P210LE:
2488 case AV_PIX_FMT_P410LE:
2489 1143 *lumToYV12 = p010LEToY_c;
2490 1143 break;
2491 1 case AV_PIX_FMT_NV20BE:
2492 1 *lumToYV12 = nv20BEToY_c;
2493 1 break;
2494 303 case AV_PIX_FMT_P010BE:
2495 case AV_PIX_FMT_P210BE:
2496 case AV_PIX_FMT_P410BE:
2497 303 *lumToYV12 = p010BEToY_c;
2498 303 break;
2499 1143 case AV_PIX_FMT_P012LE:
2500 case AV_PIX_FMT_P212LE:
2501 case AV_PIX_FMT_P412LE:
2502 1143 *lumToYV12 = p012LEToY_c;
2503 1143 break;
2504 303 case AV_PIX_FMT_P012BE:
2505 case AV_PIX_FMT_P212BE:
2506 case AV_PIX_FMT_P412BE:
2507 303 *lumToYV12 = p012BEToY_c;
2508 303 break;
2509 1 case AV_PIX_FMT_GRAYF32LE:
2510 1 *lumToYV12 = grayf32leToY16_c;
2511 1 break;
2512 1 case AV_PIX_FMT_GRAYF32BE:
2513 1 *lumToYV12 = grayf32beToY16_c;
2514 1 break;
2515 case AV_PIX_FMT_YAF32LE:
2516 *lumToYV12 = read_yaf32le_gray_c;
2517 break;
2518 case AV_PIX_FMT_YAF32BE:
2519 *lumToYV12 = read_yaf32be_gray_c;
2520 break;
2521 18 case AV_PIX_FMT_GRAYF16LE:
2522 18 *lumToYV12 = grayf16leToY16_c;
2523 18 break;
2524 case AV_PIX_FMT_GRAYF16BE:
2525 *lumToYV12 = grayf16beToY16_c;
2526 break;
2527 111 case AV_PIX_FMT_Y210LE:
2528 111 *lumToYV12 = y210le_Y_c;
2529 111 break;
2530 111 case AV_PIX_FMT_Y212LE:
2531 111 *lumToYV12 = y212le_Y_c;
2532 111 break;
2533 131 case AV_PIX_FMT_Y216LE:
2534 131 *lumToYV12 = y216le_Y_c;
2535 131 break;
2536 81 case AV_PIX_FMT_X2RGB10LE:
2537 81 *lumToYV12 = rgb30leToY_c;
2538 81 break;
2539 81 case AV_PIX_FMT_X2BGR10LE:
2540 81 *lumToYV12 = bgr30leToY_c;
2541 81 break;
2542 case AV_PIX_FMT_RGBAF16BE:
2543 *lumToYV12 = rgbaf16beToY_c;
2544 break;
2545 case AV_PIX_FMT_RGBAF16LE:
2546 *lumToYV12 = rgbaf16leToY_c;
2547 break;
2548 case AV_PIX_FMT_RGBF16BE:
2549 *lumToYV12 = rgbf16beToY_c;
2550 break;
2551 case AV_PIX_FMT_RGBF16LE:
2552 *lumToYV12 = rgbf16leToY_c;
2553 break;
2554 case AV_PIX_FMT_RGBF32LE:
2555 *lumToYV12 = rgbf32le_to_y_c;
2556 break;
2557 case AV_PIX_FMT_RGBF32BE:
2558 *lumToYV12 = rgbf32be_to_y_c;
2559 break;
2560 }
2561
2/2
✓ Branch 0 taken 358 times.
✓ Branch 1 taken 38172 times.
38530 if (c->needAlpha) {
2562
4/4
✓ Branch 1 taken 218 times.
✓ Branch 2 taken 140 times.
✓ Branch 4 taken 22 times.
✓ Branch 5 taken 196 times.
358 if (is16BPS(srcFormat) || isNBPS(srcFormat)) {
2563
4/4
✓ Branch 1 taken 19 times.
✓ Branch 2 taken 143 times.
✓ Branch 3 taken 15 times.
✓ Branch 4 taken 4 times.
162 if (HAVE_BIGENDIAN == !isBE(srcFormat) && !*readAlpPlanar)
2564 15 *alpToYV12 = bswap16Y_c;
2565 }
2566
13/19
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 162 times.
✓ Branch 3 taken 14 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 9 taken 9 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✓ Branch 14 taken 1 times.
✓ Branch 15 taken 1 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 161 times.
358 switch (srcFormat) {
2567 2 case AV_PIX_FMT_BGRA64LE:
2568 2 case AV_PIX_FMT_RGBA64LE: *alpToYV12 = rgba64leToA_c; break;
2569 2 case AV_PIX_FMT_BGRA64BE:
2570 2 case AV_PIX_FMT_RGBA64BE: *alpToYV12 = rgba64beToA_c; break;
2571 162 case AV_PIX_FMT_BGRA:
2572 case AV_PIX_FMT_RGBA:
2573 162 *alpToYV12 = rgbaToA_c;
2574 162 break;
2575 14 case AV_PIX_FMT_ABGR:
2576 case AV_PIX_FMT_ARGB:
2577 14 *alpToYV12 = abgrToA_c;
2578 14 break;
2579 case AV_PIX_FMT_RGBAF16BE:
2580 *alpToYV12 = rgbaf16beToA_c;
2581 break;
2582 case AV_PIX_FMT_RGBAF16LE:
2583 *alpToYV12 = rgbaf16leToA_c;
2584 break;
2585 1 case AV_PIX_FMT_YA8:
2586 1 *alpToYV12 = uyvyToY_c;
2587 1 break;
2588 1 case AV_PIX_FMT_YA16LE:
2589 1 *alpToYV12 = read_ya16le_alpha_c;
2590 1 break;
2591 1 case AV_PIX_FMT_YA16BE:
2592 1 *alpToYV12 = read_ya16be_alpha_c;
2593 1 break;
2594 9 case AV_PIX_FMT_YAF16LE:
2595 9 *alpToYV12 = read_yaf16le_alpha_c;
2596 9 break;
2597 case AV_PIX_FMT_YAF16BE:
2598 *alpToYV12 = read_yaf16be_alpha_c;
2599 break;
2600 case AV_PIX_FMT_YAF32LE:
2601 *alpToYV12 = read_yaf32le_alpha_c;
2602 break;
2603 case AV_PIX_FMT_YAF32BE:
2604 *alpToYV12 = read_yaf32be_alpha_c;
2605 break;
2606 2 case AV_PIX_FMT_VUYA:
2607 case AV_PIX_FMT_UYVA:
2608 2 *alpToYV12 = read_vuya_A_c;
2609 2 break;
2610 1 case AV_PIX_FMT_AYUV:
2611 1 *alpToYV12 = read_ayuv_A_c;
2612 1 break;
2613 1 case AV_PIX_FMT_AYUV64LE:
2614 1 *alpToYV12 = read_ayuv64le_A_c;
2615 1 break;
2616 1 case AV_PIX_FMT_AYUV64BE:
2617 1 *alpToYV12 = read_ayuv64be_A_c;
2618 1 break;
2619 case AV_PIX_FMT_PAL8 :
2620 *alpToYV12 = palToA_c;
2621 break;
2622 }
2623 }
2624 38530 }
2625