{ WelsDecodeBs(pDstInfo) { ConstructAccessUnit() { DecodeCurrentAccessUnit() { int32_t iIdx = pCurAu->uiStartPos; int32_t iEndIdx = pCurAu->uiEndPos; while (iIdx <= iEndIdx) { /* * Loop decoding for slices (even FMO and/ multiple slices) within a dq layer */ while (iIdx <= iEndIdx) { WelsDecodeSlice() { WelsCabacContextInit() InitCabacDecEngineFromBS() do { if ((-1 == iNextMbXyIndex) || (iNextMbXyIndex >= kiCountNumMb)) { // slice group boundary or end of a frame break; } WelsDecodeMbCabacISlice() { WelsDecodeMbCabacISliceBaseMode0() {//解析宏块,从MB_Type开始解析,到resi结束 } if (pSliceHeader->pPps->uiNumSliceGroups > 1) { iNextMbXyIndex = FmoNextMb (pFmo, iNextMbXyIndex); } else { ++iNextMbXyIndex; } } }while(1) } WelsDecodeConstructSlice(pCtx)//解码得到Y值 { WelsTargetSliceConstruction(pCtx)//得到Y值 do{ if (iCountNumMb >= iTotalNumMb) { break; } WelsTargetMbConstruction(pCtx)//解码一个宏块得到Y值 { if(MbType == MB_TYPE_INTRA_PCM) { } else if(MbType == IS_INTRA) {//帧内预测 PDqLayer pCurDqLayer = pCtx->pCurDqLayer; WelsMbIntraPredictionConstruction(PWelsDecoderContext pCtx, PDqLayer pCurDqLayer, bool bOutput)//预测得到Y U V的值 {//根据pDqLayer->pPred获得YUV的值 //根据pCurDqLayer->pNzc[iMBXY]和pCurDqLayer->pScaledTCoeff if (IS_INTRA16x16) { RecI16x16Mb(iMbXy, pCtx, pCurDqLayer->pScaledTCoeff[iMbXy], pCurDqLayer) } else if (IS_INTRA8x8) { RecI8x8Mb(); } else if (IS_INTRA4x4) { RecI4x4Mb(); } } } else if(MbType == IS_INTER) { if (0 == pCurDqLayer->pCbp[pCurDqLayer->iMbXyIndex]) { //uiCbp==0 include SKIP if (!CheckRefPics (pCtx)) { return ERR_INFO_MB_RECON_FAIL; } return WelsMbInterPrediction (pCtx, pCurDqLayer); } else { WelsMbInterConstruction (pCtx, pCurDqLayer); } } } }while(1) } } DecodeFrameConstruction (pCtx, ppDst, pDstInfo); } } } } if (pDstInfo->iBufferStatus == 1) for(int i = 0; i < 32; i++) {//Y值 printf("%d ", pDstInfo->pDst[0][i]); }}