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
This commit is contained in:
Prabhanjan Kandula 2012-08-06 12:50:12 +05:30 committed by Andrew Sutherland
parent cc5cb1781c
commit 1759ea1ab0

View File

@ -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;