Align stride for encoder surfaces to 64 pixels/ bytes
There was an error that caused stride to be 32 pixels aligned.
This caused a double blit just to update the stride. By
aligning to 64 bytes/ the RGB->NV12 blit only happens once.
Bug: 22335388
Change-Id: Ie412983f9efce570899e07404c91fcbdd3e2b835
Signed-off-by: hding3 <[email protected]>
diff --git a/videoencoder/VideoEncoderUtils.cpp b/videoencoder/VideoEncoderUtils.cpp
index 067e9e7..f5aeeeb 100644
--- a/videoencoder/VideoEncoderUtils.cpp
+++ b/videoencoder/VideoEncoderUtils.cpp
@@ -201,10 +201,7 @@
if (h->iFormat == HAL_PIXEL_FORMAT_NV12) {
#ifdef MRFLD_GFX
- if((h->usage & GRALLOC_USAGE_HW_CAMERA_READ) || (h->usage & GRALLOC_USAGE_HW_CAMERA_WRITE) )
- vinfo.lumaStride = (h->iWidth + 63) & ~63; //64 aligned
- else
- vinfo.lumaStride = (h->iWidth + 31) & ~31; //32 aligned
+ vinfo.lumaStride = (h->iWidth + 63) & ~63; //64 aligned
#else //on CTP
if (h->iWidth > 512)
vinfo.lumaStride = (h->iWidth + 63) & ~63; //64 aligned