| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2012 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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 dst_sample_stride ? dst_sample_stride : width, | 1070 dst_sample_stride ? dst_sample_stride : width, |
| 1071 dst_vu, | 1071 dst_vu, |
| 1072 dst_sample_stride ? dst_sample_stride : width, | 1072 dst_sample_stride ? dst_sample_stride : width, |
| 1073 width, height); | 1073 width, height); |
| 1074 break; | 1074 break; |
| 1075 } | 1075 } |
| 1076 // TODO(fbarchard): Add M420. | 1076 // TODO(fbarchard): Add M420. |
| 1077 // Triplanar formats | 1077 // Triplanar formats |
| 1078 // TODO(fbarchard): halfstride instead of halfwidth | 1078 // TODO(fbarchard): halfstride instead of halfwidth |
| 1079 case FOURCC_I420: | 1079 case FOURCC_I420: |
| 1080 case FOURCC_YU12: | |
| 1081 case FOURCC_YV12: { | 1080 case FOURCC_YV12: { |
| 1082 int halfwidth = (width + 1) / 2; | 1081 int halfwidth = (width + 1) / 2; |
| 1083 int halfheight = (height + 1) / 2; | 1082 int halfheight = (height + 1) / 2; |
| 1084 uint8* dst_u; | 1083 uint8* dst_u; |
| 1085 uint8* dst_v; | 1084 uint8* dst_v; |
| 1086 if (format == FOURCC_YV12) { | 1085 if (format == FOURCC_YV12) { |
| 1087 dst_v = dst_sample + width * height; | 1086 dst_v = dst_sample + width * height; |
| 1088 dst_u = dst_v + halfwidth * halfheight; | 1087 dst_u = dst_v + halfwidth * halfheight; |
| 1089 } else { | 1088 } else { |
| 1090 dst_u = dst_sample + width * height; | 1089 dst_u = dst_sample + width * height; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 default: | 1157 default: |
| 1159 return -1; // unknown fourcc - return failure code. | 1158 return -1; // unknown fourcc - return failure code. |
| 1160 } | 1159 } |
| 1161 return r; | 1160 return r; |
| 1162 } | 1161 } |
| 1163 | 1162 |
| 1164 #ifdef __cplusplus | 1163 #ifdef __cplusplus |
| 1165 } // extern "C" | 1164 } // extern "C" |
| 1166 } // namespace libyuv | 1165 } // namespace libyuv |
| 1167 #endif | 1166 #endif |
| OLD | NEW |