From 1759ea1ab011eda25a1ef2311bc875646a00fec6 Mon Sep 17 00:00:00 2001 From: Prabhanjan Kandula Date: Mon, 6 Aug 2012 12:50:12 +0530 Subject: [PATCH] libcopybit: fix YUV buffer alignments as per gralloc buffer alignment in copybit should be in sync with gralloc allignments while allocating buffer. CRs-fixed: 377051 Change-Id: Ib2ae64e368ea3c92d3494c71da605197ccb4a9a5 Conflicts: libcopybit/copybit_c2d.cpp --- libcopybit/copybit_c2d.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 4697238..1edd773 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -898,20 +898,20 @@ static size_t get_size(const bufferInfo& info) size_t size = 0; int w = info.width; int h = info.height; - int aligned_w = ALIGN(w, 32); + int aligned_w = ALIGN(w, 16); switch(info.format) { case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: { // Chroma for this format is aligned to 2K. size = ALIGN((aligned_w*h), 2048) + - ALIGN(w/2, 32) * h/2 *2; + ALIGN(aligned_w/2, 16) * (h/2) *2; size = ALIGN(size, 4096); } break; case HAL_PIXEL_FORMAT_YCbCr_420_SP: case HAL_PIXEL_FORMAT_YCrCb_420_SP: { - size = aligned_w*h + - ALIGN(w/2, 32) * h/2 *2; + size = aligned_w * h + + ALIGN(aligned_w/2, 16) * (h/2) * 2; size = ALIGN(size, 4096); } break; default: break;