diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp index ea013ee..7130ca7 100644 --- a/libcopybit/copybit.cpp +++ b/libcopybit/copybit.cpp @@ -124,10 +124,8 @@ static int get_format(int format) { case COPYBIT_FORMAT_RGB_888: return MDP_RGB_888; case COPYBIT_FORMAT_RGBA_8888: return MDP_RGBA_8888; case COPYBIT_FORMAT_BGRA_8888: return MDP_BGRA_8888; - case COPYBIT_FORMAT_YCrCb_422_SP: return MDP_Y_CBCR_H2V1; case COPYBIT_FORMAT_YCrCb_420_SP: return MDP_Y_CBCR_H2V2; case COPYBIT_FORMAT_YCbCr_422_SP: return MDP_Y_CRCB_H2V1; - case COPYBIT_FORMAT_YCbCr_420_SP: return MDP_Y_CRCB_H2V2; } return -1; } diff --git a/libgralloc-qsd8k/gralloc.cpp b/libgralloc-qsd8k/gralloc.cpp index 5a0f622..3d08cfd 100644 --- a/libgralloc-qsd8k/gralloc.cpp +++ b/libgralloc-qsd8k/gralloc.cpp @@ -373,18 +373,27 @@ static int gralloc_alloc(alloc_device_t* dev, size = ALIGN(alignedw*alignedh, 4096); size += ALIGN(2 * ALIGN(w/2, 32) * ALIGN(h/2, 32), 4096); break; - case HAL_PIXEL_FORMAT_YCbCr_422_I: // YUYV - case HAL_PIXEL_FORMAT_CbYCrY_422_I: // UYVY - size = ALIGN(alignedw*alignedh*2, 4096); - break; case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED: // NV12 // The chroma plane is subsampled, // but the pitch in bytes is unchanged // The GPU needs 4K alignment, but the video decoder needs 8K + alignedw = ALIGN(w, 128); size = ALIGN( ALIGN(w, 128) * alignedh, 8192); size += ALIGN( ALIGN(w, 128) * ALIGN(h/2, 32), 4096); break; + case HAL_PIXEL_FORMAT_YV12: + alignedw = ALIGN(w, 16); + alignedh = ALIGN(h, 16); + size = alignedw * alignedh; + size += size / 2; + break; + + case HAL_PIXEL_FORMAT_YV16: + alignedh = ALIGN(h, 16); + size = alignedw * alignedh * 2; + break; + default: return -EINVAL; }