Update VP8 encode middleware in libmix layer

BZ: 114083

VP8 encode FW had special requirement about ref frame
stride align and buffer size.
Width and Height should be the nearest integer multiple of 64;
Buffer size should be the pointer to 32-byte aligned buffer.

Change-Id: Ied0613f5867b6e3a4b2d05100650e09388bdeba5
Signed-off-by: liubolun <bolun.liu@intel.com>
Reviewed-on: http://android.intel.com:8080/112508
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/videoencoder/VideoEncoderBase.cpp b/videoencoder/VideoEncoderBase.cpp
index a3f5109..b88be1b 100644
--- a/videoencoder/VideoEncoderBase.cpp
+++ b/videoencoder/VideoEncoderBase.cpp
@@ -175,12 +175,23 @@
         stride_aligned = ((mComParams.resolution.width + 15) / 16 ) * 16;
         height_aligned = ((mComParams.resolution.height + 15) / 16 ) * 16;
     }else{
-        stride_aligned = ((mComParams.resolution.width + 63) / 64 ) * 64;  //on Merr, stride must be 64 aligned.
-        height_aligned = ((mComParams.resolution.height + 31) / 32 ) * 32;
+        if(mComParams.profile == VAProfileVP8Version0_3)
+        {
+           stride_aligned = ((mComParams.resolution.width + 64 + 63) / 64 ) * 64;  //for vsp stride
+           height_aligned = ((mComParams.resolution.height + 64 + 63) / 64 ) * 64;
+        }
+        else
+        {
+           stride_aligned = ((mComParams.resolution.width + 63) / 64 ) * 64;  //on Merr, stride must be 64 aligned.
+           height_aligned = ((mComParams.resolution.height + 31) / 32 ) * 32;
+        }
     }
 
+    if(mComParams.profile == VAProfileVP8Version0_3)
+        attribute_tpi.size = stride_aligned * height_aligned + stride_aligned * ((((mComParams.resolution.height + 1) / 2 + 32)+63)/64) *64;// FW need w*h + w*chrom_height
+    else
+        attribute_tpi.size = stride_aligned * height_aligned * 3 / 2;
 
-    attribute_tpi.size = stride_aligned * height_aligned * 3 / 2;
     attribute_tpi.luma_stride = stride_aligned;
     attribute_tpi.chroma_u_stride = stride_aligned;
     attribute_tpi.chroma_v_stride = stride_aligned;