diff options
author | c_sisanj <sisanj@codeaurora.org> | 2015-06-03 09:58:58 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-22 00:18:23 -0700 |
commit | 7c8667529da317c4fe1aa268a6e19472f032c8b0 (patch) | |
tree | 8a29e2d9b854c8359534ac1fee2bcbe4297eca1d | |
parent | afb0718cb9493aa8715532413457e5ee24e35819 (diff) | |
download | android_hardware_qcom_media-7c8667529da317c4fe1aa268a6e19472f032c8b0.tar.gz android_hardware_qcom_media-7c8667529da317c4fe1aa268a6e19472f032c8b0.tar.bz2 android_hardware_qcom_media-7c8667529da317c4fe1aa268a6e19472f032c8b0.zip |
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
-rw-r--r-- | libc2dcolorconvert/C2DColorConverter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc2dcolorconvert/C2DColorConverter.cpp b/libc2dcolorconvert/C2DColorConverter.cpp index fc10644d..7990ef00 100644 --- a/libc2dcolorconvert/C2DColorConverter.cpp +++ b/libc2dcolorconvert/C2DColorConverter.cpp @@ -405,7 +405,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: @@ -419,7 +419,7 @@ size_t C2DColorConverter::calcYSize(ColorConvertFormat format, size_t width, siz case YCbCr420SP: return (ALIGN(width, ALIGN32) * height); case YCbCr420P: - return width * height; + return ALIGN(width, ALIGN16) * height; case YCrCb420P: return ALIGN(width, ALIGN16) * height; case YCbCr420Tile: @@ -459,7 +459,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); |