diff options
author | Danny Fernandes <dannyfernandes@google.com> | 2011-02-15 18:08:46 -0800 |
---|---|---|
committer | Danny Fernandes <dannyfernandes@google.com> | 2011-02-16 11:18:29 -0800 |
commit | f58e4c332ecf8c0cd6037b010256d0b4c56e6a17 (patch) | |
tree | a89cdbd3fcc69f4a685e39a953c404e48b3071d7 | |
parent | c083500e41973256e0c3d4faf5948916b64e918e (diff) | |
download | frameworks_av-f58e4c332ecf8c0cd6037b010256d0b4c56e6a17.zip frameworks_av-f58e4c332ecf8c0cd6037b010256d0b4c56e6a17.tar.gz frameworks_av-f58e4c332ecf8c0cd6037b010256d0b4c56e6a17.tar.bz2 |
Fixed issue 3443078 overlay flicker on transition in exported video
Change-Id: I4c625a1f7c9897ee0d9aee3f521974456c97ad8c
-rwxr-xr-x | libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h | 1 | ||||
-rwxr-xr-x | libvideoeditor/vss/src/M4VSS3GPP_Edit.c | 2 | ||||
-rwxr-xr-x | libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c | 38 | ||||
-rwxr-xr-x | libvideoeditor/vss/src/M4xVSS_internal.c | 28 |
4 files changed, 45 insertions, 24 deletions
diff --git a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h index 069b84d..bc29b2a 100755 --- a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h +++ b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h @@ -610,6 +610,7 @@ typedef struct M4OSA_UInt8 nbActiveEffects1; /**< Numbers of active effects RC */ M4OSA_Bool m_bClipExternalHasStarted; /**< Flag to indicate that an external effect is active */ + M4OSA_Int32 iInOutTimeOffset; } M4VSS3GPP_InternalEditContext; diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c index d495186..acdbfdc 100755 --- a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c +++ b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c @@ -229,6 +229,8 @@ M4OSA_ERR M4VSS3GPP_editInit( M4VSS3GPP_EditContext *pContext, pC->bIsMMS = M4OSA_FALSE; + pC->iInOutTimeOffset = 0; + /** * Return with no error */ M4OSA_TRACE3_0("M4VSS3GPP_editInit(): returning M4NO_ERROR"); diff --git a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c index 9870426..2dfd07b 100755 --- a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c +++ b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c @@ -93,12 +93,18 @@ M4OSA_ERR M4VSS3GPP_intEditStepVideo( M4VSS3GPP_InternalEditContext *pC ) M4OSA_UInt16 offset; /** - * Check if we reached end cut */ - // Decorrelate input and output encoding timestamp to handle encoder prefetch - if ( ((M4OSA_Int32)(pC->ewc.dInputVidCts) - pC->pC1->iVoffset) >= pC->pC1->iEndTime ) + * Check if we reached end cut. Decorrelate input and output encoding + * timestamp to handle encoder prefetch + */ + if ( ((M4OSA_Int32)(pC->ewc.dInputVidCts) - pC->pC1->iVoffset + + pC->iInOutTimeOffset) >= pC->pC1->iEndTime ) { /* Re-adjust video to precise cut time */ - // Decorrelate input and output encoding timestamp to handle encoder prefetch + pC->iInOutTimeOffset = ((M4OSA_Int32)(pC->ewc.dInputVidCts)) + - pC->pC1->iVoffset + pC->iInOutTimeOffset - pC->pC1->iEndTime; + if ( pC->iInOutTimeOffset < 0 ) { + pC->iInOutTimeOffset = 0; + } /** * Video is done for this clip */ @@ -1974,9 +1980,11 @@ M4VSS3GPP_intCheckVideoEffects( M4VSS3GPP_InternalEditContext *pC, if(uiClipNumber ==1) { - if ((t >= (M4OSA_Int32)(pFx->uiStartTime)) && /**< Are we after the start time of the effect? */ - (t < (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) /**< Are we into the effect duration? */ - { + /**< Are we after the start time of the effect? + * or Are we into the effect duration? + */ + if ( (t >= (M4OSA_Int32)(pFx->uiStartTime)) && + (t <= (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) { /** * Set the active effect(s) */ pC->pActiveEffectsList[i] = pC->nbEffects-1-uiFxIndex; @@ -1993,17 +2001,19 @@ M4VSS3GPP_intCheckVideoEffects( M4VSS3GPP_InternalEditContext *pC, } /** - * The third effect has the highest priority, then the second one, then the first one. - * Hence, as soon as we found an active effect, we can get out of this loop */ - + * The third effect has the highest priority, then the + * second one, then the first one. Hence, as soon as we + * found an active effect, we can get out of this loop. + */ } } else { - if ((t + pC->pTransitionList[uiClipIndex].uiTransitionDuration >= - (M4OSA_Int32)(pFx->uiStartTime)) && (t + pC->pTransitionList[uiClipIndex].uiTransitionDuration - < (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) /**< Are we into the effect duration? */ - { + /**< Are we into the effect duration? */ + if ( (t + pC->pTransitionList[uiClipIndex].uiTransitionDuration + >= (M4OSA_Int32)(pFx->uiStartTime)) + && (t + pC->pTransitionList[uiClipIndex].uiTransitionDuration + <= (M4OSA_Int32)(pFx->uiStartTime + pFx->uiDuration)) ) { /** * Set the active effect(s) */ pC->pActiveEffectsList1[i] = pC->nbEffects-1-uiFxIndex; diff --git a/libvideoeditor/vss/src/M4xVSS_internal.c b/libvideoeditor/vss/src/M4xVSS_internal.c index 71a8929..b56d524 100755 --- a/libvideoeditor/vss/src/M4xVSS_internal.c +++ b/libvideoeditor/vss/src/M4xVSS_internal.c @@ -4135,11 +4135,15 @@ M4OSA_ERR M4VSS3GPP_externalVideoEffectFraming( M4OSA_Void *userData, if(pProgress->uiProgress >= 0 && pProgress->uiProgress \ < (M4OSA_UInt32)(alphaBlendingStruct->m_fadeInTime*10)) { - alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle\ - - alphaBlendingStruct->m_start)\ - *pProgress->uiProgress/(alphaBlendingStruct->m_fadeInTime*10)); - alphaBlending += alphaBlendingStruct->m_start; - alphaBlending /= 100; + if(alphaBlendingStruct->m_fadeInTime == 0) { + alphaBlending = alphaBlendingStruct->m_start / 100; + } else { + alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle\ + - alphaBlendingStruct->m_start)\ + *pProgress->uiProgress/(alphaBlendingStruct->m_fadeInTime*10)); + alphaBlending += alphaBlendingStruct->m_start; + alphaBlending /= 100; + } } else if(pProgress->uiProgress >= (M4OSA_UInt32)(alphaBlendingStruct->\ m_fadeInTime*10) && pProgress->uiProgress < 1000\ @@ -4151,11 +4155,15 @@ M4OSA_ERR M4VSS3GPP_externalVideoEffectFraming( M4OSA_Void *userData, else if(pProgress->uiProgress >= 1000 - (M4OSA_UInt32)\ (alphaBlendingStruct->m_fadeOutTime*10)) { - alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle \ - - alphaBlendingStruct->m_end))*(1000 - pProgress->uiProgress)\ - /(alphaBlendingStruct->m_fadeOutTime*10); - alphaBlending += alphaBlendingStruct->m_end; - alphaBlending /= 100; + if(alphaBlendingStruct->m_fadeOutTime == 0) { + alphaBlending = alphaBlendingStruct->m_end / 100; + } else { + alphaBlending = ((M4OSA_Float)(alphaBlendingStruct->m_middle \ + - alphaBlendingStruct->m_end))*(1000 - pProgress->uiProgress)\ + /(alphaBlendingStruct->m_fadeOutTime*10); + alphaBlending += alphaBlendingStruct->m_end; + alphaBlending /= 100; + } } } /**/ |