| 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 #include "media/base/simd/convert_yuv_to_rgb.h" | 5 #include "media/base/simd/convert_yuv_to_rgb.h" |
| 6 #include "media/base/simd/yuv_to_rgb_table.h" | 6 #include "media/base/simd/yuv_to_rgb_table.h" |
| 7 | 7 |
| 8 namespace media { | 8 namespace media { |
| 9 | 9 |
| 10 #define packuswb(x) ((x) < 0 ? 0 : ((x) > 255 ? 255 : (x))) | 10 #define packuswb(x) ((x) < 0 ? 0 : ((x) > 255 ? 255 : (x))) |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 void ConvertYUVToRGB32_C(const uint8* yplane, | 211 void ConvertYUVToRGB32_C(const uint8* yplane, |
| 212 const uint8* uplane, | 212 const uint8* uplane, |
| 213 const uint8* vplane, | 213 const uint8* vplane, |
| 214 uint8* rgbframe, | 214 uint8* rgbframe, |
| 215 int width, | 215 int width, |
| 216 int height, | 216 int height, |
| 217 int ystride, | 217 int ystride, |
| 218 int uvstride, | 218 int uvstride, |
| 219 int rgbstride, | 219 int rgbstride, |
| 220 YUVType yuv_type) { | 220 YUVType yuv_type, |
| 221 YUVRange yuv_range) { |
| 221 unsigned int y_shift = yuv_type; | 222 unsigned int y_shift = yuv_type; |
| 222 for (int y = 0; y < height; ++y) { | 223 for (int y = 0; y < height; ++y) { |
| 223 uint8* rgb_row = rgbframe + y * rgbstride; | 224 uint8* rgb_row = rgbframe + y * rgbstride; |
| 224 const uint8* y_ptr = yplane + y * ystride; | 225 const uint8* y_ptr = yplane + y * ystride; |
| 225 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; | 226 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; |
| 226 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; | 227 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; |
| 227 | 228 |
| 228 ConvertYUVToRGB32Row_C(y_ptr, | 229 ConvertYUVToRGB32Row_C(y_ptr, |
| 229 u_ptr, | 230 u_ptr, |
| 230 v_ptr, | 231 v_ptr, |
| 231 rgb_row, | 232 rgb_row, |
| 232 width); | 233 width); |
| 233 } | 234 } |
| 234 } | 235 } |
| 235 | 236 |
| 236 void ConvertYUVAToARGB_C(const uint8* yplane, | 237 void ConvertYUVAToARGB_C(const uint8* yplane, |
| 237 const uint8* uplane, | 238 const uint8* uplane, |
| 238 const uint8* vplane, | 239 const uint8* vplane, |
| 239 const uint8* aplane, | 240 const uint8* aplane, |
| 240 uint8* rgbaframe, | 241 uint8* rgbaframe, |
| 241 int width, | 242 int width, |
| 242 int height, | 243 int height, |
| 243 int ystride, | 244 int ystride, |
| 244 int uvstride, | 245 int uvstride, |
| 245 int astride, | 246 int astride, |
| 246 int rgbastride, | 247 int rgbastride, |
| 247 YUVType yuv_type) { | 248 YUVType yuv_type, |
| 249 YUVRange yuv_range) { |
| 248 unsigned int y_shift = yuv_type; | 250 unsigned int y_shift = yuv_type; |
| 249 for (int y = 0; y < height; y++) { | 251 for (int y = 0; y < height; y++) { |
| 250 uint8* rgba_row = rgbaframe + y * rgbastride; | 252 uint8* rgba_row = rgbaframe + y * rgbastride; |
| 251 const uint8* y_ptr = yplane + y * ystride; | 253 const uint8* y_ptr = yplane + y * ystride; |
| 252 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; | 254 const uint8* u_ptr = uplane + (y >> y_shift) * uvstride; |
| 253 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; | 255 const uint8* v_ptr = vplane + (y >> y_shift) * uvstride; |
| 254 const uint8* a_ptr = aplane + y * astride; | 256 const uint8* a_ptr = aplane + y * astride; |
| 255 | 257 |
| 256 ConvertYUVAToARGBRow_C(y_ptr, | 258 ConvertYUVAToARGBRow_C(y_ptr, |
| 257 u_ptr, | 259 u_ptr, |
| 258 v_ptr, | 260 v_ptr, |
| 259 a_ptr, | 261 a_ptr, |
| 260 rgba_row, | 262 rgba_row, |
| 261 width); | 263 width); |
| 262 } | 264 } |
| 263 } | 265 } |
| 264 | 266 |
| 265 } // namespace media | 267 } // namespace media |
| OLD | NEW |