Fix cts h264 test error

change crop about h264 decoder

bug: 27589011
bug: IMINAN-49451

Change-Id: I0b468e4abe5b7bff03b4377c2ec42bb5b75d0262
Signed-off-by: Xin Wang <xin1.wang@intel.com>
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index 2b0fdf7..ca4b123 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -695,7 +695,7 @@
    // for 1080p, limit the total surface to 19, according the hardware limitation
    // change the max surface number from 19->10 to workaround memory shortage
    // remove the workaround
-    if(mVideoFormatInfo.height == 1088 && DPBSize + AVC_EXTRA_SURFACE_NUMBER > 19) {
+    if(mVideoFormatInfo.surfaceHeight == 1088 && DPBSize + AVC_EXTRA_SURFACE_NUMBER > 19) {
         DPBSize = 19 - AVC_EXTRA_SURFACE_NUMBER;
     }
 
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index 399bc6c..ceb7b60 100644
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -1218,6 +1218,10 @@
     // size in NV12 format
     uint32_t cropWidth = mVideoFormatInfo.width - (mVideoFormatInfo.cropLeft + mVideoFormatInfo.cropRight);
     uint32_t cropHeight = mVideoFormatInfo.height - (mVideoFormatInfo.cropBottom + mVideoFormatInfo.cropTop);
+    if (strcasecmp(mVideoFormatInfo.mimeType,"video/avc") == 0 ||
+        strcasecmp(mVideoFormatInfo.mimeType,"video/h264") == 0) {
+        cropHeight = mVideoFormatInfo.height;
+    }
     int32_t size = cropWidth  * cropHeight * 3 / 2;
 
     if (internal) {
@@ -1647,6 +1651,10 @@
     rect.y = mVideoFormatInfo.cropTop;
     rect.width = mVideoFormatInfo.width - (mVideoFormatInfo.cropLeft + mVideoFormatInfo.cropRight);
     rect.height = mVideoFormatInfo.height - (mVideoFormatInfo.cropBottom + mVideoFormatInfo.cropTop);
+    if (strcasecmp(mVideoFormatInfo.mimeType,"video/avc") == 0 ||
+        strcasecmp(mVideoFormatInfo.mimeType,"video/h264") == 0) {
+        rect.height = mVideoFormatInfo.height;
+    }
 
     VADisplayAttribute render_rect;
     render_rect.type = VADisplayAttribRenderRect;