| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 typedef void (*EmptyRegisterStateProc)(); | 120 typedef void (*EmptyRegisterStateProc)(); |
| 121 static EmptyRegisterStateProc g_empty_register_state_proc_ = NULL; | 121 static EmptyRegisterStateProc g_empty_register_state_proc_ = NULL; |
| 122 | 122 |
| 123 // Get the appropriate value to bitshift by for vertical indices. | 123 // Get the appropriate value to bitshift by for vertical indices. |
| 124 int GetVerticalShift(YUVType type) { | 124 int GetVerticalShift(YUVType type) { |
| 125 switch (type) { | 125 switch (type) { |
| 126 case YV16: | 126 case YV16: |
| 127 return 0; | 127 return 0; |
| 128 case YV12: | 128 case YV12: |
| 129 case YV12J: | 129 case YV12J: |
| 130 case YV12HD: |
| 130 return 1; | 131 return 1; |
| 131 } | 132 } |
| 132 NOTREACHED(); | 133 NOTREACHED(); |
| 133 return 0; | 134 return 0; |
| 134 } | 135 } |
| 135 | 136 |
| 136 const int16 (&GetLookupTable(YUVType type))[1024][4] { | 137 const int16 (&GetLookupTable(YUVType type))[1024][4] { |
| 137 switch (type) { | 138 switch (type) { |
| 138 case YV12: | 139 case YV12: |
| 139 case YV16: | 140 case YV16: |
| 140 return kCoefficientsRgbY; | 141 return kCoefficientsRgbY; |
| 141 case YV12J: | 142 case YV12J: |
| 142 return kCoefficientsRgbY_JPEG; | 143 return kCoefficientsRgbY_JPEG; |
| 144 case YV12HD: |
| 145 return kCoefficientsRgbY_Rec709; |
| 143 } | 146 } |
| 144 NOTREACHED(); | 147 NOTREACHED(); |
| 145 return kCoefficientsRgbY; | 148 return kCoefficientsRgbY; |
| 146 } | 149 } |
| 147 | 150 |
| 148 void InitializeCPUSpecificYUVConversions() { | 151 void InitializeCPUSpecificYUVConversions() { |
| 149 CHECK(!g_filter_yuv_rows_proc_); | 152 CHECK(!g_filter_yuv_rows_proc_); |
| 150 CHECK(!g_convert_yuv_to_rgb32_row_proc_); | 153 CHECK(!g_convert_yuv_to_rgb32_row_proc_); |
| 151 CHECK(!g_scale_yuv_to_rgb32_row_proc_); | 154 CHECK(!g_scale_yuv_to_rgb32_row_proc_); |
| 152 CHECK(!g_linear_scale_yuv_to_rgb32_row_proc_); | 155 CHECK(!g_linear_scale_yuv_to_rgb32_row_proc_); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 width, | 689 width, |
| 687 height, | 690 height, |
| 688 ystride, | 691 ystride, |
| 689 uvstride, | 692 uvstride, |
| 690 astride, | 693 astride, |
| 691 rgbstride, | 694 rgbstride, |
| 692 yuv_type); | 695 yuv_type); |
| 693 } | 696 } |
| 694 | 697 |
| 695 } // namespace media | 698 } // namespace media |
| OLD | NEW |