OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 LIBYUV_API | 118 LIBYUV_API |
119 int I420ToARGB(const uint8* src_y, int src_stride_y, | 119 int I420ToARGB(const uint8* src_y, int src_stride_y, |
120 const uint8* src_u, int src_stride_u, | 120 const uint8* src_u, int src_stride_u, |
121 const uint8* src_v, int src_stride_v, | 121 const uint8* src_v, int src_stride_v, |
122 uint8* dst_argb, int dst_stride_argb, | 122 uint8* dst_argb, int dst_stride_argb, |
123 int width, int height) { | 123 int width, int height) { |
124 return I420ToARGBMatrix(src_y, src_stride_y, | 124 return I420ToARGBMatrix(src_y, src_stride_y, |
125 src_u, src_stride_u, | 125 src_u, src_stride_u, |
126 src_v, src_stride_v, | 126 src_v, src_stride_v, |
127 dst_argb, dst_stride_argb, | 127 dst_argb, dst_stride_argb, |
128 &kYuvIConstants, | 128 &kYuvI601Constants, |
129 width, height); | 129 width, height); |
130 } | 130 } |
131 | 131 |
132 // Convert I420 to ABGR. | 132 // Convert I420 to ABGR. |
133 LIBYUV_API | 133 LIBYUV_API |
134 int I420ToABGR(const uint8* src_y, int src_stride_y, | 134 int I420ToABGR(const uint8* src_y, int src_stride_y, |
135 const uint8* src_u, int src_stride_u, | 135 const uint8* src_u, int src_stride_u, |
136 const uint8* src_v, int src_stride_v, | 136 const uint8* src_v, int src_stride_v, |
137 uint8* dst_abgr, int dst_stride_abgr, | 137 uint8* dst_abgr, int dst_stride_abgr, |
138 int width, int height) { | 138 int width, int height) { |
139 return I420ToARGBMatrix(src_y, src_stride_y, | 139 return I420ToARGBMatrix(src_y, src_stride_y, |
140 src_v, src_stride_v, // Swap U and V | 140 src_v, src_stride_v, // Swap U and V |
141 src_u, src_stride_u, | 141 src_u, src_stride_u, |
142 dst_abgr, dst_stride_abgr, | 142 dst_abgr, dst_stride_abgr, |
143 &kYvuIConstants, // Use Yvu matrix | 143 &kYvuI601Constants, // Use Yvu matrix |
144 width, height); | 144 width, height); |
145 } | 145 } |
146 | 146 |
147 // Convert J420 to ARGB. | 147 // Convert J420 to ARGB. |
148 LIBYUV_API | 148 LIBYUV_API |
149 int J420ToARGB(const uint8* src_y, int src_stride_y, | 149 int J420ToARGB(const uint8* src_y, int src_stride_y, |
150 const uint8* src_u, int src_stride_u, | 150 const uint8* src_u, int src_stride_u, |
151 const uint8* src_v, int src_stride_v, | 151 const uint8* src_v, int src_stride_v, |
152 uint8* dst_argb, int dst_stride_argb, | 152 uint8* dst_argb, int dst_stride_argb, |
153 int width, int height) { | 153 int width, int height) { |
154 return I420ToARGBMatrix(src_y, src_stride_y, | 154 return I420ToARGBMatrix(src_y, src_stride_y, |
155 src_u, src_stride_u, | 155 src_u, src_stride_u, |
156 src_v, src_stride_v, | 156 src_v, src_stride_v, |
157 dst_argb, dst_stride_argb, | 157 dst_argb, dst_stride_argb, |
158 &kYuvJConstants, | 158 &kYuvJPEGConstants, |
159 width, height); | 159 width, height); |
160 } | 160 } |
161 | 161 |
162 // Convert J420 to ABGR. | 162 // Convert J420 to ABGR. |
163 LIBYUV_API | 163 LIBYUV_API |
164 int J420ToABGR(const uint8* src_y, int src_stride_y, | 164 int J420ToABGR(const uint8* src_y, int src_stride_y, |
165 const uint8* src_u, int src_stride_u, | 165 const uint8* src_u, int src_stride_u, |
166 const uint8* src_v, int src_stride_v, | 166 const uint8* src_v, int src_stride_v, |
167 uint8* dst_abgr, int dst_stride_abgr, | 167 uint8* dst_abgr, int dst_stride_abgr, |
168 int width, int height) { | 168 int width, int height) { |
169 return I420ToARGBMatrix(src_y, src_stride_y, | 169 return I420ToARGBMatrix(src_y, src_stride_y, |
170 src_v, src_stride_v, // Swap U and V | 170 src_v, src_stride_v, // Swap U and V |
171 src_u, src_stride_u, | 171 src_u, src_stride_u, |
172 dst_abgr, dst_stride_abgr, | 172 dst_abgr, dst_stride_abgr, |
173 &kYvuJConstants, // Use Yvu matrix | 173 &kYvuJPEGConstants, // Use Yvu matrix |
174 width, height); | 174 width, height); |
175 } | 175 } |
176 | 176 |
177 // Convert H420 to ARGB. | 177 // Convert H420 to ARGB. |
178 LIBYUV_API | 178 LIBYUV_API |
179 int H420ToARGB(const uint8* src_y, int src_stride_y, | 179 int H420ToARGB(const uint8* src_y, int src_stride_y, |
180 const uint8* src_u, int src_stride_u, | 180 const uint8* src_u, int src_stride_u, |
181 const uint8* src_v, int src_stride_v, | 181 const uint8* src_v, int src_stride_v, |
182 uint8* dst_argb, int dst_stride_argb, | 182 uint8* dst_argb, int dst_stride_argb, |
183 int width, int height) { | 183 int width, int height) { |
184 return I420ToARGBMatrix(src_y, src_stride_y, | 184 return I420ToARGBMatrix(src_y, src_stride_y, |
185 src_u, src_stride_u, | 185 src_u, src_stride_u, |
186 src_v, src_stride_v, | 186 src_v, src_stride_v, |
187 dst_argb, dst_stride_argb, | 187 dst_argb, dst_stride_argb, |
188 &kYuvHConstants, | 188 &kYuvH709Constants, |
189 width, height); | 189 width, height); |
190 } | 190 } |
191 | 191 |
192 // Convert H420 to ABGR. | 192 // Convert H420 to ABGR. |
193 LIBYUV_API | 193 LIBYUV_API |
194 int H420ToABGR(const uint8* src_y, int src_stride_y, | 194 int H420ToABGR(const uint8* src_y, int src_stride_y, |
195 const uint8* src_u, int src_stride_u, | 195 const uint8* src_u, int src_stride_u, |
196 const uint8* src_v, int src_stride_v, | 196 const uint8* src_v, int src_stride_v, |
197 uint8* dst_abgr, int dst_stride_abgr, | 197 uint8* dst_abgr, int dst_stride_abgr, |
198 int width, int height) { | 198 int width, int height) { |
199 return I420ToARGBMatrix(src_y, src_stride_y, | 199 return I420ToARGBMatrix(src_y, src_stride_y, |
200 src_v, src_stride_v, // Swap U and V | 200 src_v, src_stride_v, // Swap U and V |
201 src_u, src_stride_u, | 201 src_u, src_stride_u, |
202 dst_abgr, dst_stride_abgr, | 202 dst_abgr, dst_stride_abgr, |
203 &kYvuHConstants, // Use Yvu matrix | 203 &kYvuH709Constants, // Use Yvu matrix |
204 width, height); | 204 width, height); |
205 } | 205 } |
206 | 206 |
207 // Convert I422 to ARGB with matrix | 207 // Convert I422 to ARGB with matrix |
208 static int I422ToARGBMatrix(const uint8* src_y, int src_stride_y, | 208 static int I422ToARGBMatrix(const uint8* src_y, int src_stride_y, |
209 const uint8* src_u, int src_stride_u, | 209 const uint8* src_u, int src_stride_u, |
210 const uint8* src_v, int src_stride_v, | 210 const uint8* src_v, int src_stride_v, |
211 uint8* dst_argb, int dst_stride_argb, | 211 uint8* dst_argb, int dst_stride_argb, |
212 const struct YuvConstants* yuvconstants, | 212 const struct YuvConstants* yuvconstants, |
213 int width, int height) { | 213 int width, int height) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 LIBYUV_API | 286 LIBYUV_API |
287 int I422ToARGB(const uint8* src_y, int src_stride_y, | 287 int I422ToARGB(const uint8* src_y, int src_stride_y, |
288 const uint8* src_u, int src_stride_u, | 288 const uint8* src_u, int src_stride_u, |
289 const uint8* src_v, int src_stride_v, | 289 const uint8* src_v, int src_stride_v, |
290 uint8* dst_argb, int dst_stride_argb, | 290 uint8* dst_argb, int dst_stride_argb, |
291 int width, int height) { | 291 int width, int height) { |
292 return I422ToARGBMatrix(src_y, src_stride_y, | 292 return I422ToARGBMatrix(src_y, src_stride_y, |
293 src_u, src_stride_u, | 293 src_u, src_stride_u, |
294 src_v, src_stride_v, | 294 src_v, src_stride_v, |
295 dst_argb, dst_stride_argb, | 295 dst_argb, dst_stride_argb, |
296 &kYuvIConstants, | 296 &kYuvI601Constants, |
297 width, height); | 297 width, height); |
298 } | 298 } |
299 | 299 |
300 // Convert I422 to ABGR. | 300 // Convert I422 to ABGR. |
301 LIBYUV_API | 301 LIBYUV_API |
302 int I422ToABGR(const uint8* src_y, int src_stride_y, | 302 int I422ToABGR(const uint8* src_y, int src_stride_y, |
303 const uint8* src_u, int src_stride_u, | 303 const uint8* src_u, int src_stride_u, |
304 const uint8* src_v, int src_stride_v, | 304 const uint8* src_v, int src_stride_v, |
305 uint8* dst_abgr, int dst_stride_abgr, | 305 uint8* dst_abgr, int dst_stride_abgr, |
306 int width, int height) { | 306 int width, int height) { |
307 return I422ToARGBMatrix(src_y, src_stride_y, | 307 return I422ToARGBMatrix(src_y, src_stride_y, |
308 src_v, src_stride_v, // Swap U and V | 308 src_v, src_stride_v, // Swap U and V |
309 src_u, src_stride_u, | 309 src_u, src_stride_u, |
310 dst_abgr, dst_stride_abgr, | 310 dst_abgr, dst_stride_abgr, |
311 &kYvuIConstants, // Use Yvu matrix | 311 &kYvuI601Constants, // Use Yvu matrix |
312 width, height); | 312 width, height); |
313 } | 313 } |
314 | 314 |
315 // Convert J422 to ARGB. | 315 // Convert J422 to ARGB. |
316 LIBYUV_API | 316 LIBYUV_API |
317 int J422ToARGB(const uint8* src_y, int src_stride_y, | 317 int J422ToARGB(const uint8* src_y, int src_stride_y, |
318 const uint8* src_u, int src_stride_u, | 318 const uint8* src_u, int src_stride_u, |
319 const uint8* src_v, int src_stride_v, | 319 const uint8* src_v, int src_stride_v, |
320 uint8* dst_argb, int dst_stride_argb, | 320 uint8* dst_argb, int dst_stride_argb, |
321 int width, int height) { | 321 int width, int height) { |
322 return I422ToARGBMatrix(src_y, src_stride_y, | 322 return I422ToARGBMatrix(src_y, src_stride_y, |
323 src_u, src_stride_u, | 323 src_u, src_stride_u, |
324 src_v, src_stride_v, | 324 src_v, src_stride_v, |
325 dst_argb, dst_stride_argb, | 325 dst_argb, dst_stride_argb, |
326 &kYuvJConstants, | 326 &kYuvJPEGConstants, |
327 width, height); | 327 width, height); |
328 } | 328 } |
329 | 329 |
330 // Convert J422 to ABGR. | 330 // Convert J422 to ABGR. |
331 LIBYUV_API | 331 LIBYUV_API |
332 int J422ToABGR(const uint8* src_y, int src_stride_y, | 332 int J422ToABGR(const uint8* src_y, int src_stride_y, |
333 const uint8* src_u, int src_stride_u, | 333 const uint8* src_u, int src_stride_u, |
334 const uint8* src_v, int src_stride_v, | 334 const uint8* src_v, int src_stride_v, |
335 uint8* dst_abgr, int dst_stride_abgr, | 335 uint8* dst_abgr, int dst_stride_abgr, |
336 int width, int height) { | 336 int width, int height) { |
337 return I422ToARGBMatrix(src_y, src_stride_y, | 337 return I422ToARGBMatrix(src_y, src_stride_y, |
338 src_v, src_stride_v, // Swap U and V | 338 src_v, src_stride_v, // Swap U and V |
339 src_u, src_stride_u, | 339 src_u, src_stride_u, |
340 dst_abgr, dst_stride_abgr, | 340 dst_abgr, dst_stride_abgr, |
341 &kYvuJConstants, // Use Yvu matrix | 341 &kYvuJPEGConstants, // Use Yvu matrix |
342 width, height); | 342 width, height); |
343 } | 343 } |
344 | 344 |
345 // Convert H422 to ARGB. | 345 // Convert H422 to ARGB. |
346 LIBYUV_API | 346 LIBYUV_API |
347 int H422ToARGB(const uint8* src_y, int src_stride_y, | 347 int H422ToARGB(const uint8* src_y, int src_stride_y, |
348 const uint8* src_u, int src_stride_u, | 348 const uint8* src_u, int src_stride_u, |
349 const uint8* src_v, int src_stride_v, | 349 const uint8* src_v, int src_stride_v, |
350 uint8* dst_argb, int dst_stride_argb, | 350 uint8* dst_argb, int dst_stride_argb, |
351 int width, int height) { | 351 int width, int height) { |
352 return I422ToARGBMatrix(src_y, src_stride_y, | 352 return I422ToARGBMatrix(src_y, src_stride_y, |
353 src_u, src_stride_u, | 353 src_u, src_stride_u, |
354 src_v, src_stride_v, | 354 src_v, src_stride_v, |
355 dst_argb, dst_stride_argb, | 355 dst_argb, dst_stride_argb, |
356 &kYuvHConstants, | 356 &kYuvH709Constants, |
357 width, height); | 357 width, height); |
358 } | 358 } |
359 | 359 |
360 // Convert H422 to ABGR. | 360 // Convert H422 to ABGR. |
361 LIBYUV_API | 361 LIBYUV_API |
362 int H422ToABGR(const uint8* src_y, int src_stride_y, | 362 int H422ToABGR(const uint8* src_y, int src_stride_y, |
363 const uint8* src_u, int src_stride_u, | 363 const uint8* src_u, int src_stride_u, |
364 const uint8* src_v, int src_stride_v, | 364 const uint8* src_v, int src_stride_v, |
365 uint8* dst_abgr, int dst_stride_abgr, | 365 uint8* dst_abgr, int dst_stride_abgr, |
366 int width, int height) { | 366 int width, int height) { |
367 return I422ToARGBMatrix(src_y, src_stride_y, | 367 return I422ToARGBMatrix(src_y, src_stride_y, |
368 src_v, src_stride_v, // Swap U and V | 368 src_v, src_stride_v, // Swap U and V |
369 src_u, src_stride_u, | 369 src_u, src_stride_u, |
370 dst_abgr, dst_stride_abgr, | 370 dst_abgr, dst_stride_abgr, |
371 &kYvuHConstants, // Use Yvu matrix | 371 &kYvuH709Constants, // Use Yvu matrix |
372 width, height); | 372 width, height); |
373 } | 373 } |
374 | 374 |
375 // Convert I444 to ARGB with matrix | 375 // Convert I444 to ARGB with matrix |
376 static int I444ToARGBMatrix(const uint8* src_y, int src_stride_y, | 376 static int I444ToARGBMatrix(const uint8* src_y, int src_stride_y, |
377 const uint8* src_u, int src_stride_u, | 377 const uint8* src_u, int src_stride_u, |
378 const uint8* src_v, int src_stride_v, | 378 const uint8* src_v, int src_stride_v, |
379 uint8* dst_argb, int dst_stride_argb, | 379 uint8* dst_argb, int dst_stride_argb, |
380 const struct YuvConstants* yuvconstants, | 380 const struct YuvConstants* yuvconstants, |
381 int width, int height) { | 381 int width, int height) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 LIBYUV_API | 445 LIBYUV_API |
446 int I444ToARGB(const uint8* src_y, int src_stride_y, | 446 int I444ToARGB(const uint8* src_y, int src_stride_y, |
447 const uint8* src_u, int src_stride_u, | 447 const uint8* src_u, int src_stride_u, |
448 const uint8* src_v, int src_stride_v, | 448 const uint8* src_v, int src_stride_v, |
449 uint8* dst_argb, int dst_stride_argb, | 449 uint8* dst_argb, int dst_stride_argb, |
450 int width, int height) { | 450 int width, int height) { |
451 return I444ToARGBMatrix(src_y, src_stride_y, | 451 return I444ToARGBMatrix(src_y, src_stride_y, |
452 src_u, src_stride_u, | 452 src_u, src_stride_u, |
453 src_v, src_stride_v, | 453 src_v, src_stride_v, |
454 dst_argb, dst_stride_argb, | 454 dst_argb, dst_stride_argb, |
455 &kYuvIConstants, | 455 &kYuvI601Constants, |
456 width, height); | 456 width, height); |
457 } | 457 } |
458 | 458 |
459 // Convert I444 to ABGR. | 459 // Convert I444 to ABGR. |
460 LIBYUV_API | 460 LIBYUV_API |
461 int I444ToABGR(const uint8* src_y, int src_stride_y, | 461 int I444ToABGR(const uint8* src_y, int src_stride_y, |
462 const uint8* src_u, int src_stride_u, | 462 const uint8* src_u, int src_stride_u, |
463 const uint8* src_v, int src_stride_v, | 463 const uint8* src_v, int src_stride_v, |
464 uint8* dst_abgr, int dst_stride_abgr, | 464 uint8* dst_abgr, int dst_stride_abgr, |
465 int width, int height) { | 465 int width, int height) { |
466 return I444ToARGBMatrix(src_y, src_stride_y, | 466 return I444ToARGBMatrix(src_y, src_stride_y, |
467 src_v, src_stride_v, // Swap U and V | 467 src_v, src_stride_v, // Swap U and V |
468 src_u, src_stride_u, | 468 src_u, src_stride_u, |
469 dst_abgr, dst_stride_abgr, | 469 dst_abgr, dst_stride_abgr, |
470 &kYvuIConstants, // Use Yvu matrix | 470 &kYvuI601Constants, // Use Yvu matrix |
471 width, height); | 471 width, height); |
472 } | 472 } |
473 | 473 |
474 // Convert J444 to ARGB. | 474 // Convert J444 to ARGB. |
475 LIBYUV_API | 475 LIBYUV_API |
476 int J444ToARGB(const uint8* src_y, int src_stride_y, | 476 int J444ToARGB(const uint8* src_y, int src_stride_y, |
477 const uint8* src_u, int src_stride_u, | 477 const uint8* src_u, int src_stride_u, |
478 const uint8* src_v, int src_stride_v, | 478 const uint8* src_v, int src_stride_v, |
479 uint8* dst_argb, int dst_stride_argb, | 479 uint8* dst_argb, int dst_stride_argb, |
480 int width, int height) { | 480 int width, int height) { |
481 return I444ToARGBMatrix(src_y, src_stride_y, | 481 return I444ToARGBMatrix(src_y, src_stride_y, |
482 src_u, src_stride_u, | 482 src_u, src_stride_u, |
483 src_v, src_stride_v, | 483 src_v, src_stride_v, |
484 dst_argb, dst_stride_argb, | 484 dst_argb, dst_stride_argb, |
485 &kYuvJConstants, | 485 &kYuvJPEGConstants, |
486 width, height); | 486 width, height); |
487 } | 487 } |
488 | 488 |
489 // Convert I411 to ARGB. | 489 // Convert I411 to ARGB. |
490 LIBYUV_API | 490 LIBYUV_API |
491 int I411ToARGB(const uint8* src_y, int src_stride_y, | 491 int I411ToARGB(const uint8* src_y, int src_stride_y, |
492 const uint8* src_u, int src_stride_u, | 492 const uint8* src_u, int src_stride_u, |
493 const uint8* src_v, int src_stride_v, | 493 const uint8* src_v, int src_stride_v, |
494 uint8* dst_argb, int dst_stride_argb, | 494 uint8* dst_argb, int dst_stride_argb, |
495 int width, int height) { | 495 int width, int height) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 #if defined(HAS_I411TOARGBROW_NEON) | 539 #if defined(HAS_I411TOARGBROW_NEON) |
540 if (TestCpuFlag(kCpuHasNEON)) { | 540 if (TestCpuFlag(kCpuHasNEON)) { |
541 I411ToARGBRow = I411ToARGBRow_Any_NEON; | 541 I411ToARGBRow = I411ToARGBRow_Any_NEON; |
542 if (IS_ALIGNED(width, 8)) { | 542 if (IS_ALIGNED(width, 8)) { |
543 I411ToARGBRow = I411ToARGBRow_NEON; | 543 I411ToARGBRow = I411ToARGBRow_NEON; |
544 } | 544 } |
545 } | 545 } |
546 #endif | 546 #endif |
547 | 547 |
548 for (y = 0; y < height; ++y) { | 548 for (y = 0; y < height; ++y) { |
549 I411ToARGBRow(src_y, src_u, src_v, dst_argb, &kYuvIConstants, width); | 549 I411ToARGBRow(src_y, src_u, src_v, dst_argb, &kYuvI601Constants, width); |
550 dst_argb += dst_stride_argb; | 550 dst_argb += dst_stride_argb; |
551 src_y += src_stride_y; | 551 src_y += src_stride_y; |
552 src_u += src_stride_u; | 552 src_u += src_stride_u; |
553 src_v += src_stride_v; | 553 src_v += src_stride_v; |
554 } | 554 } |
555 return 0; | 555 return 0; |
556 } | 556 } |
557 | 557 |
558 // Convert I420 with Alpha to preattenuated ARGB. | 558 // Convert I420 with Alpha to preattenuated ARGB. |
559 static int I420AlphaToARGBMatrix(const uint8* src_y, int src_stride_y, | 559 static int I420AlphaToARGBMatrix(const uint8* src_y, int src_stride_y, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 const uint8* src_u, int src_stride_u, | 664 const uint8* src_u, int src_stride_u, |
665 const uint8* src_v, int src_stride_v, | 665 const uint8* src_v, int src_stride_v, |
666 const uint8* src_a, int src_stride_a, | 666 const uint8* src_a, int src_stride_a, |
667 uint8* dst_argb, int dst_stride_argb, | 667 uint8* dst_argb, int dst_stride_argb, |
668 int width, int height, int attenuate) { | 668 int width, int height, int attenuate) { |
669 return I420AlphaToARGBMatrix(src_y, src_stride_y, | 669 return I420AlphaToARGBMatrix(src_y, src_stride_y, |
670 src_u, src_stride_u, | 670 src_u, src_stride_u, |
671 src_v, src_stride_v, | 671 src_v, src_stride_v, |
672 src_a, src_stride_a, | 672 src_a, src_stride_a, |
673 dst_argb, dst_stride_argb, | 673 dst_argb, dst_stride_argb, |
674 &kYuvIConstants, | 674 &kYuvI601Constants, |
675 width, height, attenuate); | 675 width, height, attenuate); |
676 } | 676 } |
677 | 677 |
678 // Convert I420 with Alpha to ABGR. | 678 // Convert I420 with Alpha to ABGR. |
679 LIBYUV_API | 679 LIBYUV_API |
680 int I420AlphaToABGR(const uint8* src_y, int src_stride_y, | 680 int I420AlphaToABGR(const uint8* src_y, int src_stride_y, |
681 const uint8* src_u, int src_stride_u, | 681 const uint8* src_u, int src_stride_u, |
682 const uint8* src_v, int src_stride_v, | 682 const uint8* src_v, int src_stride_v, |
683 const uint8* src_a, int src_stride_a, | 683 const uint8* src_a, int src_stride_a, |
684 uint8* dst_abgr, int dst_stride_abgr, | 684 uint8* dst_abgr, int dst_stride_abgr, |
685 int width, int height, int attenuate) { | 685 int width, int height, int attenuate) { |
686 return I420AlphaToARGBMatrix(src_y, src_stride_y, | 686 return I420AlphaToARGBMatrix(src_y, src_stride_y, |
687 src_v, src_stride_v, // Swap U and V | 687 src_v, src_stride_v, // Swap U and V |
688 src_u, src_stride_u, | 688 src_u, src_stride_u, |
689 src_a, src_stride_a, | 689 src_a, src_stride_a, |
690 dst_abgr, dst_stride_abgr, | 690 dst_abgr, dst_stride_abgr, |
691 &kYvuIConstants, // Use Yvu matrix | 691 &kYvuI601Constants, // Use Yvu matrix |
692 width, height, attenuate); | 692 width, height, attenuate); |
693 } | 693 } |
694 | 694 |
695 // Convert I400 to ARGB. | 695 // Convert I400 to ARGB. |
696 LIBYUV_API | 696 LIBYUV_API |
697 int I400ToARGB(const uint8* src_y, int src_stride_y, | 697 int I400ToARGB(const uint8* src_y, int src_stride_y, |
698 uint8* dst_argb, int dst_stride_argb, | 698 uint8* dst_argb, int dst_stride_argb, |
699 int width, int height) { | 699 int width, int height) { |
700 int y; | 700 int y; |
701 void (*I400ToARGBRow)(const uint8* y_buf, | 701 void (*I400ToARGBRow)(const uint8* y_buf, |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 #if defined(HAS_NV12TOARGBROW_NEON) | 1193 #if defined(HAS_NV12TOARGBROW_NEON) |
1194 if (TestCpuFlag(kCpuHasNEON)) { | 1194 if (TestCpuFlag(kCpuHasNEON)) { |
1195 NV12ToARGBRow = NV12ToARGBRow_Any_NEON; | 1195 NV12ToARGBRow = NV12ToARGBRow_Any_NEON; |
1196 if (IS_ALIGNED(width, 8)) { | 1196 if (IS_ALIGNED(width, 8)) { |
1197 NV12ToARGBRow = NV12ToARGBRow_NEON; | 1197 NV12ToARGBRow = NV12ToARGBRow_NEON; |
1198 } | 1198 } |
1199 } | 1199 } |
1200 #endif | 1200 #endif |
1201 | 1201 |
1202 for (y = 0; y < height; ++y) { | 1202 for (y = 0; y < height; ++y) { |
1203 NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvIConstants, width); | 1203 NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width); |
1204 dst_argb += dst_stride_argb; | 1204 dst_argb += dst_stride_argb; |
1205 src_y += src_stride_y; | 1205 src_y += src_stride_y; |
1206 if (y & 1) { | 1206 if (y & 1) { |
1207 src_uv += src_stride_uv; | 1207 src_uv += src_stride_uv; |
1208 } | 1208 } |
1209 } | 1209 } |
1210 return 0; | 1210 return 0; |
1211 } | 1211 } |
1212 | 1212 |
1213 // Convert NV21 to ARGB. | 1213 // Convert NV21 to ARGB. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 #if defined(HAS_NV21TOARGBROW_NEON) | 1251 #if defined(HAS_NV21TOARGBROW_NEON) |
1252 if (TestCpuFlag(kCpuHasNEON)) { | 1252 if (TestCpuFlag(kCpuHasNEON)) { |
1253 NV21ToARGBRow = NV21ToARGBRow_Any_NEON; | 1253 NV21ToARGBRow = NV21ToARGBRow_Any_NEON; |
1254 if (IS_ALIGNED(width, 8)) { | 1254 if (IS_ALIGNED(width, 8)) { |
1255 NV21ToARGBRow = NV21ToARGBRow_NEON; | 1255 NV21ToARGBRow = NV21ToARGBRow_NEON; |
1256 } | 1256 } |
1257 } | 1257 } |
1258 #endif | 1258 #endif |
1259 | 1259 |
1260 for (y = 0; y < height; ++y) { | 1260 for (y = 0; y < height; ++y) { |
1261 NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvIConstants, width); | 1261 NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width); |
1262 dst_argb += dst_stride_argb; | 1262 dst_argb += dst_stride_argb; |
1263 src_y += src_stride_y; | 1263 src_y += src_stride_y; |
1264 if (y & 1) { | 1264 if (y & 1) { |
1265 src_uv += src_stride_uv; | 1265 src_uv += src_stride_uv; |
1266 } | 1266 } |
1267 } | 1267 } |
1268 return 0; | 1268 return 0; |
1269 } | 1269 } |
1270 | 1270 |
1271 // Convert M420 to ARGB. | 1271 // Convert M420 to ARGB. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 if (TestCpuFlag(kCpuHasNEON)) { | 1309 if (TestCpuFlag(kCpuHasNEON)) { |
1310 NV12ToARGBRow = NV12ToARGBRow_Any_NEON; | 1310 NV12ToARGBRow = NV12ToARGBRow_Any_NEON; |
1311 if (IS_ALIGNED(width, 8)) { | 1311 if (IS_ALIGNED(width, 8)) { |
1312 NV12ToARGBRow = NV12ToARGBRow_NEON; | 1312 NV12ToARGBRow = NV12ToARGBRow_NEON; |
1313 } | 1313 } |
1314 } | 1314 } |
1315 #endif | 1315 #endif |
1316 | 1316 |
1317 for (y = 0; y < height - 1; y += 2) { | 1317 for (y = 0; y < height - 1; y += 2) { |
1318 NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, | 1318 NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, |
1319 &kYuvIConstants, width); | 1319 &kYuvI601Constants, width); |
1320 NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2, | 1320 NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2, |
1321 dst_argb + dst_stride_argb, &kYuvIConstants, width); | 1321 dst_argb + dst_stride_argb, &kYuvI601Constants, width); |
1322 dst_argb += dst_stride_argb * 2; | 1322 dst_argb += dst_stride_argb * 2; |
1323 src_m420 += src_stride_m420 * 3; | 1323 src_m420 += src_stride_m420 * 3; |
1324 } | 1324 } |
1325 if (height & 1) { | 1325 if (height & 1) { |
1326 NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, | 1326 NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, |
1327 &kYuvIConstants, width); | 1327 &kYuvI601Constants, width); |
1328 } | 1328 } |
1329 return 0; | 1329 return 0; |
1330 } | 1330 } |
1331 | 1331 |
1332 // Convert YUY2 to ARGB. | 1332 // Convert YUY2 to ARGB. |
1333 LIBYUV_API | 1333 LIBYUV_API |
1334 int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, | 1334 int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, |
1335 uint8* dst_argb, int dst_stride_argb, | 1335 uint8* dst_argb, int dst_stride_argb, |
1336 int width, int height) { | 1336 int width, int height) { |
1337 int y; | 1337 int y; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 #endif | 1375 #endif |
1376 #if defined(HAS_YUY2TOARGBROW_NEON) | 1376 #if defined(HAS_YUY2TOARGBROW_NEON) |
1377 if (TestCpuFlag(kCpuHasNEON)) { | 1377 if (TestCpuFlag(kCpuHasNEON)) { |
1378 YUY2ToARGBRow = YUY2ToARGBRow_Any_NEON; | 1378 YUY2ToARGBRow = YUY2ToARGBRow_Any_NEON; |
1379 if (IS_ALIGNED(width, 8)) { | 1379 if (IS_ALIGNED(width, 8)) { |
1380 YUY2ToARGBRow = YUY2ToARGBRow_NEON; | 1380 YUY2ToARGBRow = YUY2ToARGBRow_NEON; |
1381 } | 1381 } |
1382 } | 1382 } |
1383 #endif | 1383 #endif |
1384 for (y = 0; y < height; ++y) { | 1384 for (y = 0; y < height; ++y) { |
1385 YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvIConstants, width); | 1385 YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvI601Constants, width); |
1386 src_yuy2 += src_stride_yuy2; | 1386 src_yuy2 += src_stride_yuy2; |
1387 dst_argb += dst_stride_argb; | 1387 dst_argb += dst_stride_argb; |
1388 } | 1388 } |
1389 return 0; | 1389 return 0; |
1390 } | 1390 } |
1391 | 1391 |
1392 // Convert UYVY to ARGB. | 1392 // Convert UYVY to ARGB. |
1393 LIBYUV_API | 1393 LIBYUV_API |
1394 int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, | 1394 int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, |
1395 uint8* dst_argb, int dst_stride_argb, | 1395 uint8* dst_argb, int dst_stride_argb, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 #endif | 1435 #endif |
1436 #if defined(HAS_UYVYTOARGBROW_NEON) | 1436 #if defined(HAS_UYVYTOARGBROW_NEON) |
1437 if (TestCpuFlag(kCpuHasNEON)) { | 1437 if (TestCpuFlag(kCpuHasNEON)) { |
1438 UYVYToARGBRow = UYVYToARGBRow_Any_NEON; | 1438 UYVYToARGBRow = UYVYToARGBRow_Any_NEON; |
1439 if (IS_ALIGNED(width, 8)) { | 1439 if (IS_ALIGNED(width, 8)) { |
1440 UYVYToARGBRow = UYVYToARGBRow_NEON; | 1440 UYVYToARGBRow = UYVYToARGBRow_NEON; |
1441 } | 1441 } |
1442 } | 1442 } |
1443 #endif | 1443 #endif |
1444 for (y = 0; y < height; ++y) { | 1444 for (y = 0; y < height; ++y) { |
1445 UYVYToARGBRow(src_uyvy, dst_argb, &kYuvIConstants, width); | 1445 UYVYToARGBRow(src_uyvy, dst_argb, &kYuvI601Constants, width); |
1446 src_uyvy += src_stride_uyvy; | 1446 src_uyvy += src_stride_uyvy; |
1447 dst_argb += dst_stride_argb; | 1447 dst_argb += dst_stride_argb; |
1448 } | 1448 } |
1449 return 0; | 1449 return 0; |
1450 } | 1450 } |
1451 | 1451 |
1452 #ifdef __cplusplus | 1452 #ifdef __cplusplus |
1453 } // extern "C" | 1453 } // extern "C" |
1454 } // namespace libyuv | 1454 } // namespace libyuv |
1455 #endif | 1455 #endif |
OLD | NEW |