fix travis ci error
Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 11 files). Show all
Unified · Split
| @@ -559,8 +559,10 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 558 unmodified lines | ||
| 559 | 559 | |
| 560 | 560 | if (pCurLayer->pCbp[iMbXy] == 0 && IS_INTRA4x4 (pCurLayer->pMbType[iMbXy])) { |
| 561 | 561 | pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; |
| 562 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 ((pCurLayer->pLumaQp[iMbXy] + | |
| 563 | − pSliceHeader->pPps->iChromaQpIndexOffset), 0, 51)]; | |
| 562 | + for (i = 0; i < 2; i++) { | |
| 563 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 ((pCurLayer->pLumaQp[iMbXy] + | |
| 564 | + pSliceHeader->pPps->iChromaQpIndexOffset[i]), 0, 51)]; | |
| 565 | + } | |
| 564 | 566 | } |
| 565 | 567 | |
| 566 | 568 | if (pCurLayer->pCbp[iMbXy] || MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) { |
| @@ -572,8 +574,10 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 5 unmodified lines | ||
| 572 | 574 | } |
| 573 | 575 | pCurLayer->pLumaQp[iMbXy] = (pSlice->iLastMbQp + iQpDelta + 52) % 52; //update last_mb_qp |
| 574 | 576 | pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy]; |
| 575 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 ((pSlice->iLastMbQp + | |
| 576 | − pSliceHeader->pPps->iChromaQpIndexOffset), 0, 51)]; | |
| 577 | + for (i = 0; i < 2; i++) { | |
| 578 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 ((pSlice->iLastMbQp + | |
| 579 | + pSliceHeader->pPps->iChromaQpIndexOffset[i]), 0, 51)]; | |
| 580 | + } | |
| 577 | 581 | if (MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) { |
| 578 | 582 | //step1: Luma DC |
| 579 | 583 | WELS_READ_VERIFY (ParseResidualBlockCabac (&sNeighAvail, pNonZeroCount, pBsAux, 0, 16, g_kuiLumaDcZigzagScan, |
| @@ -625,7 +629,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 45 unmodified lines | ||
| 625 | 629 | for (i = 0; i < 2; i++) { |
| 626 | 630 | iMbResProperty = i ? CHROMA_DC_V : CHROMA_DC_U; |
| 627 | 631 | WELS_READ_VERIFY (ParseResidualBlockCabac (&sNeighAvail, pNonZeroCount, pBsAux, 16 + (i << 2), 4, g_kuiChromaDcScan, |
| 628 | − iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + 256 + (i << 6), pCurLayer->pChromaQp[iMbXy], pCtx)); | |
| 632 | + iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + 256 + (i << 6), pCurLayer->pChromaQp[iMbXy][i], pCtx)); | |
| 629 | 633 | } |
| 630 | 634 | } |
| 631 | 635 | |
| @@ -637,7 +641,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 5 unmodified lines | ||
| 637 | 641 | for (iId4x4 = 0; iId4x4 < 4; iId4x4++) { |
| 638 | 642 | WELS_READ_VERIFY (ParseResidualBlockCabac (&sNeighAvail, pNonZeroCount, pBsAux, iIdx, |
| 639 | 643 | iScanIdxEnd - WELS_MAX (iScanIdxStart, 1) + 1, g_kuiZigzagScan + WELS_MAX (iScanIdxStart, 1), iMbResProperty, |
| 640 | − pCurLayer->pScaledTCoeff[iMbXy] + (iIdx << 4), pCurLayer->pChromaQp[iMbXy], pCtx)); | |
| 644 | + pCurLayer->pScaledTCoeff[iMbXy] + (iIdx << 4), pCurLayer->pChromaQp[iMbXy][i], pCtx)); | |
| 641 | 645 | iIdx++; |
| 642 | 646 | } |
| 643 | 647 | } |
| @@ -772,8 +776,10 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 128 unmodified lines | ||
| 772 | 776 | } |
| 773 | 777 | pCurLayer->pLumaQp[iMbXy] = (pSlice->iLastMbQp + iQpDelta + 52) % 52; //update last_mb_qp |
| 774 | 778 | pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy]; |
| 775 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + | |
| 776 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)]; | |
| 779 | + for (i = 0; i < 2; i++) { | |
| 780 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + | |
| 781 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, 51)]; | |
| 782 | + } | |
| 777 | 783 | |
| 778 | 784 | if (MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) { |
| 779 | 785 | //step1: Luma DC |
| @@ -830,7 +836,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 50 unmodified lines | ||
| 830 | 836 | iMbResProperty = i ? CHROMA_DC_V_INTER : CHROMA_DC_U_INTER; |
| 831 | 837 | |
| 832 | 838 | WELS_READ_VERIFY (ParseResidualBlockCabac (pNeighAvail, pNonZeroCount, pBsAux, 16 + (i << 2), 4, g_kuiChromaDcScan, |
| 833 | − iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + 256 + (i << 6), pCurLayer->pChromaQp[iMbXy], pCtx)); | |
| 839 | + iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + 256 + (i << 6), pCurLayer->pChromaQp[iMbXy][i], pCtx)); | |
| 834 | 840 | } |
| 835 | 841 | } |
| 836 | 842 | //step2: AC |
| @@ -844,7 +850,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 7 unmodified lines | ||
| 844 | 850 | for (iId4x4 = 0; iId4x4 < 4; iId4x4++) { |
| 845 | 851 | WELS_READ_VERIFY (ParseResidualBlockCabac (pNeighAvail, pNonZeroCount, pBsAux, index, |
| 846 | 852 | iScanIdxEnd - WELS_MAX (iScanIdxStart, 1) + 1, g_kuiZigzagScan + WELS_MAX (iScanIdxStart, 1), |
| 847 | − iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + (index << 4), pCurLayer->pChromaQp[iMbXy], pCtx)); | |
| 853 | + iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + (index << 4), pCurLayer->pChromaQp[iMbXy][i], pCtx)); | |
| 848 | 854 | index++; |
| 849 | 855 | } |
| 850 | 856 | } |
| @@ -858,8 +864,10 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 7 unmodified lines | ||
| 858 | 864 | } |
| 859 | 865 | } else { |
| 860 | 866 | pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; |
| 861 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 862 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)]; | |
| 867 | + for (i = 0; i < 2; i++) { | |
| 868 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 869 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, 51)]; | |
| 870 | + } | |
| 863 | 871 | } |
| 864 | 872 | |
| 865 | 873 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| @@ -911,8 +919,10 @@ int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 45 unmodified lines | ||
| 911 | 919 | |
| 912 | 920 | //reset rS |
| 913 | 921 | pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; //??????????????? dqaunt of previous mb |
| 914 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 915 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)]; | |
| 922 | + for (i = 0; i < 2; i++) { | |
| 923 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 924 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, 51)]; | |
| 925 | + } | |
| 916 | 926 | |
| 917 | 927 | //for neighboring CABAC usage |
| 918 | 928 | pSlice->iLastDeltaQp = 0; |
| @@ -1145,7 +1155,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 226 unmodified lines | ||
| 1145 | 1155 | |
| 1146 | 1156 | //step 3: update QP and pNonZeroCount |
| 1147 | 1157 | pCurLayer->pLumaQp[iMbXy] = 0; |
| 1148 | − pCurLayer->pChromaQp[iMbXy] = 0; | |
| 1158 | + memset (pCurLayer->pChromaQp[iMbXy], 0, sizeof (pCurLayer->pChromaQp[iMbXy])); | |
| 1149 | 1159 | memset (pNzc, 16, sizeof (pCurLayer->pNzc[iMbXy])); //Rec. 9.2.1 for PCM, nzc=16 |
| 1150 | 1160 | WELS_READ_VERIFY (InitReadBits (pBs, 0)); |
| 1151 | 1161 | return 0; |
| @@ -1186,8 +1196,10 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 34 unmodified lines | ||
| 1186 | 1196 | |
| 1187 | 1197 | if (pCurLayer->pCbp[iMbXy] == 0 && IS_INTRA4x4 (pCurLayer->pMbType[iMbXy])) { |
| 1188 | 1198 | pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; |
| 1189 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 1190 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)]; | |
| 1199 | + for (i = 0; i < 2; i++) { | |
| 1200 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 1201 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, 51)]; | |
| 1202 | + } | |
| 1191 | 1203 | |
| 1192 | 1204 | } |
| 1193 | 1205 | |
| @@ -1204,9 +1216,11 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 10 unmodified lines | ||
| 1204 | 1216 | |
| 1205 | 1217 | pCurLayer->pLumaQp[iMbXy] = (pSlice->iLastMbQp + iQpDelta + 52) % 52; //update last_mb_qp |
| 1206 | 1218 | pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy]; |
| 1207 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + | |
| 1208 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, | |
| 1209 | − 51)]; | |
| 1219 | + for (i = 0; i < 2; i++) { | |
| 1220 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + | |
| 1221 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, | |
| 1222 | + 51)]; | |
| 1223 | + } | |
| 1210 | 1224 | |
| 1211 | 1225 | |
| 1212 | 1226 | BsStartCavlc (pBs); |
| @@ -1262,7 +1276,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 49 unmodified lines | ||
| 1262 | 1276 | iMbResProperty = i ? CHROMA_DC_V : CHROMA_DC_U; |
| 1263 | 1277 | if (WelsResidualBlockCavlc (pVlcTable, pNonZeroCount, pBs, |
| 1264 | 1278 | 16 + (i << 2), 4, g_kuiChromaDcScan, iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + 256 + (i << 6), |
| 1265 | − pCurLayer->pChromaQp[iMbXy], pCtx)) { | |
| 1279 | + pCurLayer->pChromaQp[iMbXy][i], pCtx)) { | |
| 1266 | 1280 | return -1;//abnormal |
| 1267 | 1281 | } |
| 1268 | 1282 | } |
| @@ -1276,7 +1290,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 7 unmodified lines | ||
| 1276 | 1290 | for (iId4x4 = 0; iId4x4 < 4; iId4x4++) { |
| 1277 | 1291 | if (WelsResidualBlockCavlc (pVlcTable, pNonZeroCount, pBs, iIndex, |
| 1278 | 1292 | iScanIdxEnd - WELS_MAX (iScanIdxStart, 1) + 1, g_kuiZigzagScan + WELS_MAX (iScanIdxStart, 1), |
| 1279 | − iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + (iIndex << 4), pCurLayer->pChromaQp[iMbXy], pCtx)) { | |
| 1293 | + iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + (iIndex << 4), pCurLayer->pChromaQp[iMbXy][i], pCtx)) { | |
| 1280 | 1294 | return -1;//abnormal |
| 1281 | 1295 | } |
| 1282 | 1296 | iIndex++; |
| @@ -1435,7 +1449,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 152 unmodified lines | ||
| 1435 | 1449 | |
| 1436 | 1450 | //step 3: update QP and pNonZeroCount |
| 1437 | 1451 | pCurLayer->pLumaQp[iMbXy] = 0; |
| 1438 | − pCurLayer->pChromaQp[iMbXy] = 0; | |
| 1452 | + pCurLayer->pChromaQp[iMbXy][0] = pCurLayer->pChromaQp[iMbXy][1] = 0; | |
| 1439 | 1453 | //Rec. 9.2.1 for PCM, nzc=16 |
| 1440 | 1454 | ST32A4 (&pNzc[0], 0x10101010); |
| 1441 | 1455 | ST32A4 (&pNzc[4], 0x10101010); |
| @@ -1493,8 +1507,10 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 51 unmodified lines | ||
| 1493 | 1507 | ST32A4 (&pNzc[20], 0); |
| 1494 | 1508 | if (pCurLayer->pCbp[iMbXy] == 0 && !IS_INTRA16x16 (pCurLayer->pMbType[iMbXy]) && !IS_I_BL (pCurLayer->pMbType[iMbXy])) { |
| 1495 | 1509 | pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; |
| 1496 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 1497 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)]; | |
| 1510 | + for (i = 0; i < 2; i++) { | |
| 1511 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 1512 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, 51)]; | |
| 1513 | + } | |
| 1498 | 1514 | } |
| 1499 | 1515 | |
| 1500 | 1516 | if (pCurLayer->pCbp[iMbXy] || MB_TYPE_INTRA16x16 == pCurLayer->pMbType[iMbXy]) { |
| @@ -1509,9 +1525,11 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 8 unmodified lines | ||
| 1509 | 1525 | |
| 1510 | 1526 | pCurLayer->pLumaQp[iMbXy] = (pSlice->iLastMbQp + iQpDelta + 52) % 52; //update last_mb_qp |
| 1511 | 1527 | pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy]; |
| 1512 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + | |
| 1513 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, | |
| 1514 | − 51)]; | |
| 1528 | + for (i = 0; i < 2; i++) { | |
| 1529 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp + | |
| 1530 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, | |
| 1531 | + 51)]; | |
| 1532 | + } | |
| 1515 | 1533 | |
| 1516 | 1534 | BsStartCavlc (pBs); |
| 1517 | 1535 | |
| @@ -1572,7 +1590,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 54 unmodified lines | ||
| 1572 | 1590 | |
| 1573 | 1591 | if (WelsResidualBlockCavlc (pVlcTable, pNonZeroCount, pBs, |
| 1574 | 1592 | 16 + (i << 2), 4, g_kuiChromaDcScan, iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + 256 + (i << 6), |
| 1575 | − pCurLayer->pChromaQp[iMbXy], pCtx)) { | |
| 1593 | + pCurLayer->pChromaQp[iMbXy][i], pCtx)) { | |
| 1576 | 1594 | return -1;//abnormal |
| 1577 | 1595 | } |
| 1578 | 1596 | } |
| @@ -1590,7 +1608,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 11 unmodified lines | ||
| 1590 | 1608 | for (iId4x4 = 0; iId4x4 < 4; iId4x4++) { |
| 1591 | 1609 | if (WelsResidualBlockCavlc (pVlcTable, pNonZeroCount, pBs, iIndex, |
| 1592 | 1610 | iScanIdxEnd - WELS_MAX (iScanIdxStart, 1) + 1, g_kuiZigzagScan + WELS_MAX (iScanIdxStart, 1), |
| 1593 | − iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + (iIndex << 4), pCurLayer->pChromaQp[iMbXy], pCtx)) { | |
| 1611 | + iMbResProperty, pCurLayer->pScaledTCoeff[iMbXy] + (iIndex << 4), pCurLayer->pChromaQp[iMbXy][i], pCtx)) { | |
| 1594 | 1612 | return -1;//abnormal |
| 1595 | 1613 | } |
| 1596 | 1614 | iIndex++; |
| @@ -1655,8 +1673,10 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 58 unmodified lines | ||
| 1655 | 1673 | if (!pSlice->sSliceHeaderExt.bDefaultResidualPredFlag || |
| 1656 | 1674 | (pNalCur->sNalHeaderExt.uiQualityId == 0 && pNalCur->sNalHeaderExt.uiDependencyId == 0)) { |
| 1657 | 1675 | pCurLayer->pLumaQp[iMbXy] = pSlice->iLastMbQp; |
| 1658 | − pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 1659 | − pSliceHeader->pPps->iChromaQpIndexOffset, 0, 51)]; | |
| 1676 | + for (i = 0; i < 2; i++) { | |
| 1677 | + pCurLayer->pChromaQp[iMbXy][i] = g_kuiChromaQpTable[WELS_CLIP3 (pCurLayer->pLumaQp[iMbXy] + | |
| 1678 | + pSliceHeader->pPps->iChromaQpIndexOffset[i], 0, 51)]; | |
| 1679 | + } | |
| 1660 | 1680 | } |
| 1661 | 1681 | |
| 1662 | 1682 | pCurLayer->pCbp[iMbXy] = 0; |