change resolution update logic

This commit is contained in:
licaiguo
2014-01-25 16:12:52 +08:00
parent a1c491499f
commit 1a2dd0c1f1
5 changed files with 1 additions and 26 deletions

View File

@@ -130,11 +130,6 @@ int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat);
*/ */
int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight); int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight);
/*!
* \brief update maximal picture width and height if applicable when receiving a SPS NAL
*/
void_t UpdateMaxPictureResolution (PWelsDecoderContext pCtx, const int32_t kiCurWidth, const int32_t kiCurHeight);
void_t AssignFuncPointerForRec (PWelsDecoderContext pCtx); void_t AssignFuncPointerForRec (PWelsDecoderContext pCtx);
void_t ResetParameterSetsState (PWelsDecoderContext pCtx); void_t ResetParameterSetsState (PWelsDecoderContext pCtx);

View File

@@ -185,8 +185,6 @@ typedef struct TagWelsDecoderContext {
int32_t iImgWidthInPixel; // width of image in pixel reconstruction picture to be output int32_t iImgWidthInPixel; // width of image in pixel reconstruction picture to be output
int32_t iImgHeightInPixel;// height of image in pixel reconstruction picture to be output int32_t iImgHeightInPixel;// height of image in pixel reconstruction picture to be output
int32_t iMaxWidthInSps; // maximal width of pixel in SPS sets
int32_t iMaxHeightInSps; // maximal height of pixel in SPS sets
// Derived common elements // Derived common elements
SNalUnitHeader sCurNalHead; SNalUnitHeader sCurNalHead;

View File

@@ -533,9 +533,6 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t
return iErr; return iErr;
} }
if (ERR_NONE == iErr)
UpdateMaxPictureResolution (pCtx, iPicWidth, iPicHeight);
break; break;
case NAL_UNIT_PPS: case NAL_UNIT_PPS:

View File

@@ -345,8 +345,6 @@ void_t WelsOpenDecoder (PWelsDecoderContext pCtx) {
if (ERR_NONE != WelsInitMemory (pCtx)) if (ERR_NONE != WelsInitMemory (pCtx))
return; return;
pCtx->iMaxWidthInSps = 0;
pCtx->iMaxHeightInSps = 0;
#ifdef LONG_TERM_REF #ifdef LONG_TERM_REF
pCtx->bParamSetsLostFlag = true; pCtx->bParamSetsLostFlag = true;
#else #else
@@ -685,19 +683,6 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi
return iErr; return iErr;
} }
/*!
* \brief update maximal picture width and height if applicable when receiving a SPS NAL
*/
void_t UpdateMaxPictureResolution (PWelsDecoderContext pCtx, const int32_t kiCurWidth, const int32_t kiCurHeight) {
//any dimension larger than that of current dimension, should modify the max-dimension
if ((kiCurWidth * kiCurHeight) > (pCtx->iMaxWidthInSps * pCtx->iMaxHeightInSps)) {
pCtx->iMaxWidthInSps = kiCurWidth;
pCtx->iMaxHeightInSps = kiCurHeight;
}
return;
}
void_t AssignFuncPointerForRec (PWelsDecoderContext pCtx) { void_t AssignFuncPointerForRec (PWelsDecoderContext pCtx) {
pCtx->pGetI16x16LumaPredFunc[I16_PRED_V ] = WelsI16x16LumaPredV_c; pCtx->pGetI16x16LumaPredFunc[I16_PRED_V ] = WelsI16x16LumaPredV_c;
pCtx->pGetI16x16LumaPredFunc[I16_PRED_H ] = WelsI16x16LumaPredH_c; pCtx->pGetI16x16LumaPredFunc[I16_PRED_H ] = WelsI16x16LumaPredH_c;

View File

@@ -1586,7 +1586,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI
if (NAL_UNIT_CODED_SLICE_IDR == pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.eNalUnitType || if (NAL_UNIT_CODED_SLICE_IDR == pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.eNalUnitType ||
pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.bIdrFlag) { pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.bIdrFlag) {
WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL
iErr = SyncPictureResolutionExt (pCtx, (pCtx->iMaxWidthInSps + 15) >> 4, (pCtx->iMaxHeightInSps + 15) >> 4); iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight);
if (ERR_NONE != iErr) { if (ERR_NONE != iErr) {
WelsLog (pCtx, WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr); WelsLog (pCtx, WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr);