aboutsummaryrefslogtreecommitdiff
path: root/source/convert_from.cc
diff options
context:
space:
mode:
authorfbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90>2013-03-14 17:57:47 +0000
committerfbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90>2013-03-14 17:57:47 +0000
commit5ca144d2140755ab668916335cd927e5583dbb42 (patch)
tree033f1b122d1b3681923637867e4bb984acdc4a10 /source/convert_from.cc
parent7d25fe2ddbfc990c6fd1e029b76efa3ed6888f9e (diff)
downloadlibyuv-5ca144d2140755ab668916335cd927e5583dbb42.tar.gz
NV12 to/from I420 coalesce rows for Y and UV independently.
BUG=197 TESTED=*NV12*_Opt Review URL: https://webrtc-codereview.appspot.com/1201004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@607 16f28f9a-4ce2-e073-06de-1de4eb20be90
Diffstat (limited to 'source/convert_from.cc')
-rw-r--r--source/convert_from.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/convert_from.cc b/source/convert_from.cc
index a087e886..f3370237 100644
--- a/source/convert_from.cc
+++ b/source/convert_from.cc
@@ -465,12 +465,13 @@ int I420ToNV12(const uint8* src_y, int src_stride_y,
int halfwidth = (width + 1) >> 1;
int halfheight = (height + 1) >> 1;
if (src_stride_y == width &&
- src_stride_u * 2 == width &&
- src_stride_v * 2 == width &&
- dst_stride_y == width &&
- dst_stride_uv == width) {
+ dst_stride_y == width) {
width = width * height;
height = 1;
+ }
+ if (src_stride_u * 2 == width &&
+ src_stride_v * 2 == width &&
+ dst_stride_uv == width) {
halfwidth = halfwidth * halfheight;
halfheight = 1;
}