summaryrefslogtreecommitdiff
path: root/libc2dcolorconvert
diff options
context:
space:
mode:
authorc_sisanj <sisanj@codeaurora.org>2015-06-03 09:58:58 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2015-07-06 19:21:30 -0700
commite5b1cf8df8ce15c2315175a89148b72d54a15311 (patch)
tree0a42876202975599f026bb7572524fe1fb69f3a8 /libc2dcolorconvert
parentd562b4b712f3e6f8cf3dc7115bacacb3053b506f (diff)
downloadmedia-e5b1cf8df8ce15c2315175a89148b72d54a15311.tar.gz
libc2dcolorconvert: Modified stride and size calculation
For YCbCr420P color format, Stride and YUV plane size calculation is modified as per prescribed 16 byte alignement. Change-Id: I32f7b8b30152d9f7f2a32f9309925b38bf399118
Diffstat (limited to 'libc2dcolorconvert')
-rw-r--r--libc2dcolorconvert/C2DColorConverter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc2dcolorconvert/C2DColorConverter.cpp b/libc2dcolorconvert/C2DColorConverter.cpp
index 1d2bdcf2..acdff9db 100644
--- a/libc2dcolorconvert/C2DColorConverter.cpp
+++ b/libc2dcolorconvert/C2DColorConverter.cpp
@@ -404,7 +404,7 @@ size_t C2DColorConverter::calcStride(ColorConvertFormat format, size_t width)
case NV12_128m:
return ALIGN(width, ALIGN128);
case YCbCr420P:
- return width;
+ return ALIGN(width, ALIGN16);
case YCrCb420P:
return ALIGN(width, ALIGN16);
default:
@@ -418,7 +418,7 @@ size_t C2DColorConverter::calcYSize(ColorConvertFormat format, size_t width, siz
case YCbCr420SP:
return (ALIGN(width, ALIGN16) * height);
case YCbCr420P:
- return width * height;
+ return ALIGN(width, ALIGN16) * height;
case YCrCb420P:
return ALIGN(width, ALIGN16) * height;
case YCbCr420Tile:
@@ -458,7 +458,8 @@ size_t C2DColorConverter::calcSize(ColorConvertFormat format, size_t width, size
size = ALIGN((alignedw * height) + (ALIGN(width/2, ALIGN32) * (height/2) * 2), ALIGN4K);
break;
case YCbCr420P:
- size = ALIGN((width * height * 3 / 2), ALIGN4K);
+ alignedw = ALIGN(width, ALIGN16);
+ size = ALIGN((alignedw * height) + (ALIGN(width/2, ALIGN16) * (height/2) * 2), ALIGN4K);
break;
case YCrCb420P:
alignedw = ALIGN(width, ALIGN16);