//#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;
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;
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);
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;
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);
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);
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);
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);
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);