change resolution update logic
This commit is contained in:
parent
a1c491499f
commit
1a2dd0c1f1
@ -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);
|
||||
|
||||
/*!
|
||||
* \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 ResetParameterSetsState (PWelsDecoderContext pCtx);
|
||||
|
@ -185,8 +185,6 @@ typedef struct TagWelsDecoderContext {
|
||||
|
||||
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 iMaxWidthInSps; // maximal width of pixel in SPS sets
|
||||
int32_t iMaxHeightInSps; // maximal height of pixel in SPS sets
|
||||
|
||||
// Derived common elements
|
||||
SNalUnitHeader sCurNalHead;
|
||||
|
@ -533,9 +533,6 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t
|
||||
return iErr;
|
||||
}
|
||||
|
||||
if (ERR_NONE == iErr)
|
||||
UpdateMaxPictureResolution (pCtx, iPicWidth, iPicHeight);
|
||||
|
||||
break;
|
||||
|
||||
case NAL_UNIT_PPS:
|
||||
|
@ -345,8 +345,6 @@ void_t WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
||||
if (ERR_NONE != WelsInitMemory (pCtx))
|
||||
return;
|
||||
|
||||
pCtx->iMaxWidthInSps = 0;
|
||||
pCtx->iMaxHeightInSps = 0;
|
||||
#ifdef LONG_TERM_REF
|
||||
pCtx->bParamSetsLostFlag = true;
|
||||
#else
|
||||
@ -685,19 +683,6 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi
|
||||
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) {
|
||||
pCtx->pGetI16x16LumaPredFunc[I16_PRED_V ] = WelsI16x16LumaPredV_c;
|
||||
pCtx->pGetI16x16LumaPredFunc[I16_PRED_H ] = WelsI16x16LumaPredH_c;
|
||||
|
@ -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 ||
|
||||
pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.bIdrFlag) {
|
||||
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) {
|
||||
WelsLog (pCtx, WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user