| 1640 | } |
| 1641 | |
| 1642 | int32_t WelsCodeOneSlice (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, const int32_t kiNalType) { |
| 1643 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; |
| 1644 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 1645 | SNalUnitHeaderExt* pNalHeadExt = &pCurLayer->sLayerInfo.sNalHeaderExt; |
| 1646 | SBitStringAux* pBs = pCurSlice->pSliceBsa; |
| 1647 | const int32_t kiDynamicSliceFlag = |
| 1648 | (pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId].sSliceArgument.uiSliceMode |
| 1649 | == SM_SIZELIMITED_SLICE); |
| 1650 | if (I_SLICE == pEncCtx->eSliceType) { |
| 1651 | pNalHeadExt->bIdrFlag = 1; |
| 1652 | pCurSlice->sScaleShift = 0; |
| 1653 | } else { |
| 1654 | const uint32_t kuiTemporalId = pNalHeadExt->uiTemporalId; |
| 1655 | pCurSlice->sScaleShift = kuiTemporalId ? (kuiTemporalId - pEncCtx->pRefPic->uiTemporalId) : 0; |
| 1656 | } |
| 1657 | |
| 1658 | WelsSliceHeaderExtInit (pEncCtx, pCurLayer, pCurSlice); |
| 1659 | |
| 1660 | //RomRC init slice by slice |
| 1661 | if (pWelsSvcRc->bGomRC) { |
| 1662 | GomRCInitForOneSlice (pCurSlice, pWelsSvcRc->iBitsPerMb); |
| 1663 | } |
| 1664 | |
| 1665 | g_pWelsWriteSliceHeader[pCurSlice->bSliceHeaderExtFlag] (pEncCtx, pBs, pCurLayer, pCurSlice, |
| 1666 | pEncCtx->pFuncList->pParametersetStrategy); |
| 1667 | |
| 1668 | pCurSlice->uiLastMbQp = pCurLayer->sLayerInfo.pPpsP->iPicInitQp + pCurSlice->sSliceHeaderExt.sSliceHeader.iSliceQpDelta; |
| 1669 | |
| 1670 | int32_t iEncReturn = g_pWelsSliceCoding[pNalHeadExt->bIdrFlag][kiDynamicSliceFlag] (pEncCtx, pCurSlice); |
| 1671 | if (ENC_RETURN_SUCCESS != iEncReturn) |
| 1672 | return iEncReturn; |
| 1673 | |
| 1674 | WelsWriteSliceEndSyn (pCurSlice, pEncCtx->pSvcParam->iEntropyCodingModeFlag != 0); |
| 1675 | |
| 1676 | return ENC_RETURN_SUCCESS; |
| 1677 | } |
| 1678 | |
| 1679 | //pFunc: UpdateMbNeighbourInfoForNextSlice() |
| 1680 | void UpdateMbNeighbourInfoForNextSlice (SDqLayer* pCurDq, |
no test coverage detected