| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return I4xxToI420(src_y, src_stride_y, | 130 return I4xxToI420(src_y, src_stride_y, |
| 131 src_u, src_stride_u, | 131 src_u, src_stride_u, |
| 132 src_v, src_stride_v, | 132 src_v, src_stride_v, |
| 133 dst_y, dst_stride_y, | 133 dst_y, dst_stride_y, |
| 134 dst_u, dst_stride_u, | 134 dst_u, dst_stride_u, |
| 135 dst_v, dst_stride_v, | 135 dst_v, dst_stride_v, |
| 136 width, height, | 136 width, height, |
| 137 width, height); | 137 width, height); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // 411 chroma is 1/4 width, 1x height | |
| 141 // 420 chroma is 1/2 width, 1/2 height | |
| 142 LIBYUV_API | |
| 143 int I411ToI420(const uint8* src_y, int src_stride_y, | |
| 144 const uint8* src_u, int src_stride_u, | |
| 145 const uint8* src_v, int src_stride_v, | |
| 146 uint8* dst_y, int dst_stride_y, | |
| 147 uint8* dst_u, int dst_stride_u, | |
| 148 uint8* dst_v, int dst_stride_v, | |
| 149 int width, int height) { | |
| 150 const int src_uv_width = SUBSAMPLE(width, 3, 2); | |
| 151 return I4xxToI420(src_y, src_stride_y, | |
| 152 src_u, src_stride_u, | |
| 153 src_v, src_stride_v, | |
| 154 dst_y, dst_stride_y, | |
| 155 dst_u, dst_stride_u, | |
| 156 dst_v, dst_stride_v, | |
| 157 width, height, | |
| 158 src_uv_width, height); | |
| 159 } | |
| 160 | |
| 161 // I400 is greyscale typically used in MJPG | 140 // I400 is greyscale typically used in MJPG |
| 162 LIBYUV_API | 141 LIBYUV_API |
| 163 int I400ToI420(const uint8* src_y, int src_stride_y, | 142 int I400ToI420(const uint8* src_y, int src_stride_y, |
| 164 uint8* dst_y, int dst_stride_y, | 143 uint8* dst_y, int dst_stride_y, |
| 165 uint8* dst_u, int dst_stride_u, | 144 uint8* dst_u, int dst_stride_u, |
| 166 uint8* dst_v, int dst_stride_v, | 145 uint8* dst_v, int dst_stride_v, |
| 167 int width, int height) { | 146 int width, int height) { |
| 168 int halfwidth = (width + 1) >> 1; | 147 int halfwidth = (width + 1) >> 1; |
| 169 int halfheight = (height + 1) >> 1; | 148 int halfheight = (height + 1) >> 1; |
| 170 if (!dst_u || !dst_v || | 149 if (!dst_u || !dst_v || |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 dst_u += dst_stride_u; | 1417 dst_u += dst_stride_u; |
| 1439 dst_v += dst_stride_v; | 1418 dst_v += dst_stride_v; |
| 1440 } | 1419 } |
| 1441 return 0; | 1420 return 0; |
| 1442 } | 1421 } |
| 1443 | 1422 |
| 1444 #ifdef __cplusplus | 1423 #ifdef __cplusplus |
| 1445 } // extern "C" | 1424 } // extern "C" |
| 1446 } // namespace libyuv | 1425 } // namespace libyuv |
| 1447 #endif | 1426 #endif |
| OLD | NEW |