support "Cyclic intra-refresh" only.
doesn't support "Adaptive intra-refresh".
Change-Id: I50722f5bfe8729243395123f998025e6c655b7bd
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
OMX_BOOL IntraRefreshVOP;
OMX_VIDEO_CONTROLRATETYPE eControlRate[ALL_PORT_NUM];
OMX_VIDEO_PARAM_QUANTIZATIONTYPE quantization;
+ OMX_VIDEO_PARAM_INTRAREFRESHTYPE intraRefresh;
OMX_BOOL bFirstInput;
OMX_BOOL bFirstOutput;
pPortMemType->bNeedContigMem = pExynosPort->bNeedContigMem;
}
break;
+ case OMX_IndexParamVideoIntraRefresh:
+ {
+ OMX_VIDEO_PARAM_INTRAREFRESHTYPE *pIntraRefresh = (OMX_VIDEO_PARAM_INTRAREFRESHTYPE *)pComponentParameterStructure;
+ OMX_U32 nPortIndex = pIntraRefresh->nPortIndex;
+ EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
+
+ ret = Exynos_OMX_Check_SizeVersion(pIntraRefresh, sizeof(OMX_VIDEO_PARAM_INTRAREFRESHTYPE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ if (nPortIndex != OUTPUT_PORT_INDEX) {
+ ret = OMX_ErrorBadPortIndex;
+ goto EXIT;
+ }
+
+ pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
+ pIntraRefresh->eRefreshMode = pVideoEnc->intraRefresh.eRefreshMode;
+ pIntraRefresh->nAirMBs = pVideoEnc->intraRefresh.nAirMBs;
+ pIntraRefresh->nAirRef = pVideoEnc->intraRefresh.nAirRef;
+ pIntraRefresh->nCirMBs = pVideoEnc->intraRefresh.nCirMBs;
+
+ ret = OMX_ErrorNone;
+ }
+ break;
default:
{
ret = Exynos_OMX_GetParameter(hComponent, nParamIndex, pComponentParameterStructure);
pExynosPort->bNeedContigMem = pPortMemType->bNeedContigMem;
}
break;
+ case OMX_IndexParamVideoIntraRefresh:
+ {
+ OMX_VIDEO_PARAM_INTRAREFRESHTYPE *pIntraRefresh = (OMX_VIDEO_PARAM_INTRAREFRESHTYPE *)pComponentParameterStructure;
+ OMX_U32 nPortIndex = pIntraRefresh->nPortIndex;
+ EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
+
+ ret = Exynos_OMX_Check_SizeVersion(pIntraRefresh, sizeof(OMX_VIDEO_PARAM_INTRAREFRESHTYPE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ if (nPortIndex != OUTPUT_PORT_INDEX) {
+ ret = OMX_ErrorBadPortIndex;
+ goto EXIT;
+ }
+
+ pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
+ if (pIntraRefresh->eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
+ pVideoEnc->intraRefresh.eRefreshMode = pIntraRefresh->eRefreshMode;
+ pVideoEnc->intraRefresh.nCirMBs = pIntraRefresh->nCirMBs;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "OMX_VIDEO_IntraRefreshCyclic Enable, nCirMBs: %d",
+ pVideoEnc->intraRefresh.nCirMBs);
+ } else {
+ ret = OMX_ErrorUnsupportedSetting;
+ goto EXIT;
+ }
+
+ ret = OMX_ErrorNone;
+ }
+ break;
default:
{
ret = Exynos_OMX_SetParameter(hComponent, nParamIndex, pComponentParameterStructure);
pCommonParam->SourceHeight = pExynosOutputPort->portDefinition.format.video.nFrameHeight;
pCommonParam->IDRPeriod = pH264Enc->AVCComponent[OUTPUT_PORT_INDEX].nPFrames + 1;
pCommonParam->SliceMode = 0;
- pCommonParam->RandomIntraMBRefresh = 0;
pCommonParam->Bitrate = pExynosOutputPort->portDefinition.format.video.nBitrate;
pCommonParam->FrameQp = pVideoEnc->quantization.nQpI;
pCommonParam->FrameQp_P = pVideoEnc->quantization.nQpP;
pCommonParam->CbPadVal = 0;
pCommonParam->CrPadVal = 0;
+ if (pVideoEnc->intraRefresh.eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
+ /* Cyclic Mode */
+ pCommonParam->RandomIntraMBRefresh = pVideoEnc->intraRefresh.nCirMBs;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "RandomIntraMBRefresh: %d", pCommonParam->RandomIntraMBRefresh);
+ } else {
+ /* Don't support "Adaptive" and "Cyclic + Adaptive" */
+ pCommonParam->RandomIntraMBRefresh = 0;
+ }
+
if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
if (pVideoEnc->ANBColorFormat == OMX_COLOR_FormatYUV420SemiPlanar)
pCommonParam->FrameMap = VIDEO_COLORFORMAT_NV12;
pCommonParam->SourceHeight = pExynosOutputPort->portDefinition.format.video.nFrameHeight;
pCommonParam->IDRPeriod = pMpeg4Enc->mpeg4Component[OUTPUT_PORT_INDEX].nPFrames + 1;
pCommonParam->SliceMode = 0;
- pCommonParam->RandomIntraMBRefresh = 0;
pCommonParam->Bitrate = pExynosOutputPort->portDefinition.format.video.nBitrate;
pCommonParam->FrameQp = pVideoEnc->quantization.nQpI;
pCommonParam->FrameQp_P = pVideoEnc->quantization.nQpP;
pCommonParam->CbPadVal = 0;
pCommonParam->CrPadVal = 0;
+ if (pVideoEnc->intraRefresh.eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
+ /* Cyclic Mode */
+ pCommonParam->RandomIntraMBRefresh = pVideoEnc->intraRefresh.nCirMBs;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "RandomIntraMBRefresh: %d", pCommonParam->RandomIntraMBRefresh);
+ } else {
+ /* Don't support "Adaptive" and "Cyclic + Adaptive" */
+ pCommonParam->RandomIntraMBRefresh = 0;
+ }
+
if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
if (pVideoEnc->ANBColorFormat == OMX_SEC_COLOR_FormatNV21Linear)
pCommonParam->FrameMap = VIDEO_COLORFORMAT_NV12;
pCommonParam->SourceHeight = pExynosOutputPort->portDefinition.format.video.nFrameHeight;
pCommonParam->IDRPeriod = pMpeg4Enc->h263Component[OUTPUT_PORT_INDEX].nPFrames + 1;
pCommonParam->SliceMode = 0;
- pCommonParam->RandomIntraMBRefresh = 0;
pCommonParam->Bitrate = pExynosOutputPort->portDefinition.format.video.nBitrate;
pCommonParam->FrameQp = pVideoEnc->quantization.nQpI;
pCommonParam->FrameQp_P = pVideoEnc->quantization.nQpP;
pCommonParam->CbPadVal = 0;
pCommonParam->CrPadVal = 0;
+ if (pVideoEnc->intraRefresh.eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
+ /* Cyclic Mode */
+ pCommonParam->RandomIntraMBRefresh = pVideoEnc->intraRefresh.nCirMBs;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "RandomIntraMBRefresh: %d", pCommonParam->RandomIntraMBRefresh);
+ } else {
+ /* Don't support "Adaptive" and "Cyclic + Adaptive" */
+ pCommonParam->RandomIntraMBRefresh = 0;
+ }
+
if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
if (pVideoEnc->ANBColorFormat == OMX_SEC_COLOR_FormatNV21Linear)
pCommonParam->FrameMap = VIDEO_COLORFORMAT_NV12;