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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 convert_proc = &ConvertYUVToRGB32_MMX; | 596 convert_proc = &ConvertYUVToRGB32_MMX; |
597 else | 597 else |
598 convert_proc = &ConvertYUVToRGB32_C; | 598 convert_proc = &ConvertYUVToRGB32_C; |
599 } | 599 } |
600 | 600 |
601 convert_proc(yplane, uplane, vplane, rgbframe, | 601 convert_proc(yplane, uplane, vplane, rgbframe, |
602 width, height, ystride, uvstride, rgbstride, yuv_type); | 602 width, height, ystride, uvstride, rgbstride, yuv_type); |
603 #endif | 603 #endif |
604 } | 604 } |
605 | 605 |
606 void ConvertYUVAToARGB(const uint8* yplane, | |
607 const uint8* uplane, | |
608 const uint8* vplane, | |
609 const uint8* aplane, | |
610 uint8* rgbframe, | |
611 int width, | |
612 int height, | |
613 int ystride, | |
614 int uvstride, | |
615 int astride, | |
616 int rgbstride, | |
617 YUVType yuv_type) { | |
618 #if defined(ARCH_CPU_ARM_FAMILY) || defined(ARCH_CPU_MIPS_FAMILY) | |
619 ConvertYUVAToARGB_C(yplane, uplane, vplane, aplane, rgbframe, | |
620 width, height, ystride, uvstride, astride, rgbstride, | |
621 yuv_type); | |
622 #else | |
623 static ConvertYUVAToARGBProc convert_proc = NULL; | |
624 if (!convert_proc) { | |
625 base::CPU cpu; | |
626 if (cpu.has_mmx()) | |
627 convert_proc = &ConvertYUVAToARGB_MMX; | |
628 else | |
629 convert_proc = &ConvertYUVAToARGB_C; | |
630 } | |
631 convert_proc(yplane, uplane, vplane, aplane, rgbframe, | |
632 width, height, ystride, uvstride, astride, rgbstride, yuv_type); | |
633 #endif | |
634 } | |
635 | |
636 } // namespace media | 606 } // namespace media |
OLD | NEW |