vdec: Remove DPB plane size alignment calculation dependency
authorSatish Kumar Reddy <palli.satish@samsung.com>
Thu, 3 Jan 2013 03:54:09 +0000 (03:54 +0000)
committerSatish Kumar Reddy <palli.satish@samsung.com>
Tue, 22 Jan 2013 10:15:33 +0000 (10:15 +0000)
DPB plane size alignment calculation is removed from exynos OMX
and instead aligned size information is retrieved from MFC driver

Change-Id: I1fb9d748532022da02c0caf340f3e961119d1113
Signed-off-by: Satish Kumar Reddy <palli.satish@samsung.com>
component/video/dec/Exynos_OMX_Vdec.c
component/video/dec/Exynos_OMX_Vdec.h
component/video/dec/Exynos_OMX_VdecControl.c
component/video/dec/h264/Exynos_OMX_H264dec.c
component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
component/video/dec/vc1/Exynos_OMX_Wmvdec.c
component/video/dec/vp8/Exynos_OMX_Vp8dec.c

index 7801b3c1252fbacf204daab910a5cb2092181bbc..40353021f60a2d7a12321346c437e1675f378f06 100644 (file)
 //#define EXYNOS_TRACE_ON
 #include "Exynos_OSAL_Log.h"
 
-
-int calc_plane(int width, int height)
-{
-    int mbX, mbY;
-
-    mbX = (width + 15)/16;
-    mbY = (height + 15)/16;
-
-    /* Alignment for interlaced processing */
-    mbY = (mbY + 1) / 2 * 2;
-
-    return (mbX * 16) * (mbY * 16);
-}
-
 inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent)
 {
     EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
@@ -91,18 +77,10 @@ inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent)
         switch(exynosOutputPort->portDefinition.format.video.eColorFormat) {
         case OMX_COLOR_FormatYUV420Planar:
         case OMX_COLOR_FormatYUV420SemiPlanar:
+        case OMX_SEC_COLOR_FormatNV12Tiled:
             if (width && height)
                 exynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2;
             break;
-        case OMX_SEC_COLOR_FormatNV12Tiled:
-            width = exynosOutputPort->portDefinition.format.video.nFrameWidth;
-            height = exynosOutputPort->portDefinition.format.video.nFrameHeight;
-            if (width && height) {
-                int YBufferSize = calc_plane(width, height);
-                int CBufferSize = calc_plane(width, height >> 1);
-                exynosOutputPort->portDefinition.nBufferSize = YBufferSize + CBufferSize;
-            }
-            break;
         default:
             if (width && height)
                 exynosOutputPort->portDefinition.nBufferSize = width * height * 2;
index 51eb6cd4cf2899020472add4960b90108f3990c1..1639366cd7f02b62d2f42a05cb592f12cd7c8a8d 100644 (file)
@@ -131,7 +131,6 @@ typedef struct _EXYNOS_OMX_VIDEODEC_COMPONENT
 extern "C" {
 #endif
 
-int calc_plane(int width, int height);
 inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent);
 OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex);
 OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData);
index b4e4809a652762d9d665ed3556b314fcad8e92ba..5f7f500ee375b99663b2b6ee103b4980cc34b69f 100644 (file)
@@ -1232,24 +1232,14 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter(
             switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) {
             case OMX_COLOR_FormatYUV420Planar:
             case OMX_COLOR_FormatYUV420SemiPlanar:
-                pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2;
-                break;
             case OMX_SEC_COLOR_FormatNV12Tiled:
-                pExynosOutputPort->portDefinition.nBufferSize =
-                    calc_plane(pExynosPort->portDefinition.format.video.nFrameWidth, pExynosOutputPort->portDefinition.format.video.nFrameHeight) +
-                    calc_plane(pExynosPort->portDefinition.format.video.nFrameWidth, pExynosOutputPort->portDefinition.format.video.nFrameHeight >> 1);
+                pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2;
                 break;
             default:
                 Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Color format is not support!! use default YUV size!!");
                 ret = OMX_ErrorUnsupportedSetting;
                 break;
             }
-
-            if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) {
-                pExynosOutputPort->portDefinition.nBufferSize =
-                    calc_plane(pExynosPort->portDefinition.format.video.nFrameWidth, pExynosOutputPort->portDefinition.format.video.nFrameHeight) +
-                    calc_plane(pExynosPort->portDefinition.format.video.nFrameWidth, pExynosOutputPort->portDefinition.format.video.nFrameHeight >> 1);
-            }
         }
     }
         break;
