exynos_omx: multi_thread: Modified calc_plane API
authorSeungBeom Kim <sbcrux.kim@samsung.com>
Wed, 4 Jul 2012 01:55:37 +0000 (10:55 +0900)
committerDima Zavin <dima@android.com>
Tue, 24 Jul 2012 22:12:42 +0000 (15:12 -0700)
Modified calc_plane(for the MFC output buffer calculate) API.

Change-Id: I86e338f27ce352932a8176e0f7137084aeb884d4
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.c

index 010448fd66e3d9e81d4ee4b78ce0450c2d22d39b..4f696aadda011a69e7df7c35796c2cb4db4f2ac6 100644 (file)
@@ -58,8 +58,8 @@ int calc_plane(int width, int height)
     mbX = (width + 15)/16;
     mbY = (height + 15)/16;
 
-    if (width * height < 2048 * 1024)
-        mbY = (mbY + 1) / 2 * 2;
+    /* Alignment for interlaced processing */
+    mbY = (mbY + 1) / 2 * 2;
 
     return (mbX * 16) * (mbY * 16);
 }
@@ -96,9 +96,9 @@ inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent)
             width = exynosOutputPort->portDefinition.format.video.nFrameWidth;
             height = exynosOutputPort->portDefinition.format.video.nFrameHeight;
             if (width && height) {
-                exynosOutputPort->portDefinition.nBufferSize =
-                    ALIGN_TO_8KB(ALIGN_TO_128B(width) * ALIGN_TO_32B(height)) \
-                    + ALIGN_TO_8KB(ALIGN_TO_128B(width) * ALIGN_TO_32B(height/2));
+                int YBufferSize = calc_plane(width, height);
+                int CBufferSize = calc_plane(width, height >> 1);
+                exynosOutputPort->portDefinition.nBufferSize = YBufferSize + CBufferSize;
             }
             break;
         default: