| 1319 | } |
| 1320 | |
| 1321 | int32_t ReallocateSliceInThread (sWelsEncCtx* pCtx, |
| 1322 | SDqLayer* pDqLayer, |
| 1323 | const int32_t kiDlayerIdx, |
| 1324 | const int32_t KiSlcBuffIdx) { |
| 1325 | int32_t iMaxSliceNum = pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].iMaxSliceNum; |
| 1326 | int32_t iCodedSliceNum = pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].iCodedSliceNum; |
| 1327 | int32_t iMaxSliceNumNew = 0; |
| 1328 | int32_t iRet = 0; |
| 1329 | SSlice* pLastCodedSlice = &pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].pSliceBuffer [iCodedSliceNum - 1]; |
| 1330 | SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIdx].sSliceArgument; |
| 1331 | |
| 1332 | iRet = CalculateNewSliceNum (pCtx, |
| 1333 | pLastCodedSlice, |
| 1334 | iMaxSliceNum, |
| 1335 | iMaxSliceNumNew); |
| 1336 | if (ENC_RETURN_SUCCESS != iRet) { |
| 1337 | return iRet; |
| 1338 | } |
| 1339 | |
| 1340 | iRet = ReallocateSliceList (pCtx, |
| 1341 | pSliceArgument, |
| 1342 | pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].pSliceBuffer, |
| 1343 | iMaxSliceNum, |
| 1344 | iMaxSliceNumNew); |
| 1345 | if (ENC_RETURN_SUCCESS != iRet) { |
| 1346 | return iRet; |
| 1347 | } |
| 1348 | |
| 1349 | pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].iMaxSliceNum = iMaxSliceNumNew; |
| 1350 | |
| 1351 | return ENC_RETURN_SUCCESS; |
| 1352 | } |
| 1353 | |
| 1354 | int32_t ExtendLayerBuffer (sWelsEncCtx* pCtx, |
| 1355 | const int32_t kiMaxSliceNumOld, |
no test coverage detected