Showing the changes to codec/decoder (4 of 4 files). Show all
Unified · Split
| @@ -447,7 +447,6 @@ typedef struct TagWelsDecoderContext { · 446 unmodified lines | ||
| 447 | 447 | uint16_t (*pDequant_coeff8x8[6])[64];//64 residual coeff ,with 6 kinds of residual type, 52 qp level |
| 448 | 448 | int iDequantCoeffPpsid;//When a new pps actived, reinitialised the scaling list value |
| 449 | 449 | bool bDequantCoeff4x4Init; |
| 450 | − bool bSpsLatePps; | |
| 451 | 450 | bool bUseScalingList; |
| 452 | 451 | CMemoryAlign* pMemAlign; |
| 453 | 452 | } SWelsDecoderContext, *PWelsDecoderContext; |
| @@ -1420,9 +1420,10 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 1419 unmodified lines | ||
| 1420 | 1420 | WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bTransform8x8ModeFlag, |
| 1421 | 1421 | pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4, pPps->iScalingList8x8)); |
| 1422 | 1422 | } else { |
| 1423 | − pCtx->bSpsLatePps = true; | |
| 1424 | − WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bTransform8x8ModeFlag, pPps->bPicScalingListPresentFlag, | |
| 1425 | − pPps->iScalingList4x4, pPps->iScalingList8x8)); | |
| 1423 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 1424 | + "ParsePps(): sps_id (%d) does not exist for scaling_list. This PPS (%d) is marked as invalid.", pPps->iSpsId, | |
| 1425 | + pPps->iPpsId); | |
| 1426 | + return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_SPS_ID); | |
| 1426 | 1427 | } |
| 1427 | 1428 | } |
| 1428 | 1429 | WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //second_chroma_qp_index_offset |
| @@ -1665,13 +1666,10 @@ int32_t ParseScalingList (PSps pSps, PBitStringAux pBs, bool bPPS, const bool kb · 236 unmodified lines | ||
| 1665 | 1666 | const uint8_t* defaultScaling[4]; |
| 1666 | 1667 | |
| 1667 | 1668 | if (!bPPS) { //sps scaling_list |
| 1668 | − if (pSps != NULL) { | |
| 1669 | − uiScalingListNum = (pSps->uiChromaFormatIdc != 3) ? 8 : 12; | |
| 1670 | − bInit = bPPS && pSps->bSeqScalingMatrixPresentFlag; | |
| 1671 | − } else | |
| 1672 | − uiScalingListNum = 12; | |
| 1669 | + uiScalingListNum = (pSps->uiChromaFormatIdc != 3) ? 8 : 12; | |
| 1673 | 1670 | } else { //pps scaling_list |
| 1674 | 1671 | uiScalingListNum = 6 + (int32_t) kbTrans8x8ModeFlag * ((pSps->uiChromaFormatIdc != 3) ? 2 : 6); |
| 1672 | + bInit = pSps->bSeqScalingMatrixPresentFlag; | |
| 1675 | 1673 | } |
| 1676 | 1674 | |
| 1677 | 1675 | //Init default_scaling_list value for sps or pps |
| @@ -1112,25 +1112,6 @@ int32_t WelsCalcDeqCoeffScalingList (PWelsDecoderContext pCtx) { · 1111 unmodified lines | ||
| 1112 | 1112 | |
| 1113 | 1113 | if (!pCtx->bDequantCoeff4x4Init || (pCtx->iDequantCoeffPpsid != pCtx->pPps->iPpsId)) { |
| 1114 | 1114 | int i, q, x, y; |
| 1115 | − // Rewrite pps scaling list for scalingList present flag=0 | |
| 1116 | − if (pCtx->bSpsLatePps) { | |
| 1117 | − for (i = 0; i < 12; i++) { | |
| 1118 | − //if (!pCtx->pSps->bSeqScalingListPresentFlag[i]) { | |
| 1119 | − if (!pCtx->pPps->bPicScalingListPresentFlag[i]) { | |
| 1120 | − if (i < 6) { | |
| 1121 | − if (i == 0 || i == 3) | |
| 1122 | − memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pSps->iScalingList4x4[i], 16 * sizeof (uint8_t)); | |
| 1123 | − else | |
| 1124 | − memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pPps->iScalingList4x4[i - 1], 16 * sizeof (uint8_t)); | |
| 1125 | − } else { | |
| 1126 | − if (i == 6 || i == 7) | |
| 1127 | − memcpy (pCtx->pPps->iScalingList8x8[ i - 6 ], pCtx->pSps->iScalingList8x8[ i - 6 ], 64 * sizeof (uint8_t)); | |
| 1128 | − else | |
| 1129 | − memcpy (pCtx->pPps->iScalingList8x8[ i - 6 ], pCtx->pPps->iScalingList8x8[i - 8], 64 * sizeof (uint8_t)); | |
| 1130 | − } | |
| 1131 | − } | |
| 1132 | − } | |
| 1133 | − } | |
| 1134 | 1115 | //Init dequant coeff value for different QP |
| 1135 | 1116 | for (i = 0; i < 6; i++) { |
| 1136 | 1117 | pCtx->pDequant_coeff4x4[i] = pCtx->pDequant_coeff_buffer4x4[i]; |
| @@ -312,7 +312,6 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 311 unmodified lines | ||
| 312 | 312 | pCtx->bAvcBasedFlag = true; |
| 313 | 313 | pCtx->pPreviousDecodedPictureInDpb = NULL; |
| 314 | 314 | pCtx->sDecoderStatistics.iAvgLumaQp = -1; |
| 315 | − pCtx->bSpsLatePps = false; | |
| 316 | 315 | pCtx->bUseScalingList = false; |
| 317 | 316 | pCtx->iSpsErrorIgnored = 0; |
| 318 | 317 | pCtx->iSubSpsErrorIgnored = 0; |