index 5253f74adffaeb47ba18fd396e60b802cbd17676..c73be2550081653591a4cf0d42292db76cbd6057 100644 (file)
@@ -1045,10 +1045,8 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
     int plane;
 
-    nAllocLen[0] = calc_plane(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth,
-                        pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight);
-    nAllocLen[1] = calc_plane(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth,
-                        pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight >> 1);
+    nAllocLen[0] = pH264Dec->hMFCH264Handle.codecOutbufConf.nAlignPlaneSize[0];
+    nAllocLen[1] = pH264Dec->hMFCH264Handle.codecOutbufConf.nAlignPlaneSize[1];
 
     if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
         ret = Exynos_Allocate_CodecBuffers(pOMXComponent, OUTPUT_PORT_INDEX, nOutbufs, nAllocLen);
index 377d0e8872cb2328174648ad631bde9a3b8203b7..38e0c9249913d7fb5ceaddd526b0792fd530c8b4 100644 (file)
@@ -763,10 +763,8 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
     int plane;
 
-    nAllocLen[0] = calc_plane(pMpeg2Dec->hMFCMpeg2Handle.codecOutbufConf.nFrameWidth,
-                        pMpeg2Dec->hMFCMpeg2Handle.codecOutbufConf.nFrameHeight);
-    nAllocLen[1] = calc_plane(pMpeg2Dec->hMFCMpeg2Handle.codecOutbufConf.nFrameWidth,
-                        pMpeg2Dec->hMFCMpeg2Handle.codecOutbufConf.nFrameHeight >> 1);
+    nAllocLen[0] = pMpeg2Dec->hMFCMpeg2Handle.codecOutbufConf.nAlignPlaneSize[0];
+    nAllocLen[1] = pMpeg2Dec->hMFCMpeg2Handle.codecOutbufConf.nAlignPlaneSize[1];
 
     if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
         ret = Exynos_Allocate_CodecBuffers(pOMXComponent, OUTPUT_PORT_INDEX, nOutbufs, nAllocLen);
index b7226b661d49b52c992e260e436e8cf8fb3b6509..a3a9f763f966c22a310de49a82c9ed0051d3195e 100644 (file)
@@ -983,10 +983,8 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
     int plane;
 
-    nAllocLen[0] = calc_plane(pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth,
-                        pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight);
-    nAllocLen[1] = calc_plane(pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth,
-                        pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight >> 1);
+    nAllocLen[0] = pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nAlignPlaneSize[0];
+    nAllocLen[1] = pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nAlignPlaneSize[1];
 
     if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
         ret = Exynos_Allocate_CodecBuffers(pOMXComponent, OUTPUT_PORT_INDEX, nOutbufs, nAllocLen);
index 4a4b5e9bb53a533b128ff81041c01c91cb7f1376..fe23f5ee50e1e5d59ab7c6861a88ab9102699954 100644 (file)
@@ -1027,10 +1027,8 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
     int plane;
 
-    nAllocLen[0] = calc_plane(pWmvDec->hMFCWmvHandle.codecOutbufConf.nFrameWidth,
-                        pWmvDec->hMFCWmvHandle.codecOutbufConf.nFrameHeight);
-    nAllocLen[1] = calc_plane(pWmvDec->hMFCWmvHandle.codecOutbufConf.nFrameWidth,
-                        pWmvDec->hMFCWmvHandle.codecOutbufConf.nFrameHeight >> 1);
+    nAllocLen[0] = pWmvDec->hMFCWmvHandle.codecOutbufConf.nAlignPlaneSize[0];
+    nAllocLen[1] = pWmvDec->hMFCWmvHandle.codecOutbufConf.nAlignPlaneSize[1];
 
     if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
         ret = Exynos_Allocate_CodecBuffers(pOMXComponent, OUTPUT_PORT_INDEX, nOutbufs, nAllocLen);
index b3de613148dfacc10377ca867e5dbfa08779ec57..ec8fbc2df6d9a62cc39ec1887d108166daf28a01 100644 (file)
@@ -795,10 +795,8 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
     OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
     int plane;
 
-    nAllocLen[0] = calc_plane(pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth,
-                        pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight);
-    nAllocLen[1] = calc_plane(pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth,
-                        pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight >> 1);
+    nAllocLen[0] = pVp8Dec->hMFCVp8Handle.codecOutbufConf.nAlignPlaneSize[0];
+    nAllocLen[1] = pVp8Dec->hMFCVp8Handle.codecOutbufConf.nAlignPlaneSize[1];
 
     if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
         ret = Exynos_Allocate_CodecBuffers(pOMXComponent, OUTPUT_PORT_INDEX, nOutbufs, nAllocLen);