| 1007 | } |
| 1008 | |
| 1009 | int32_t InitOneSliceInThread (sWelsEncCtx* pCtx, |
| 1010 | SSlice*& pSlice, |
| 1011 | const int32_t kiSlcBuffIdx, |
| 1012 | const int32_t kiDlayerIdx, |
| 1013 | const int32_t kiSliceIdx) { |
| 1014 | |
| 1015 | if (pCtx->pCurDqLayer->bThreadSlcBufferFlag) { |
| 1016 | const int32_t kiCodedNumInThread = pCtx->pCurDqLayer->sSliceBufferInfo[kiSlcBuffIdx].iCodedSliceNum; |
| 1017 | assert (kiCodedNumInThread <= pCtx->pCurDqLayer->sSliceBufferInfo[kiSlcBuffIdx].iMaxSliceNum - 1); |
| 1018 | pSlice = &pCtx->pCurDqLayer->sSliceBufferInfo [kiSlcBuffIdx].pSliceBuffer[kiCodedNumInThread]; |
| 1019 | } else { |
| 1020 | pSlice = &pCtx->pCurDqLayer->sSliceBufferInfo [0].pSliceBuffer[kiSliceIdx]; |
| 1021 | } |
| 1022 | pSlice->iSliceIdx = kiSliceIdx; |
| 1023 | pSlice->uiBufferIdx = kiSlcBuffIdx; |
| 1024 | |
| 1025 | // Initialize slice bs buffer info |
| 1026 | pSlice->sSliceBs.uiBsPos = 0; |
| 1027 | pSlice->sSliceBs.iNalIndex = 0; |
| 1028 | pSlice->sSliceBs.pBsBuffer = pCtx->pSliceThreading->pThreadBsBuffer[kiSlcBuffIdx]; |
| 1029 | |
| 1030 | return ENC_RETURN_SUCCESS; |
| 1031 | } |
| 1032 | |
| 1033 | int32_t InitSliceThreadInfo (sWelsEncCtx* pCtx, |
| 1034 | SDqLayer* pDqLayer, |
no outgoing calls
no test coverage detected