Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: source/convert_from.cc

Issue 2020193002: Treat YU12 as an alias for I420. Simplify setting of inv_crop_height. (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Update ConvertFromI420, ConvertToARGB and TestCanonicalFourCC for YU12 being an alias. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | source/convert_to_argb.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | source/convert_to_argb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698