VideoEncode: set graphic buffer stride accordingly.

BZ: 76032

Graphic buffer's width and its stride has following relations:
(0, 512]      ==> 512
(512, 1024]  ==> 1024
(1024, 1280] ==> 1280
(1280,       ==> 2048
Set accordingly.

Change-Id: I537a412166bd15f934fd130a5081d0901e6155b1
Signed-off-by: Chang Ying <ying.chang@intel.com>
Reviewed-on: http://android.intel.com:8080/83615
Reviewed-by: Yuan, Shengquan <shengquan.yuan@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
diff --git a/videoencoder/VideoEncoderBase.cpp b/videoencoder/VideoEncoderBase.cpp
index d0e6d66..55012d7 100644
--- a/videoencoder/VideoEncoderBase.cpp
+++ b/videoencoder/VideoEncoderBase.cpp
@@ -1563,7 +1563,14 @@
 
     vaSurfaceAttrib.count = 1;
     // OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar
-    vaSurfaceAttrib.luma_stride = (mComParams.resolution.width + 0x1ff) & (~0x1ff);
+    if (mComParams.resolution.width <= 512)
+        vaSurfaceAttrib.luma_stride = 512;
+    else if (mComParams.resolution.width > 512 && mComParams.resolution.width <= 1024)
+        vaSurfaceAttrib.luma_stride = 1024;
+    else if (mComParams.resolution.width > 1024 && mComParams.resolution.width <= 1280)
+        vaSurfaceAttrib.luma_stride = 1280;
+    else
+        vaSurfaceAttrib.luma_stride = 2048;
     vaSurfaceAttrib.pixel_format = map->vinfo.format;
     vaSurfaceAttrib.width = mComParams.resolution.width;
     vaSurfaceAttrib.height = mComParams.resolution.height;