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 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 int src_pixel_stride_uv, | 1489 int src_pixel_stride_uv, |
1490 uint8* dst_y, | 1490 uint8* dst_y, |
1491 int dst_stride_y, | 1491 int dst_stride_y, |
1492 uint8* dst_u, | 1492 uint8* dst_u, |
1493 int dst_stride_u, | 1493 int dst_stride_u, |
1494 uint8* dst_v, | 1494 uint8* dst_v, |
1495 int dst_stride_v, | 1495 int dst_stride_v, |
1496 int width, | 1496 int width, |
1497 int height) { | 1497 int height) { |
1498 int y; | 1498 int y; |
1499 const int vu_off = src_v - src_u; | 1499 const ptrdiff_t vu_off = src_v - src_u; |
1500 int halfwidth = (width + 1) >> 1; | 1500 int halfwidth = (width + 1) >> 1; |
1501 int halfheight = (height + 1) >> 1; | 1501 int halfheight = (height + 1) >> 1; |
1502 if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { | 1502 if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { |
1503 return -1; | 1503 return -1; |
1504 } | 1504 } |
1505 // Negative height means invert the image. | 1505 // Negative height means invert the image. |
1506 if (height < 0) { | 1506 if (height < 0) { |
1507 height = -height; | 1507 height = -height; |
1508 halfheight = (height + 1) >> 1; | 1508 halfheight = (height + 1) >> 1; |
1509 src_y = src_y + (height - 1) * src_stride_y; | 1509 src_y = src_y + (height - 1) * src_stride_y; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 dst_u += dst_stride_u; | 1545 dst_u += dst_stride_u; |
1546 dst_v += dst_stride_v; | 1546 dst_v += dst_stride_v; |
1547 } | 1547 } |
1548 return 0; | 1548 return 0; |
1549 } | 1549 } |
1550 | 1550 |
1551 #ifdef __cplusplus | 1551 #ifdef __cplusplus |
1552 } // extern "C" | 1552 } // extern "C" |
1553 } // namespace libyuv | 1553 } // namespace libyuv |
1554 #endif | 1554 #endif |
OLD | NEW |