************************************************************************************* * \brief to parse scalinglist message payload * * \param pps sps scaling list matrix message to be parsed output * \param pBsAux bitstream reader auxiliary * * \return 0 - successed * 1 - failed * * \note Call it in case scaling list matrix present at sps or pps level ******
| 1674 | ************************************************************************************* |
| 1675 | */ |
| 1676 | int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* bUseDefaultScalingMatrixFlag, |
| 1677 | PBitStringAux pBsAux) { // reserved Sei_Msg type |
| 1678 | int iLastScale = 8; |
| 1679 | int iNextScale = 8; |
| 1680 | int iDeltaScale; |
| 1681 | int32_t iCode; |
| 1682 | int32_t iIdx; |
| 1683 | for (int j = 0; j < iScalingListNum; j++) { |
| 1684 | if (iNextScale != 0) { |
| 1685 | WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); |
| 1686 | WELS_CHECK_SE_BOTH_ERROR_NOLOG (iCode, SCALING_LIST_DELTA_SCALE_MIN, SCALING_LIST_DELTA_SCALE_MAX, "DeltaScale", |
| 1687 | ERR_SCALING_LIST_DELTA_SCALE); |
| 1688 | iDeltaScale = iCode; |
| 1689 | iNextScale = (iLastScale + iDeltaScale + 256) % 256; |
| 1690 | *bUseDefaultScalingMatrixFlag = (j == 0 && iNextScale == 0); |
| 1691 | if (*bUseDefaultScalingMatrixFlag) |
| 1692 | break; |
| 1693 | } |
| 1694 | iIdx = iScalingListNum == 16 ? g_kuiZigzagScan[j] : g_kuiZigzagScan8x8[j]; |
| 1695 | pScalingList[iIdx] = (iNextScale == 0) ? iLastScale : iNextScale; |
| 1696 | iLastScale = pScalingList[iIdx]; |
| 1697 | } |
| 1698 | |
| 1699 | |
| 1700 | return ERR_NONE; |
| 1701 | } |
| 1702 | |
| 1703 | int32_t ParseScalingList (PSps pSps, PBitStringAux pBs, bool bPPS, const bool kbTrans8x8ModeFlag, |
| 1704 | bool* pScalingListPresentFlag, uint8_t (*iScalingList4x4)[16], uint8_t (*iScalingList8x8)[64]) { |
no test coverage detected