From: Satish Kumar Reddy Date: Thu, 3 Jan 2013 03:54:09 +0000 (+0000) Subject: vdec: Remove DPB plane size alignment calculation dependency X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=46c80d2fbc38f34c038925c919384fe54d2d4738;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git vdec: Remove DPB plane size alignment calculation dependency 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 --- diff --git a/component/video/dec/Exynos_OMX_Vdec.c b/component/video/dec/Exynos_OMX_Vdec.c index 7801b3c..4035302 100644 --- a/component/video/dec/Exynos_OMX_Vdec.c +++ b/component/video/dec/Exynos_OMX_Vdec.c @@ -53,20 +53,6 @@ //#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; diff --git a/component/video/dec/Exynos_OMX_Vdec.h b/component/video/dec/Exynos_OMX_Vdec.h index 51eb6cd..1639366 100644 --- a/component/video/dec/Exynos_OMX_Vdec.h +++ b/component/video/dec/Exynos_OMX_Vdec.h @@ -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); diff --git a/component/video/dec/Exynos_OMX_VdecControl.c b/component/video/dec/Exynos_OMX_VdecControl.c index b4e4809..5f7f500 100644 --- a/component/video/dec/Exynos_OMX_VdecControl.c +++ b/component/video/dec/Exynos_OMX_VdecControl.c @@ -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; diff --git a/component/video/dec/h264/Exynos_OMX_H264dec.c b/component/video/dec/h264/Exynos_OMX_H264dec.c index 5253f74..c73be25 100644 --- a/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -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); diff --git a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index 377d0e8..38e0c92 100644 --- a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -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); diff --git a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index b7226b6..a3a9f76 100644 --- a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -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); diff --git a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index 4a4b5e9..fe23f5e 100644 --- a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -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); diff --git a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index b3de613..ec8fbc2 100644 --- a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -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);