Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 71 files). Show all
Unified · Split
| @@ -50,13 +50,11 @@ · 49 unmodified lines | ||
| 50 | 50 | |
| 51 | 51 | #include "cpu_core.h" |
| 52 | 52 | |
| 53 | −namespace WelsDec { | |
| 54 | − | |
| 55 | 53 | extern void FreePicture (PPicture pPic, CMemoryAlign* pMa); |
| 56 | 54 | |
| 57 | 55 | extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight); |
| 58 | 56 | |
| 59 | −static bool CheckRefPics (const PWelsDecoderContext& pCtx) { | |
| 57 | +static bool CheckRefPics (const PWelsDecoderContext pCtx) { | |
| 60 | 58 | int32_t listCount = 1; |
| 61 | 59 | if (pCtx->eSliceType == B_SLICE) { |
| 62 | 60 | ++listCount; |
| @@ -88,7 +86,7 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { · 25 unmodified lines | ||
| 88 | 86 | int32_t iCurLayerWidth = pCurDqLayer->iMbWidth << 4; |
| 89 | 87 | int32_t iCurLayerHeight = pCurDqLayer->iMbHeight << 4; |
| 90 | 88 | |
| 91 | − int32_t iNextMbXyIndex = 0; | |
| 89 | + int32_t iNextMbXyIndex; | |
| 92 | 90 | PFmo pFmo = pCtx->pFmo; |
| 93 | 91 | |
| 94 | 92 | int32_t iTotalNumMb = pCurSlice->iTotalMbInCurSlice; |
| @@ -451,15 +449,15 @@ int32_t ParseIntra4x4Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail · 356 unmodified lines | ||
| 451 | 449 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 452 | 450 | int32_t iFinalMode, i; |
| 453 | 451 | |
| 454 | − uint8_t uiNeighAvail = 0; | |
| 452 | + uint8_t uiNeighAvail; | |
| 455 | 453 | uint32_t uiCode; |
| 456 | 454 | int32_t iCode; |
| 457 | 455 | pCtx->pMapNxNNeighToSampleFunc (pNeighAvail, iSampleAvail); |
| 458 | 456 | uiNeighAvail = (iSampleAvail[6] << 2) | (iSampleAvail[0] << 1) | (iSampleAvail[1]); |
| 459 | 457 | for (i = 0; i < 16; i++) { |
| 460 | − int32_t iPrevIntra4x4PredMode = 0; | |
| 458 | + int32_t iPrevIntra4x4PredMode; | |
| 461 | 459 | if (pCurDqLayer->sLayerInfo.pPps->bEntropyCodingModeFlag) { |
| 462 | − WELS_READ_VERIFY (ParseIntraPredModeLumaCabac (pCtx, iCode)); | |
| 460 | + WELS_READ_VERIFY (ParseIntraPredModeLumaCabac (pCtx, &iCode)); | |
| 463 | 461 | iPrevIntra4x4PredMode = iCode; |
| 464 | 462 | } else { |
| 465 | 463 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); |
| @@ -502,7 +500,7 @@ int32_t ParseIntra4x4Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail · 36 unmodified lines | ||
| 502 | 500 | return ERR_NONE; |
| 503 | 501 | |
| 504 | 502 | if (pCurDqLayer->sLayerInfo.pPps->bEntropyCodingModeFlag) { |
| 505 | − WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, iCode)); | |
| 503 | + WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, &iCode)); | |
| 506 | 504 | if (iCode > MAX_PRED_MODE_ID_CHROMA) { |
| 507 | 505 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_I_CHROMA_PRED_MODE); |
| 508 | 506 | } |
| @@ -530,7 +528,7 @@ int32_t ParseIntra8x8Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail · 21 unmodified lines | ||
| 530 | 528 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 531 | 529 | int32_t iFinalMode, i; |
| 532 | 530 | |
| 533 | − uint8_t uiNeighAvail = 0; | |
| 531 | + uint8_t uiNeighAvail; | |
| 534 | 532 | uint32_t uiCode; |
| 535 | 533 | int32_t iCode; |
| 536 | 534 | pCtx->pMapNxNNeighToSampleFunc (pNeighAvail, iSampleAvail); |
| @@ -540,9 +538,9 @@ int32_t ParseIntra8x8Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail · 3 unmodified lines | ||
| 540 | 538 | pCurDqLayer->pIntraNxNAvailFlag[iMbXy] = uiNeighAvail; |
| 541 | 539 | |
| 542 | 540 | for (i = 0; i < 4; i++) { |
| 543 | − int32_t iPrevIntra4x4PredMode = 0; | |
| 541 | + int32_t iPrevIntra4x4PredMode; | |
| 544 | 542 | if (pCurDqLayer->sLayerInfo.pPps->bEntropyCodingModeFlag) { |
| 545 | − WELS_READ_VERIFY (ParseIntraPredModeLumaCabac (pCtx, iCode)); | |
| 543 | + WELS_READ_VERIFY (ParseIntraPredModeLumaCabac (pCtx, &iCode)); | |
| 546 | 544 | iPrevIntra4x4PredMode = iCode; |
| 547 | 545 | } else { |
| 548 | 546 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); |
| @@ -586,7 +584,7 @@ int32_t ParseIntra8x8Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail · 37 unmodified lines | ||
| 586 | 584 | return ERR_NONE; |
| 587 | 585 | |
| 588 | 586 | if (pCurDqLayer->sLayerInfo.pPps->bEntropyCodingModeFlag) { |
| 589 | − WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, iCode)); | |
| 587 | + WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, &iCode)); | |
| 590 | 588 | if (iCode > MAX_PRED_MODE_ID_CHROMA) { |
| 591 | 589 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_I_CHROMA_PRED_MODE); |
| 592 | 590 | } |
| @@ -623,7 +621,7 @@ int32_t ParseIntra16x16Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAva · 30 unmodified lines | ||
| 623 | 621 | return ERR_NONE; |
| 624 | 622 | |
| 625 | 623 | if (pCurDqLayer->sLayerInfo.pPps->bEntropyCodingModeFlag) { |
| 626 | − WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, iCode)); | |
| 624 | + WELS_READ_VERIFY (ParseIntraPredModeChromaCabac (pCtx, uiNeighAvail, &iCode)); | |
| 627 | 625 | if (iCode > MAX_PRED_MODE_ID_CHROMA) { |
| 628 | 626 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_I_CHROMA_PRED_MODE); |
| 629 | 627 | } |
| @@ -643,7 +641,7 @@ int32_t ParseIntra16x16Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAva · 13 unmodified lines | ||
| 643 | 641 | return ERR_NONE; |
| 644 | 642 | } |
| 645 | 643 | |
| 646 | −int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& uiEosFlag) { | |
| 644 | +int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t *uiEosFlag) { | |
| 647 | 645 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 648 | 646 | PBitStringAux pBsAux = pCurDqLayer->pBitStringAux; |
| 649 | 647 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| @@ -653,7 +651,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 3 unmodified lines | ||
| 653 | 651 | int32_t iScanIdxEnd = pSlice->sSliceHeaderExt.uiScanIdxEnd; |
| 654 | 652 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 655 | 653 | int32_t i; |
| 656 | − uint32_t uiMbType = 0, uiCbp = 0, uiCbpLuma = 0, uiCbpChroma = 0; | |
| 654 | + uint32_t uiMbType = 0, uiCbp = 0, uiCbpLuma, uiCbpChroma; | |
| 657 | 655 | |
| 658 | 656 | ENFORCE_STACK_ALIGN_1D (uint8_t, pNonZeroCount, 48, 16); |
| 659 | 657 | |
| @@ -663,7 +661,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 3 unmodified lines | ||
| 663 | 661 | pCurDqLayer->pInterPredictionDoneFlag[iMbXy] = 0; |
| 664 | 662 | pCurDqLayer->pResidualPredFlag[iMbXy] = pSlice->sSliceHeaderExt.bDefaultResidualPredFlag; |
| 665 | 663 | GetNeighborAvailMbType (&sNeighAvail, pCurDqLayer); |
| 666 | − WELS_READ_VERIFY (ParseMBTypeISliceCabac (pCtx, &sNeighAvail, uiMbType)); | |
| 664 | + WELS_READ_VERIFY (ParseMBTypeISliceCabac (pCtx, &sNeighAvail, &uiMbType)); | |
| 667 | 665 | if (uiMbType > 25) { |
| 668 | 666 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_MB_TYPE); |
| 669 | 667 | } else if (!pCtx->pSps->uiChromaFormatIdc && ((uiMbType >= 5 && uiMbType <= 12) || (uiMbType >= 17 |
| @@ -674,7 +672,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 4 unmodified lines | ||
| 674 | 672 | WELS_READ_VERIFY (ParseIPCMInfoCabac (pCtx)); |
| 675 | 673 | pSlice->iLastDeltaQp = 0; |
| 676 | 674 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| 677 | − if (uiEosFlag) { | |
| 675 | + if (*uiEosFlag) { | |
| 678 | 676 | RestoreCabacDecEngineToBS (pCtx->pCabacDecEngine, pCtx->pCurDqLayer->pBitStringAux); |
| 679 | 677 | } |
| 680 | 678 | return ERR_NONE; |
| @@ -683,7 +681,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 2 unmodified lines | ||
| 683 | 681 | pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA4x4; |
| 684 | 682 | if (pCtx->pPps->bTransform8x8ModeFlag) { |
| 685 | 683 | // Transform 8x8 cabac will be added soon |
| 686 | − WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, &sNeighAvail, pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); | |
| 684 | + WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, &sNeighAvail, &pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); | |
| 687 | 685 | } |
| 688 | 686 | if (pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 689 | 687 | uiMbType = pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA8x8; |
| @@ -694,7 +692,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 4 unmodified lines | ||
| 694 | 692 | WELS_READ_VERIFY (ParseIntra4x4Mode (pCtx, &sNeighAvail, pIntraPredMode, pBsAux, pCurDqLayer)); |
| 695 | 693 | } |
| 696 | 694 | //get uiCbp for I4x4 |
| 697 | − WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, &sNeighAvail, uiCbp)); | |
| 695 | + WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, &sNeighAvail, &uiCbp)); | |
| 698 | 696 | pCurDqLayer->pCbp[iMbXy] = uiCbp; |
| 699 | 697 | pSlice->iLastDeltaQp = uiCbp == 0 ? 0 : pSlice->iLastDeltaQp; |
| 700 | 698 | uiCbpChroma = pCtx->pSps->uiChromaFormatIdc ? uiCbp >> 4 : 0; |
| @@ -730,7 +728,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 29 unmodified lines | ||
| 730 | 728 | if (pCurDqLayer->pCbp[iMbXy] || MB_TYPE_INTRA16x16 == pCurDqLayer->pDec->pMbType[iMbXy]) { |
| 731 | 729 | memset (pCurDqLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurDqLayer->pScaledTCoeff[iMbXy][0])); |
| 732 | 730 | int32_t iQpDelta, iId8x8, iId4x4; |
| 733 | − WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, iQpDelta)); | |
| 731 | + WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, &iQpDelta)); | |
| 734 | 732 | if (iQpDelta > 25 || iQpDelta < -26) {//out of iQpDelta range |
| 735 | 733 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_QP); |
| 736 | 734 | } |
| @@ -844,18 +842,19 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui · 107 unmodified lines | ||
| 844 | 842 | } |
| 845 | 843 | |
| 846 | 844 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| 847 | − if (uiEosFlag) { | |
| 845 | + if (*uiEosFlag) { | |
| 848 | 846 | RestoreCabacDecEngineToBS (pCtx->pCabacDecEngine, pCtx->pCurDqLayer->pBitStringAux); |
| 849 | 847 | } |
| 850 | 848 | return ERR_NONE; |
| 851 | 849 | } |
| 852 | 850 | |
| 853 | −int32_t WelsDecodeMbCabacISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag) { | |
| 851 | +int32_t WelsDecodeMbCabacISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t *uiEosFlag) { | |
| 852 | + USED(pNalCur); | |
| 854 | 853 | WELS_READ_VERIFY (WelsDecodeMbCabacISliceBaseMode0 (pCtx, uiEosFlag)); |
| 855 | 854 | return ERR_NONE; |
| 856 | 855 | } |
| 857 | 856 | |
| 858 | −int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiEosFlag) { | |
| 857 | +int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t *uiEosFlag) { | |
| 859 | 858 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 860 | 859 | PBitStringAux pBsAux = pCurDqLayer->pBitStringAux; |
| 861 | 860 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| @@ -872,7 +871,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 10 unmodified lines | ||
| 872 | 871 | |
| 873 | 872 | pCurDqLayer->pInterPredictionDoneFlag[iMbXy] = 0; |
| 874 | 873 | |
| 875 | − WELS_READ_VERIFY (ParseMBTypePSliceCabac (pCtx, pNeighAvail, uiMbType)); | |
| 874 | + WELS_READ_VERIFY (ParseMBTypePSliceCabac (pCtx, pNeighAvail, &uiMbType)); | |
| 876 | 875 | // uiMbType = 4 is not allowded. |
| 877 | 876 | if (uiMbType < 4) { //Inter mode |
| 878 | 877 | int16_t pMotionVector[LIST_A][30][MV_A]; |
| @@ -894,7 +893,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 15 unmodified lines | ||
| 894 | 893 | WELS_READ_VERIFY (ParseIPCMInfoCabac (pCtx)); |
| 895 | 894 | pSlice->iLastDeltaQp = 0; |
| 896 | 895 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| 897 | − if (uiEosFlag) { | |
| 896 | + if (*uiEosFlag) { | |
| 898 | 897 | RestoreCabacDecEngineToBS (pCtx->pCabacDecEngine, pCtx->pCurDqLayer->pBitStringAux); |
| 899 | 898 | } |
| 900 | 899 | return ERR_NONE; |
| @@ -903,7 +902,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 2 unmodified lines | ||
| 903 | 902 | ENFORCE_STACK_ALIGN_1D (int8_t, pIntraPredMode, 48, 16); |
| 904 | 903 | pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA4x4; |
| 905 | 904 | if (pCtx->pPps->bTransform8x8ModeFlag) { |
| 906 | − WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, pNeighAvail, pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); | |
| 905 | + WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, pNeighAvail, &pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); | |
| 907 | 906 | } |
| 908 | 907 | if (pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 909 | 908 | uiMbType = pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA8x8; |
| @@ -935,7 +934,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 25 unmodified lines | ||
| 935 | 934 | ST32 (&pCurDqLayer->pNzc[iMbXy][20], 0); |
| 936 | 935 | |
| 937 | 936 | if (MB_TYPE_INTRA16x16 != pCurDqLayer->pDec->pMbType[iMbXy]) { |
| 938 | − WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, pNeighAvail, uiCbp)); | |
| 937 | + WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, pNeighAvail, &uiCbp)); | |
| 939 | 938 | |
| 940 | 939 | pCurDqLayer->pCbp[iMbXy] = uiCbp; |
| 941 | 940 | pSlice->iLastDeltaQp = uiCbp == 0 ? 0 : pSlice->iLastDeltaQp; |
| @@ -957,7 +956,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 15 unmodified lines | ||
| 957 | 956 | |
| 958 | 957 | if (bNeedParseTransformSize8x8Flag) { |
| 959 | 958 | WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, pNeighAvail, |
| 960 | − pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); //transform_size_8x8_flag | |
| 959 | + &pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); //transform_size_8x8_flag | |
| 961 | 960 | } |
| 962 | 961 | } |
| 963 | 962 | |
| @@ -965,7 +964,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 1 unmodified line | ||
| 965 | 964 | |
| 966 | 965 | int32_t iQpDelta, iId8x8, iId4x4; |
| 967 | 966 | |
| 968 | − WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, iQpDelta)); | |
| 967 | + WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, &iQpDelta)); | |
| 969 | 968 | if (iQpDelta > 25 || iQpDelta < -26) { //out of iQpDelta range |
| 970 | 969 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_QP); |
| 971 | 970 | } |
| @@ -1085,14 +1084,14 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 113 unmodified lines | ||
| 1085 | 1084 | } |
| 1086 | 1085 | |
| 1087 | 1086 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| 1088 | − if (uiEosFlag) { | |
| 1087 | + if (*uiEosFlag) { | |
| 1089 | 1088 | RestoreCabacDecEngineToBS (pCtx->pCabacDecEngine, pCtx->pCurDqLayer->pBitStringAux); |
| 1090 | 1089 | } |
| 1091 | 1090 | |
| 1092 | 1091 | return ERR_NONE; |
| 1093 | 1092 | } |
| 1094 | 1093 | |
| 1095 | −int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiEosFlag) { | |
| 1094 | +int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t *uiEosFlag) { | |
| 1096 | 1095 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 1097 | 1096 | PBitStringAux pBsAux = pCurDqLayer->pBitStringAux; |
| 1098 | 1097 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| @@ -1109,7 +1108,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 10 unmodified lines | ||
| 1109 | 1108 | |
| 1110 | 1109 | pCurDqLayer->pInterPredictionDoneFlag[iMbXy] = 0; |
| 1111 | 1110 | |
| 1112 | − WELS_READ_VERIFY (ParseMBTypeBSliceCabac (pCtx, pNeighAvail, uiMbType)); | |
| 1111 | + WELS_READ_VERIFY (ParseMBTypeBSliceCabac (pCtx, pNeighAvail, &uiMbType)); | |
| 1113 | 1112 | |
| 1114 | 1113 | if (uiMbType < 23) { //Inter B mode |
| 1115 | 1114 | int16_t pMotionVector[LIST_A][30][MV_A]; |
| @@ -1134,7 +1133,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 18 unmodified lines | ||
| 1134 | 1133 | WELS_READ_VERIFY (ParseIPCMInfoCabac (pCtx)); |
| 1135 | 1134 | pSlice->iLastDeltaQp = 0; |
| 1136 | 1135 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| 1137 | − if (uiEosFlag) { | |
| 1136 | + if (*uiEosFlag) { | |
| 1138 | 1137 | RestoreCabacDecEngineToBS (pCtx->pCabacDecEngine, pCtx->pCurDqLayer->pBitStringAux); |
| 1139 | 1138 | } |
| 1140 | 1139 | return ERR_NONE; |
| @@ -1143,7 +1142,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 2 unmodified lines | ||
| 1143 | 1142 | ENFORCE_STACK_ALIGN_1D (int8_t, pIntraPredMode, 48, 16); |
| 1144 | 1143 | pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA4x4; |
| 1145 | 1144 | if (pCtx->pPps->bTransform8x8ModeFlag) { |
| 1146 | − WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, pNeighAvail, pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); | |
| 1145 | + WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, pNeighAvail, &pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); | |
| 1147 | 1146 | } |
| 1148 | 1147 | if (pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 1149 | 1148 | uiMbType = pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA8x8; |
| @@ -1175,7 +1174,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 25 unmodified lines | ||
| 1175 | 1174 | ST32 (&pCurDqLayer->pNzc[iMbXy][20], 0); |
| 1176 | 1175 | |
| 1177 | 1176 | if (MB_TYPE_INTRA16x16 != pCurDqLayer->pDec->pMbType[iMbXy]) { |
| 1178 | − WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, pNeighAvail, uiCbp)); | |
| 1177 | + WELS_READ_VERIFY (ParseCbpInfoCabac (pCtx, pNeighAvail, &uiCbp)); | |
| 1179 | 1178 | |
| 1180 | 1179 | pCurDqLayer->pCbp[iMbXy] = uiCbp; |
| 1181 | 1180 | pSlice->iLastDeltaQp = uiCbp == 0 ? 0 : pSlice->iLastDeltaQp; |
| @@ -1198,7 +1197,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 16 unmodified lines | ||
| 1198 | 1197 | |
| 1199 | 1198 | if (bNeedParseTransformSize8x8Flag) { |
| 1200 | 1199 | WELS_READ_VERIFY (ParseTransformSize8x8FlagCabac (pCtx, pNeighAvail, |
| 1201 | − pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); //transform_size_8x8_flag | |
| 1200 | + &pCtx->pCurDqLayer->pTransformSize8x8Flag[iMbXy])); //transform_size_8x8_flag | |
| 1202 | 1201 | } |
| 1203 | 1202 | } |
| 1204 | 1203 | |
| @@ -1206,7 +1205,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 1 unmodified line | ||
| 1206 | 1205 | |
| 1207 | 1206 | int32_t iQpDelta, iId8x8, iId4x4; |
| 1208 | 1207 | |
| 1209 | − WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, iQpDelta)); | |
| 1208 | + WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, &iQpDelta)); | |
| 1210 | 1209 | if (iQpDelta > 25 || iQpDelta < -26) { //out of iQpDelta range |
| 1211 | 1210 | return GENERATE_ERROR_NO (ERR_LEVEL_MB_DATA, ERR_INFO_INVALID_QP); |
| 1212 | 1211 | } |
| @@ -1326,7 +1325,7 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 113 unmodified lines | ||
| 1326 | 1325 | } |
| 1327 | 1326 | |
| 1328 | 1327 | WELS_READ_VERIFY (ParseEndOfSliceCabac (pCtx, uiEosFlag)); |
| 1329 | − if (uiEosFlag) { | |
| 1328 | + if (*uiEosFlag) { | |
| 1330 | 1329 | RestoreCabacDecEngineToBS (pCtx->pCabacDecEngine, pCtx->pCurDqLayer->pBitStringAux); |
| 1331 | 1330 | } |
| 1332 | 1331 | |
| @@ -1334,7 +1333,8 @@ int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv · 1 unmodified line | ||
| 1334 | 1333 | } |
| 1335 | 1334 | |
| 1336 | 1335 | |
| 1337 | −int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag) { | |
| 1336 | +int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t *uiEosFlag) { | |
| 1337 | + USED(pNalCur); | |
| 1338 | 1338 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 1339 | 1339 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| 1340 | 1340 | PSliceHeader pSliceHeader = &pSlice->sSliceHeaderExt.sSliceHeader; |
| @@ -1351,8 +1351,7 @@ int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 10 unmodified lines | ||
| 1351 | 1351 | pCurDqLayer->pTransformSize8x8Flag[iMbXy] = false; |
| 1352 | 1352 | |
| 1353 | 1353 | GetNeighborAvailMbType (&uiNeighAvail, pCurDqLayer); |
| 1354 | − WELS_READ_VERIFY (ParseSkipFlagCabac (pCtx, &uiNeighAvail, uiCode)); | |
| 1355 | − | |
| 1354 | + WELS_READ_VERIFY (ParseSkipFlagCabac (pCtx, &uiNeighAvail, &uiCode)); | |
| 1356 | 1355 | if (uiCode) { |
| 1357 | 1356 | int16_t pMv[2] = {0}; |
| 1358 | 1357 | pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_SKIP; |
| @@ -1399,7 +1398,8 @@ int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 40 unmodified lines | ||
| 1399 | 1398 | } |
| 1400 | 1399 | |
| 1401 | 1400 | |
| 1402 | −int32_t WelsDecodeMbCabacBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag) { | |
| 1401 | +int32_t WelsDecodeMbCabacBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t *uiEosFlag) { | |
| 1402 | + USED(pNalCur); | |
| 1403 | 1403 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 1404 | 1404 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| 1405 | 1405 | PSliceHeader pSliceHeader = &pSlice->sSliceHeaderExt.sSliceHeader; |
| @@ -1417,7 +1417,7 @@ int32_t WelsDecodeMbCabacBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 11 unmodified lines | ||
| 1417 | 1417 | pCurDqLayer->pTransformSize8x8Flag[iMbXy] = false; |
| 1418 | 1418 | |
| 1419 | 1419 | GetNeighborAvailMbType (&uiNeighAvail, pCurDqLayer); |
| 1420 | − WELS_READ_VERIFY (ParseSkipFlagCabac (pCtx, &uiNeighAvail, uiCode)); | |
| 1420 | + WELS_READ_VERIFY (ParseSkipFlagCabac (pCtx, &uiNeighAvail, &uiCode)); | |
| 1421 | 1421 | |
| 1422 | 1422 | memset (pCurDqLayer->pDirect[iMbXy], 0, sizeof (int8_t) * 16); |
| 1423 | 1423 | |
| @@ -1450,13 +1450,13 @@ int32_t WelsDecodeMbCabacBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 26 unmodified lines | ||
| 1450 | 1450 | if (pSliceHeader->iDirectSpatialMvPredFlag) { |
| 1451 | 1451 | |
| 1452 | 1452 | //predict direct spatial mv |
| 1453 | − int32_t ret = PredMvBDirectSpatial (pCtx, pMv, ref, subMbType); | |
| 1453 | + int32_t ret = PredMvBDirectSpatial (pCtx, pMv, ref, &subMbType); | |
| 1454 | 1454 | if (ret != ERR_NONE) { |
| 1455 | 1455 | return ret; |
| 1456 | 1456 | } |
| 1457 | 1457 | } else { |
| 1458 | 1458 | //temporal direct mode |
| 1459 | − int32_t ret = PredBDirectTemporal (pCtx, pMv, ref, subMbType); | |
| 1459 | + int32_t ret = PredBDirectTemporal (pCtx, pMv, ref, &subMbType); | |
| 1460 | 1460 | if (ret != ERR_NONE) { |
| 1461 | 1461 | return ret; |
| 1462 | 1462 | } |
| @@ -1513,6 +1513,7 @@ int32_t WelsCalcDeqCoeffScalingList (PWelsDecoderContext pCtx) { · 50 unmodified lines | ||
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNalUnit pNalCur) { |
| 1516 | + USED(bFirstSliceInLayer); | |
| 1516 | 1517 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 1517 | 1518 | PFmo pFmo = pCtx->pFmo; |
| 1518 | 1519 | int32_t iRet; |
| @@ -1523,7 +1524,7 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal · 4 unmodified lines | ||
| 1523 | 1524 | PSliceHeader pSliceHeader = &pSliceHeaderExt->sSliceHeader; |
| 1524 | 1525 | int32_t iMbX, iMbY; |
| 1525 | 1526 | const int32_t kiCountNumMb = pSliceHeader->pSps->uiTotalMbCount; //need to be correct when fmo or multi slice |
| 1526 | − uint32_t uiEosFlag = 0; | |
| 1527 | + uint32_t uiEosFlag; | |
| 1527 | 1528 | PWelsDecMbFunc pDecMbFunc; |
| 1528 | 1529 | |
| 1529 | 1530 | pSlice->iTotalMbInCurSlice = 0; //initialize at the starting of slice decoding. |
| @@ -1535,6 +1536,7 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal · 5 unmodified lines | ||
| 1535 | 1536 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, |
| 1536 | 1537 | "WelsDecodeSlice()::::ILP flag exist, not supported with CABAC enabled!"); |
| 1537 | 1538 | pCtx->iErrorCode |= dsBitstreamError; |
| 1539 | + fprint(2, "dsBitstreamError\n"); | |
| 1538 | 1540 | return dsBitstreamError; |
| 1539 | 1541 | } |
| 1540 | 1542 | if (P_SLICE == pSliceHeader->eSliceType) |
| @@ -1586,15 +1588,17 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal · 45 unmodified lines | ||
| 1586 | 1588 | pCurDqLayer->iMbXyIndex = iNextMbXyIndex; |
| 1587 | 1589 | |
| 1588 | 1590 | do { |
| 1591 | + //fprint(2, "(-1 == %d) || (%d >= %d) → %d\n", iNextMbXyIndex, iNextMbXyIndex, kiCountNumMb, (-1 == iNextMbXyIndex) || (iNextMbXyIndex >= kiCountNumMb)); | |
| 1589 | 1592 | if ((-1 == iNextMbXyIndex) || (iNextMbXyIndex >= kiCountNumMb)) { // slice group boundary or end of a frame |
| 1590 | 1593 | break; |
| 1591 | 1594 | } |
| 1592 | 1595 | |
| 1593 | 1596 | pCurDqLayer->pSliceIdc[iNextMbXyIndex] = iSliceIdc; |
| 1594 | 1597 | pCtx->bMbRefConcealed = false; |
| 1595 | − iRet = pDecMbFunc (pCtx, pNalCur, uiEosFlag); | |
| 1598 | + iRet = pDecMbFunc (pCtx, pNalCur, &uiEosFlag); | |
| 1596 | 1599 | pCurDqLayer->pMbRefConcealedFlag[iNextMbXyIndex] = pCtx->bMbRefConcealed; |
| 1597 | 1600 | if (iRet != ERR_NONE) { |
| 1601 | + fprint(2, "pDecMbFunc %p %p %d\n", pDecMbFunc, WelsDecodeMbCabacPSlice, iRet); | |
| 1598 | 1602 | return iRet; |
| 1599 | 1603 | } |
| 1600 | 1604 | |
| @@ -1659,6 +1663,7 @@ int32_t WelsDecodeAndConstructSlice (PWelsDecoderContext pCtx) { · 58 unmodified lines | ||
| 1659 | 1663 | pDecMbFunc = WelsDecodeMbCavlcISlice; |
| 1660 | 1664 | } |
| 1661 | 1665 | } |
| 1666 | + USED(pDecMbFunc); | |
| 1662 | 1667 | |
| 1663 | 1668 | if (pSliceHeader->pPps->bConstainedIntraPredFlag) { |
| 1664 | 1669 | pCtx->pFillInfoCacheIntraNxNFunc = WelsFillCacheConstrain1IntraNxN; |
| @@ -1697,7 +1702,7 @@ int32_t WelsDecodeAndConstructSlice (PWelsDecoderContext pCtx) { · 32 unmodified lines | ||
| 1697 | 1702 | SDeblockingFilter pFilter; |
| 1698 | 1703 | int32_t iFilterIdc = 1; |
| 1699 | 1704 | if (pSliceHeader->uiDisableDeblockingFilterIdc != 1) { |
| 1700 | − WelsDeblockingInitFilter (pCtx, pFilter, iFilterIdc); | |
| 1705 | + WelsDeblockingInitFilter (pCtx, &pFilter, &iFilterIdc); | |
| 1701 | 1706 | } |
| 1702 | 1707 | |
| 1703 | 1708 | do { |
| @@ -1707,7 +1712,7 @@ int32_t WelsDecodeAndConstructSlice (PWelsDecoderContext pCtx) { · 3 unmodified lines | ||
| 1707 | 1712 | |
| 1708 | 1713 | pCurDqLayer->pSliceIdc[iNextMbXyIndex] = iSliceIdc; |
| 1709 | 1714 | pCtx->bMbRefConcealed = false; |
| 1710 | − iRet = pDecMbFunc (pCtx, pNalCur, uiEosFlag); | |
| 1715 | + iRet = pDecMbFunc (pCtx, pNalCur, &uiEosFlag); | |
| 1711 | 1716 | pCurDqLayer->pMbRefConcealedFlag[iNextMbXyIndex] = pCtx->bMbRefConcealed; |
| 1712 | 1717 | if (iRet != ERR_NONE) { |
| 1713 | 1718 | return iRet; |
| @@ -1724,7 +1729,7 @@ int32_t WelsDecodeAndConstructSlice (PWelsDecoderContext pCtx) { · 10 unmodified lines | ||
| 1724 | 1729 | pCtx->sBlockFunc.pWelsSetNonZeroCountFunc ( |
| 1725 | 1730 | pCtx->pDec->pNzc[pCurDqLayer->iMbXyIndex]); // set all none-zero nzc to 1; dbk can be opti! |
| 1726 | 1731 | } |
| 1727 | − WelsDeblockingFilterMB (pCurDqLayer, pFilter, iFilterIdc, pDeblockMb); | |
| 1732 | + WelsDeblockingFilterMB (pCurDqLayer, &pFilter, &iFilterIdc, pDeblockMb); | |
| 1728 | 1733 | if (pCtx->uiNalRefIdc > 0) { |
| 1729 | 1734 | if (pCurDqLayer->iMbX == 0 || pCurDqLayer->iMbX == pCurDqLayer->iMbWidth - 1 || pCurDqLayer->iMbY == 0 |
| 1730 | 1735 | || pCurDqLayer->iMbY == pCurDqLayer->iMbHeight - 1) { |
| @@ -1799,8 +1804,8 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 68 unmodified lines | ||
| 1799 | 1804 | const int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 1800 | 1805 | int8_t* pNzc = pCurDqLayer->pNzc[iMbXy]; |
| 1801 | 1806 | int32_t i; |
| 1802 | − int32_t iRet = ERR_NONE; | |
| 1803 | − uint32_t uiMbType = 0, uiCbp = 0, uiCbpL = 0, uiCbpC = 0; | |
| 1807 | + int32_t iRet; | |
| 1808 | + uint32_t uiMbType, uiCbp, uiCbpL, uiCbpC; | |
| 1804 | 1809 | uint32_t uiCode; |
| 1805 | 1810 | int32_t iCode; |
| 1806 | 1811 | |
| @@ -1881,6 +1886,7 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 74 unmodified lines | ||
| 1881 | 1886 | pCurDqLayer->pTransformSize8x8Flag[iMbXy] = !!uiCode; |
| 1882 | 1887 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 1883 | 1888 | uiMbType = pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA8x8; |
| 1889 | + USED(uiMbType); | |
| 1884 | 1890 | } |
| 1885 | 1891 | } |
| 1886 | 1892 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| @@ -2063,12 +2069,13 @@ int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx) { · 176 unmodified lines | ||
| 2063 | 2069 | return ERR_NONE; |
| 2064 | 2070 | } |
| 2065 | 2071 | |
| 2066 | −int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag) { | |
| 2072 | +int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t *uiEosFlag) { | |
| 2073 | + USED(pNalCur); | |
| 2067 | 2074 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 2068 | 2075 | PBitStringAux pBs = pCurDqLayer->pBitStringAux; |
| 2069 | 2076 | PSliceHeaderExt pSliceHeaderExt = &pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt; |
| 2070 | 2077 | int32_t iBaseModeFlag; |
| 2071 | − int32_t iRet = 0; //should have the return value to indicate decoding error or not, It's NECESSARY--2010.4.15 | |
| 2078 | + int32_t iRet; //should have the return value to indicate decoding error or not, It's NECESSARY--2010.4.15 | |
| 2072 | 2079 | uint32_t uiCode; |
| 2073 | 2080 | intX_t iUsedBits; |
| 2074 | 2081 | if (pSliceHeaderExt->bAdaptiveBaseModeFlag == 1) { |
| @@ -2092,7 +2099,7 @@ int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 17 unmodified lines | ||
| 2092 | 2099 | iUsedBits = ((pBs->pCurBuf - pBs->pStartBuf) << 3) - (16 - pBs->iLeftBits); |
| 2093 | 2100 | // sub 1, for stop bit |
| 2094 | 2101 | if ((iUsedBits == (pBs->iBits - 1)) && (0 >= pCurDqLayer->sLayerInfo.sSliceInLayer.iMbSkipRun)) { // slice boundary |
| 2095 | − uiEosFlag = 1; | |
| 2102 | + *uiEosFlag = 1; | |
| 2096 | 2103 | } |
| 2097 | 2104 | if (iUsedBits > (pBs->iBits - |
| 2098 | 2105 | 1)) { //When BS incomplete, as long as find it, SHOULD stop decoding to avoid mosaic or crash. |
| @@ -2120,8 +2127,8 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 21 unmodified lines | ||
| 2120 | 2127 | const int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 2121 | 2128 | int8_t* pNzc = pCurDqLayer->pNzc[iMbXy]; |
| 2122 | 2129 | int32_t i; |
| 2123 | − int32_t iRet = ERR_NONE; | |
| 2124 | − uint32_t uiMbType = 0, uiCbp = 0, uiCbpL = 0, uiCbpC = 0; | |
| 2130 | + int32_t iRet; | |
| 2131 | + uint32_t uiMbType, uiCbp, uiCbpL = 0, uiCbpC = 0; | |
| 2125 | 2132 | uint32_t uiCode; |
| 2126 | 2133 | int32_t iCode; |
| 2127 | 2134 | int32_t iMbResProperty; |
| @@ -2230,6 +2237,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 102 unmodified lines | ||
| 2230 | 2237 | pCurDqLayer->pTransformSize8x8Flag[iMbXy] = !!uiCode; |
| 2231 | 2238 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 2232 | 2239 | uiMbType = pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA8x8; |
| 2240 | + USED(uiMbType); | |
| 2233 | 2241 | } |
| 2234 | 2242 | } |
| 2235 | 2243 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| @@ -2440,7 +2448,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 204 unmodified lines | ||
| 2440 | 2448 | return ERR_NONE; |
| 2441 | 2449 | } |
| 2442 | 2450 | |
| 2443 | −int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag) { | |
| 2451 | +int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t *uiEosFlag) { | |
| 2444 | 2452 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 2445 | 2453 | PBitStringAux pBs = pCurDqLayer->pBitStringAux; |
| 2446 | 2454 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| @@ -2450,7 +2458,7 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 3 unmodified lines | ||
| 2450 | 2458 | const int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 2451 | 2459 | int8_t* pNzc = pCurDqLayer->pNzc[iMbXy]; |
| 2452 | 2460 | int32_t iBaseModeFlag, i; |
| 2453 | − int32_t iRet = 0; //should have the return value to indicate decoding error or not, It's NECESSARY--2010.4.15 | |
| 2461 | + int32_t iRet; //should have the return value to indicate decoding error or not, It's NECESSARY--2010.4.15 | |
| 2454 | 2462 | uint32_t uiCode; |
| 2455 | 2463 | |
| 2456 | 2464 | pCurDqLayer->pNoSubMbPartSizeLessThan8x8Flag[iMbXy] = true; |
| @@ -2522,7 +2530,7 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 65 unmodified lines | ||
| 2522 | 2530 | iUsedBits = ((pBs->pCurBuf - pBs->pStartBuf) << 3) - (16 - pBs->iLeftBits); |
| 2523 | 2531 | // sub 1, for stop bit |
| 2524 | 2532 | if ((iUsedBits == (pBs->iBits - 1)) && (0 >= pCurDqLayer->sLayerInfo.sSliceInLayer.iMbSkipRun)) { // slice boundary |
| 2525 | − uiEosFlag = 1; | |
| 2533 | + *uiEosFlag = 1; | |
| 2526 | 2534 | } |
| 2527 | 2535 | if (iUsedBits > (pBs->iBits - |
| 2528 | 2536 | 1)) { //When BS incomplete, as long as find it, SHOULD stop decoding to avoid mosaic or crash. |
| @@ -2534,7 +2542,7 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 5 unmodified lines | ||
| 2534 | 2542 | return ERR_NONE; |
| 2535 | 2543 | } |
| 2536 | 2544 | |
| 2537 | −int32_t WelsDecodeMbCavlcBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag) { | |
| 2545 | +int32_t WelsDecodeMbCavlcBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t *uiEosFlag) { | |
| 2538 | 2546 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 2539 | 2547 | PBitStringAux pBs = pCurDqLayer->pBitStringAux; |
| 2540 | 2548 | PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; |
| @@ -2545,7 +2553,7 @@ int32_t WelsDecodeMbCavlcBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 4 unmodified lines | ||
| 2545 | 2553 | const int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 2546 | 2554 | int8_t* pNzc = pCurDqLayer->pNzc[iMbXy]; |
| 2547 | 2555 | int32_t iBaseModeFlag, i; |
| 2548 | − int32_t iRet = 0; //should have the return value to indicate decoding error or not, It's NECESSARY--2010.4.15 | |
| 2556 | + int32_t iRet; //should have the return value to indicate decoding error or not, It's NECESSARY--2010.4.15 | |
| 2549 | 2557 | uint32_t uiCode; |
| 2550 | 2558 | |
| 2551 | 2559 | pCurDqLayer->pNoSubMbPartSizeLessThan8x8Flag[iMbXy] = true; |
| @@ -2587,13 +2595,13 @@ int32_t WelsDecodeMbCavlcBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 35 unmodified lines | ||
| 2587 | 2595 | if (pSliceHeader->iDirectSpatialMvPredFlag) { |
| 2588 | 2596 | |
| 2589 | 2597 | //predict direct spatial mv |
| 2590 | − int32_t ret = PredMvBDirectSpatial (pCtx, iMv, ref, subMbType); | |
| 2598 | + int32_t ret = PredMvBDirectSpatial (pCtx, iMv, ref, &subMbType); | |
| 2591 | 2599 | if (ret != ERR_NONE) { |
| 2592 | 2600 | return ret; |
| 2593 | 2601 | } |
| 2594 | 2602 | } else { |
| 2595 | 2603 | //temporal direct mode |
| 2596 | − int32_t ret = PredBDirectTemporal (pCtx, iMv, ref, subMbType); | |
| 2604 | + int32_t ret = PredBDirectTemporal (pCtx, iMv, ref, &subMbType); | |
| 2597 | 2605 | if (ret != ERR_NONE) { |
| 2598 | 2606 | return ret; |
| 2599 | 2607 | } |
| @@ -2636,7 +2644,7 @@ int32_t WelsDecodeMbCavlcBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uin · 36 unmodified lines | ||
| 2636 | 2644 | iUsedBits = ((pBs->pCurBuf - pBs->pStartBuf) << 3) - (16 - pBs->iLeftBits); |
| 2637 | 2645 | // sub 1, for stop bit |
| 2638 | 2646 | if ((iUsedBits == (pBs->iBits - 1)) && (0 >= pCurDqLayer->sLayerInfo.sSliceInLayer.iMbSkipRun)) { // slice boundary |
| 2639 | − uiEosFlag = 1; | |
| 2647 | + *uiEosFlag = 1; | |
| 2640 | 2648 | } |
| 2641 | 2649 | if (iUsedBits > (pBs->iBits - |
| 2642 | 2650 | 1)) { //When BS incomplete, as long as find it, SHOULD stop decoding to avoid mosaic or crash. |
| @@ -2664,8 +2672,8 @@ int32_t WelsActualDecodeMbCavlcBSlice (PWelsDecoderContext pCtx) { · 21 unmodified lines | ||
| 2664 | 2672 | const int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 2665 | 2673 | int8_t* pNzc = pCurDqLayer->pNzc[iMbXy]; |
| 2666 | 2674 | int32_t i; |
| 2667 | − int32_t iRet = ERR_NONE; | |
| 2668 | − uint32_t uiMbType = 0, uiCbp = 0, uiCbpL = 0, uiCbpC = 0; | |
| 2675 | + int32_t iRet; | |
| 2676 | + uint32_t uiMbType, uiCbp, uiCbpL = 0, uiCbpC = 0; | |
| 2669 | 2677 | uint32_t uiCode; |
| 2670 | 2678 | int32_t iCode; |
| 2671 | 2679 | int32_t iMbResProperty; |
| @@ -2774,6 +2782,7 @@ int32_t WelsActualDecodeMbCavlcBSlice (PWelsDecoderContext pCtx) { · 102 unmodified lines | ||
| 2774 | 2782 | pCurDqLayer->pTransformSize8x8Flag[iMbXy] = !!uiCode; |
| 2775 | 2783 | if (pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| 2776 | 2784 | uiMbType = pCurDqLayer->pDec->pMbType[iMbXy] = MB_TYPE_INTRA8x8; |
| 2785 | + USED(uiMbType); | |
| 2777 | 2786 | } |
| 2778 | 2787 | } |
| 2779 | 2788 | if (!pCurDqLayer->pTransformSize8x8Flag[iMbXy]) { |
| @@ -2985,6 +2994,7 @@ int32_t WelsActualDecodeMbCavlcBSlice (PWelsDecoderContext pCtx) { · 205 unmodified lines | ||
| 2985 | 2994 | } |
| 2986 | 2995 | |
| 2987 | 2996 | void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) { |
| 2997 | + USED(iCpu); | |
| 2988 | 2998 | pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_c; |
| 2989 | 2999 | pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c; |
| 2990 | 3000 | pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c; |
| @@ -3061,4 +3071,3 @@ bool ComputeColocatedTemporalScaling (PWelsDecoderContext pCtx) { · 70 unmodified lines | ||
| 3061 | 3071 | } |
| 3062 | 3072 | return true; |
| 3063 | 3073 | } |
| 3064 | −} // namespace WelsDec | |