OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This webpage shows layout of YV12 and other YUV formats | 5 // This webpage shows layout of YV12 and other YUV formats |
6 // http://www.fourcc.org/yuv.php | 6 // http://www.fourcc.org/yuv.php |
7 // The actual conversion is best described here | 7 // The actual conversion is best described here |
8 // http://en.wikipedia.org/wiki/YUV | 8 // http://en.wikipedia.org/wiki/YUV |
9 // An article on optimizing YUV conversion using tables instead of multiplies | 9 // An article on optimizing YUV conversion using tables instead of multiplies |
10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf | 10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 convert_proc = &ConvertYUVToRGB32_MMX; | 581 convert_proc = &ConvertYUVToRGB32_MMX; |
582 else | 582 else |
583 convert_proc = &ConvertYUVToRGB32_C; | 583 convert_proc = &ConvertYUVToRGB32_C; |
584 } | 584 } |
585 | 585 |
586 convert_proc(yplane, uplane, vplane, rgbframe, | 586 convert_proc(yplane, uplane, vplane, rgbframe, |
587 width, height, ystride, uvstride, rgbstride, yuv_type); | 587 width, height, ystride, uvstride, rgbstride, yuv_type); |
588 #endif | 588 #endif |
589 } | 589 } |
590 | 590 |
| 591 void ConvertYUVAToARGB(const uint8* yplane, |
| 592 const uint8* uplane, |
| 593 const uint8* vplane, |
| 594 const uint8* aplane, |
| 595 uint8* rgbframe, |
| 596 int width, |
| 597 int height, |
| 598 int ystride, |
| 599 int uvstride, |
| 600 int astride, |
| 601 int rgbstride, |
| 602 YUVType yuv_type) { |
| 603 #if defined(ARCH_CPU_ARM_FAMILY) || defined(ARCH_CPU_MIPS_FAMILY) |
| 604 ConvertYUVAToARGB_C(yplane, uplane, vplane, aplane, rgbframe, |
| 605 width, height, ystride, uvstride, astride, rgbstride, |
| 606 yuv_type); |
| 607 #else |
| 608 static ConvertYUVAToARGBProc convert_proc = NULL; |
| 609 if (!convert_proc) { |
| 610 base::CPU cpu; |
| 611 if (cpu.has_mmx()) |
| 612 convert_proc = &ConvertYUVAToARGB_MMX; |
| 613 else |
| 614 convert_proc = &ConvertYUVAToARGB_C; |
| 615 } |
| 616 convert_proc(yplane, uplane, vplane, aplane, rgbframe, |
| 617 width, height, ystride, uvstride, astride, rgbstride, yuv_type); |
| 618 #endif |
| 619 } |
| 620 |
591 } // namespace media | 621 } // namespace media |
OLD | NEW |