History

Merge pull request #1490 from sijchen/after_review

[Encoder] Fixing for large number of slices

ruil2 committed 12 years ago

Commit 8ed4e832 parents b896faa 54c677c8 files · +87 −32Browse files

Unified · Split

8 files
  1. codec/common/inc/macros.h +30 −1
  2. codec/encoder/core/inc/svc_enc_macroblock.h +2 −2
  3. codec/encoder/core/inc/svc_enc_slice_segment.h +2 −2
  4. codec/encoder/core/src/encoder_ext.cpp +31 −11
  5. codec/encoder/core/src/slice_multi_threading.cpp +1 −1
  6. codec/encoder/core/src/svc_enc_slice_segment.cpp +11 −8
  7. codec/encoder/core/src/svc_encode_slice.cpp +9 −6
  8. codec/encoder/core/src/svc_motion_estimate.cpp +1 −1
codec/common/inc/macros.h+30−1
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242
4343 #include <math.h>
4444 #include <assert.h>
45+#include <string.h>
4546 #include "typedefs.h"
4647
4748
@@ -273,8 +274,36 @@ static inline bool WELS_POWER2_IF (uint32_t v) { · 225 unmodified lines
273274 #endif
274275
275276 inline bool CheckInRangeCloseOpen (const int16_t kiCurrent, const int16_t kiMin, const int16_t kiMax) {
276−return ((kiCurrent >= kiMin) && (kiCurrent < kiMax));
277+ return ((kiCurrent >= kiMin) && (kiCurrent < kiMax));
277278 }
278279
280+static inline void WelsSetMemUint32_c (uint32_t* pDst, uint32_t iValue, int32_t iSizeOfData) {
281+ for (int i = 0; i < iSizeOfData; i++) {
282+ pDst[i] = iValue;
283+ }
284+}
285+
286+static inline void WelsSetMemUint16_c (uint16_t* pDst, uint16_t iValue, int32_t iSizeOfData) {
287+ for (int i = 0; i < iSizeOfData; i++) {
288+ pDst[i] = iValue;
289+ }
290+}
291+
292+inline void WelsSetMemMultiplebytes_c (void* pDst, uint32_t iValue, int32_t iSizeOfData, int32_t iDataLengthOfData) {
293+ assert (4 == iDataLengthOfData || 2 == iDataLengthOfData || 1 == iDataLengthOfData);
294+
295+ // TODO: consider add assembly for these functions
296+ if (0 != iValue) {
297+ if (4 == iDataLengthOfData) {
298+ WelsSetMemUint32_c (static_cast<uint32_t*> (pDst), static_cast<uint32_t> (iValue), iSizeOfData);
299+ } else if (2 == iDataLengthOfData) {
300+ WelsSetMemUint16_c (static_cast<uint16_t*> (pDst), static_cast<uint16_t> (iValue), iSizeOfData);
301+ } else {
302+ memset (static_cast<uint8_t*> (pDst), static_cast<uint8_t> (iValue), iSizeOfData);
303+ }
304+ } else {
305+ memset (static_cast<uint8_t*> (pDst), 0, iSizeOfData * iDataLengthOfData);
306+ }
307+}
279308
280309 #endif//WELS_MACRO_UTILIZATIONS_H__
codec/encoder/core/inc/svc_enc_macroblock.h+2−2
@@ -68,12 +68,12 @@ SMVUnitXY sP16x16Mv; · 67 unmodified lines
6868
6969 uint8_t uiLumaQp; // uiLumaQp: pPps->iInitialQp + sSliceHeader->delta_qp + mb->dquant.
7070 uint8_t uiChromaQp;
71−uint8_t uiSliceIdc; // AVC: pFirstMbInSlice?; SVC: (pFirstMbInSlice << 7) | ((uiDependencyId << 4) | uiQualityId);
71+uint16_t uiSliceIdc; // 2^16=65536 > MaxFS(36864) of level 5.1; AVC: pFirstMbInSlice?; SVC: (pFirstMbInSlice << 7) | ((uiDependencyId << 4) | uiQualityId);
7272 uint32_t uiChromPredMode;
7373 int32_t iLumaDQp;
7474 SMVUnitXY sMvd[4];
7575 int32_t iCbpDc;
76−uint8_t reserved_filling_bytes[1]; // filling bytes reserved to make structure aligned with 4 bytes, higher cache hit on less structure size by 2 cache lines( 2 * 64 bytes) once hit
76+//uint8_t reserved_filling_bytes[1]; // not deleting this line for further changes of this structure. filling bytes reserved to make structure aligned with 4 bytes, higher cache hit on less structure size by 2 cache lines( 2 * 64 bytes) once hit
7777 } SMB, *PMb;
7878
7979 }
codec/encoder/core/inc/svc_enc_slice_segment.h+2−2
@@ -80,7 +80,7 @@ int16_t iMbWidth; /* width of picture size in mb */ · 79 unmodified lines
8080 int16_t iMbHeight; /* height of picture size in mb */
8181 int16_t iSliceNumInFrame; /* count number of slices in frame; */
8282 int32_t iMbNumInFrame; /* count number of MBs in frame */
83−uint8_t* pOverallMbMap; /* overall MB map in frame, store virtual slice idc; */
83+uint16_t* pOverallMbMap; /* overall MB map in frame, store virtual slice idc; */
8484 int16_t* pFirstMbInSlice; /* first MB address top-left based in every slice respectively; */
8585 int32_t* pCountMbNumInSlice; /* count number of MBs in every slice respectively; */
8686 uint32_t uiSliceSizeConstraint;/*in byte*/
@@ -140,7 +140,7 @@ void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa); · 53 unmodified lines
140140 *
141141 * \return uiSliceIdc - successful; (uint8_t)(-1) - failed;
142142 */
143−uint8_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int16_t kiMbXY);
143+uint16_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int16_t kiMbXY);
144144
145145 /*!
146146 * \brief Get first mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
codec/encoder/core/src/encoder_ext.cpp+31−11
@@ -597,7 +597,7 @@ static void InitMbInfo (sWelsEncCtx* pEnc, SMB* pList, SDqLayer* pLayer, con · 596 unmodified lines
597597 bool bLeftTop;
598598 bool bRightTop;
599599 int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY;
600− uint8_t uiSliceIdc;
600+ uint16_t uiSliceIdc;
601601
602602 pList[iIdx].iMbX = pEnc->pStrideTab->pMbIndexX[kiDlayerId][iIdx];
603603 pList[iIdx].iMbY = pEnc->pStrideTab->pMbIndexY[kiDlayerId][iIdx];
@@ -2272,7 +2272,7 @@ void DynslcUpdateMbNeighbourInfoListForAllSlices (SSliceCtx* pSliceCtx, SMB* pMb · 1668 unmodified lines
22722272 bool bTop;
22732273 bool bLeftTop;
22742274 bool bRightTop;
2275− int32_t uiSliceIdc;
2275+ uint16_t uiSliceIdc;
22762276 int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY;
22772277
22782278 uiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY);
@@ -2347,7 +2347,8 @@ void UpdateSlicepEncCtxWithPartition (SSliceCtx* pSliceCtx, int32_t iPartitionNu · 68 unmodified lines
23472347 }
23482348 pSliceCtx->pFirstMbInSlice[i] = iFirstMbIdx;
23492349
2350− memset (pSliceCtx->pOverallMbMap + iFirstMbIdx, (uint8_t)i, pSliceCtx->pCountMbNumInSlice[i]*sizeof (uint8_t));
2350+ WelsSetMemMultiplebytes_c(pSliceCtx->pOverallMbMap + iFirstMbIdx, i,
2351+ pSliceCtx->pCountMbNumInSlice[i], sizeof(uint16_t));
23512352
23522353 // for next partition(or pSlice)
23532354 iFirstMbIdx += pSliceCtx->pCountMbNumInSlice[i];
@@ -3924,15 +3925,19 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 1570 unmodified lines
39243925 iMaxSliceNum *= SLICE_NUM_EXPAND_COEF;
39253926
39263927 SWelsNalRaw* pNalList = (SWelsNalRaw*)pMA->WelsMalloc (iCountNals * sizeof (SWelsNalRaw), "pOut->sNalList");
3927− if (NULL == pNalList)
3928+ if (NULL == pNalList) {
3929+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pNalList is NULL");
39283930 return ENC_RETURN_MEMALLOCERR;
3931+ }
39293932 memcpy (pNalList, pCtx->pOut->sNalList, sizeof (SWelsNalRaw) * pCtx->pOut->iCountNals);
39303933 pMA->WelsFree (pCtx->pOut->sNalList, "pOut->sNalList");
39313934 pCtx->pOut->sNalList = pNalList;
39323935
39333936 int32_t* pNalLen = (int32_t*)pMA->WelsMalloc (iCountNals * sizeof (int32_t), "pOut->pNalLen");
3934− if (NULL == pNalLen)
3937+ if (NULL == pNalLen) {
3938+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pNalLen is NULL");
39353939 return ENC_RETURN_MEMALLOCERR;
3940+ }
39363941 memcpy (pNalLen, pCtx->pOut->pNalLen, sizeof (int32_t) * pCtx->pOut->iCountNals);
39373942 pMA->WelsFree (pCtx->pOut->pNalLen, "pOut->pNalLen");
39383943 pCtx->pOut->pNalLen = pNalLen;
@@ -3948,8 +3953,10 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 9 unmodified lines
39483953 }
39493954
39503955 SSlice* pSlice = (SSlice*)pMA->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "Slice");
3951− if (NULL == pSlice)
3956+ if (NULL == pSlice) {
3957+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pSlice is NULL");
39523958 return ENC_RETURN_MEMALLOCERR;
3959+ }
39533960 memcpy (pSlice, pCurLayer->sLayerInfo.pSliceInLayer, sizeof (SSlice) * iMaxSliceNumOld);
39543961 int32_t uiSliceIdx;
39553962 uiSliceIdx = iMaxSliceNumOld;
@@ -3963,8 +3970,11 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 7 unmodified lines
39633970 pSliceIdx->pSliceBsa = &pCtx->pSliceBs[uiSliceIdx].sBsWrite;
39643971 else
39653972 pSliceIdx->pSliceBsa = &pCtx->pOut->sBsWrite;
3966− if (AllocMbCacheAligned (&pSliceIdx->sMbCacheInfo, pMA))
3973+ if (AllocMbCacheAligned (&pSliceIdx->sMbCacheInfo, pMA)) {
3974+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: realloc MbCache not successful at slice_idx=%d (max-slice=%d)",
3975+ uiSliceIdx, iMaxSliceNum);
39673976 return ENC_RETURN_MEMALLOCERR;
3977+ }
39683978
39693979 pSliceIdx->bSliceHeaderExtFlag = pBaseSlice->bSliceHeaderExtFlag;
39703980 pSHExt->sSliceHeader.iPpsId = pBaseSHExt->sSliceHeader.iPpsId;
@@ -3983,8 +3993,10 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 12 unmodified lines
39833993 pCurLayer->sLayerInfo.pSliceInLayer = pSlice;
39843994
39853995 int16_t* pFirstMbInSlice = (int16_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int16_t), "pSliceSeg->pFirstMbInSlice");
3986− if (NULL == pFirstMbInSlice)
3996+ if (NULL == pFirstMbInSlice) {
3997+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pFirstMbInSlice is NULL");
39873998 return ENC_RETURN_MEMALLOCERR;
3999+ }
39884000 memset (pFirstMbInSlice, 0, sizeof (int16_t) * iMaxSliceNum);
39894001 memcpy (pFirstMbInSlice, pCurLayer->pSliceEncCtx->pFirstMbInSlice, sizeof (int16_t) * iMaxSliceNumOld);
39904002 pMA->WelsFree (pCurLayer->pSliceEncCtx->pFirstMbInSlice, "pSliceSeg->pFirstMbInSlice");
@@ -3992,8 +4004,10 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 1 unmodified line
39924004
39934005 int32_t* pCountMbNumInSlice = (int32_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int32_t),
39944006 "pSliceSeg->pCountMbNumInSlice");
3995− if (NULL == pCountMbNumInSlice)
4007+ if (NULL == pCountMbNumInSlice) {
4008+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: realloc pCountMbNumInSlice not successful");
39964009 return ENC_RETURN_MEMALLOCERR;
4010+ }
39974011 memcpy (pCountMbNumInSlice, pCurLayer->pSliceEncCtx->pCountMbNumInSlice, sizeof (int32_t) * iMaxSliceNumOld);
39984012 uiSliceIdx = iMaxSliceNumOld;
39994013 while (uiSliceIdx < iMaxSliceNum) {
@@ -4004,8 +4018,10 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 4 unmodified lines
40044018 pCurLayer->pSliceEncCtx->pCountMbNumInSlice = pCountMbNumInSlice;
40054019
40064020 SRCSlicing* pSlcingOverRc = (SRCSlicing*)pMA->WelsMalloc (iMaxSliceNum * sizeof (SRCSlicing), "SlicingOverRC");
4007− if (NULL == pSlcingOverRc)
4021+ if (NULL == pSlcingOverRc) {
4022+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: realloc pSlcingOverRc not successful");
40084023 return ENC_RETURN_MEMALLOCERR;
4024+ }
40094025 memcpy (pSlcingOverRc, pCtx->pWelsSvcRc->pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld);
40104026 uiSliceIdx = iMaxSliceNumOld;
40114027 SRCSlicing* pSORC = &pSlcingOverRc[uiSliceIdx];
@@ -4069,9 +4085,13 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 57 unmodified lines
40694085
40704086 if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]
40714087 if (pCtx->iActiveThreadsNum == 1) {
4072− if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) //only single thread support re-alloc now
4088+ //only single thread support re-alloc now
4089+ if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) {
4090+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::WelsCodeOnePicPartition: DynSliceRealloc not successful");
40734091 return ENC_RETURN_MEMALLOCERR;
4092+ }
40744093 } else if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {
4094+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::WelsCodeOnePicPartition: iSliceIdx(%d) over iMaxSliceNumConstraint(%d)", iSliceIdx, pSliceCtx->iMaxSliceNumConstraint);
40754095 return ENC_RETURN_MEMALLOCERR;
40764096 }
40774097 }
codec/encoder/core/src/slice_multi_threading.cpp+1−1
@@ -73,7 +73,7 @@ namespace WelsEnc { · 72 unmodified lines
7373 void UpdateMbListNeighborParallel (SSliceCtx* pSliceCtx,
7474 SMB* pMbList,
7575 const int32_t uiSliceIdc) {
76− const uint8_t* kpMbMap = pSliceCtx->pOverallMbMap;
76+ const uint16_t* kpMbMap = pSliceCtx->pOverallMbMap;
7777 const int32_t kiMbWidth = pSliceCtx->iMbWidth;
7878 int32_t iIdx = pSliceCtx->pFirstMbInSlice[uiSliceIdc];
7979 const int32_t kiEndMbInSlice = iIdx + pSliceCtx->pCountMbNumInSlice[uiSliceIdc] - 1;
codec/encoder/core/src/svc_enc_slice_segment.cpp+11−8
@@ -78,7 +78,8 @@ int32_t AssignMbMapMultipleSlices (SSliceCtx* pSliceSeg, const SSliceConfig* kpM · 77 unmodified lines
7878 const int16_t kiFirstMb = uiSliceIdx * kiMbWidth;
7979 pSliceSeg->pCountMbNumInSlice[uiSliceIdx] = kiMbWidth;
8080 pSliceSeg->pFirstMbInSlice[uiSliceIdx] = kiFirstMb;
81− memset (pSliceSeg->pOverallMbMap + kiFirstMb, (uint8_t)uiSliceIdx, kiMbWidth * sizeof (uint8_t));
81+ WelsSetMemMultiplebytes_c(pSliceSeg->pOverallMbMap + kiFirstMb, uiSliceIdx,
82+ kiMbWidth, sizeof(uint16_t));
8283 ++ uiSliceIdx;
8384 }
8485
@@ -89,7 +90,7 @@ int32_t AssignMbMapMultipleSlices (SSliceCtx* pSliceSeg, const SSliceConfig* kpM · 4 unmodified lines
8990 const int32_t* kpSlicesAssignList = (int32_t*) & (kpMso->sSliceArgument.uiSliceMbNum[0]);
9091 const int32_t kiCountNumMbInFrame = pSliceSeg->iMbNumInFrame;
9192 const int32_t kiCountSliceNumInFrame = pSliceSeg->iSliceNumInFrame;
92− int32_t iSliceIdx = 0;
93+ uint16_t iSliceIdx = 0;
9394 int16_t iMbIdx = 0;
9495
9596 do {
@@ -392,7 +393,7 @@ int32_t InitSliceSegment (SSliceCtx* pSliceSeg, · 296 unmodified lines
392393 }
393394
394395 if (SM_SINGLE_SLICE == uiSliceMode) {
395− pSliceSeg->pOverallMbMap = (uint8_t*)pMa->WelsMalloc (kiCountMbNum * sizeof (uint8_t), "pSliceSeg->pOverallMbMap");
396+ pSliceSeg->pOverallMbMap = (uint16_t*)pMa->WelsMalloc (kiCountMbNum * sizeof (uint16_t), "pSliceSeg->pOverallMbMap");
396397
397398 WELS_VERIFY_RETURN_IF (1, NULL == pSliceSeg->pOverallMbMap)
398399 pSliceSeg->iSliceNumInFrame = 1;
@@ -419,11 +420,12 @@ int32_t InitSliceSegment (SSliceCtx* pSliceSeg, · 20 unmodified lines
419420 && uiSliceMode != SM_DYN_SLICE && uiSliceMode != SM_AUTO_SLICE)
420421 return 1;
421422
422− pSliceSeg->pOverallMbMap = (uint8_t*)pMa->WelsMalloc (kiCountMbNum * sizeof (uint8_t), "pSliceSeg->pOverallMbMap");
423+ pSliceSeg->pOverallMbMap = (uint16_t*)pMa->WelsMalloc (kiCountMbNum * sizeof (uint16_t), "pSliceSeg->pOverallMbMap");
423424
424425 WELS_VERIFY_RETURN_IF (1, NULL == pSliceSeg->pOverallMbMap)
425426
426− memset (pSliceSeg->pOverallMbMap, 0, kiCountMbNum * sizeof (uint8_t));
427+ WelsSetMemMultiplebytes_c(pSliceSeg->pOverallMbMap, 0, kiCountMbNum, sizeof(uint16_t));
428+
427429 //SM_DYN_SLICE: init, set pSliceSeg->iSliceNumInFrame = 1;
428430 pSliceSeg->iSliceNumInFrame = GetInitialSliceNum (kiMbWidth, kiMbHeight, pMso);
429431
@@ -550,10 +552,10 @@ void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa) { · 120 unmodified lines
550552 *
551553 * \return uiSliceIdc - successful; -1 - failed;
552554 */
553−uint8_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int16_t kiMbXY) {
555+uint16_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int16_t kiMbXY) {
554556 if (NULL != pSliceCtx && kiMbXY < pSliceCtx->iMbNumInFrame && kiMbXY >= 0)
555557 return pSliceCtx->pOverallMbMap[ kiMbXY ];
556− return (uint8_t) (-1);
558+ return (uint16_t) (-1);
557559 }
558560
559561 /*!
@@ -688,7 +690,8 @@ int32_t DynamicAdjustSlicePEncCtxAll (SSliceCtx* pSliceCtx, · 128 unmodified lines
688690 pSliceCtx->pFirstMbInSlice[iSliceIdx] = iFirstMbIdx;
689691 pSliceCtx->pCountMbNumInSlice[iSliceIdx] = kiSliceRun;
690692
691− memset (pSliceCtx->pOverallMbMap + iFirstMbIdx, (uint8_t)iSliceIdx, kiSliceRun * sizeof (uint8_t));
693+ WelsSetMemMultiplebytes_c(pSliceCtx->pOverallMbMap + iFirstMbIdx, iSliceIdx,
694+ kiSliceRun, sizeof(uint16_t));
692695
693696 iFirstMbIdx += kiSliceRun;
694697
codec/encoder/core/src/svc_encode_slice.cpp+9−6
@@ -776,7 +776,7 @@ void UpdateMbNeighbourInfoForNextSlice (SSliceCtx* pSliceCtx, · 775 unmodified lines
776776 bool bLeftTop;
777777 bool bRightTop;
778778 int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY;
779− const uint8_t kuiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY);
779+ const uint16_t kuiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY);
780780
781781 pMb->uiSliceIdc = kuiSliceIdc;
782782 iLeftXY = kiMbXY - 1;
@@ -814,9 +814,9 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 31 unmodified lines
814814 int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) {
815815 SDqLayer* pCurLayer = pEncCtx->pCurDqLayer;
816816 int32_t iCurMbIdx = pCurMb->iMbXY;
817− int32_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ];
817+ uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ];
818818 const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum;
819− int32_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep;
819+ uint16_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep;
820820 SSlice* pNextSlice = NULL;
821821
822822 SMB* pMbList = pCurLayer->sMbDataP;
@@ -839,9 +839,8 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 16 unmodified lines
839839 sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage
840840
841841 pSliceCtx->pFirstMbInSlice[iNextSliceIdc] = iFirstMbIdxOfNextSlice;
842−
843− memset (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, (uint8_t)iNextSliceIdc,
844− (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1)*sizeof (uint8_t));
842+ WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc,
843+ (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof(uint16_t));
845844
846845 //DYNAMIC_SLICING_ONE_THREAD: update pMbList slice_neighbor_info
847846 UpdateMbNeighbourInfoForNextSlice (pSliceCtx, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition);
@@ -875,6 +874,10 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 27 unmodified lines
875874 && JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx, pSliceCtx->uiSliceSizeConstraint)) /*jump_avoiding_pack_exceed*/
876875 && kbCurMbNotLastMbOfCurPartition) { //decide to add new pSlice
877876
877+ WelsLog (&pEncCtx->sLogCtx, WELS_LOG_DETAIL,
878+ "DynSlcJudgeSliceBoundaryStepBack: AddSliceBoundary: iCurMbIdx=%d, uiLen=%d, uiSliceIdx=%d", iCurMbIdx, uiLen,
879+ pCurSlice->uiSliceIdx);
880+
878881 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1) {
879882 WelsMutexLock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);
880883 //lock the acessing to this variable: pSliceCtx->iSliceNumInFrame
codec/encoder/core/src/svc_motion_estimate.cpp+1−1
@@ -718,7 +718,7 @@ int32_t RequestScreenBlockFeatureStorage (CMemoryAlign* pMa, const int32_t kiFra · 717 unmodified lines
718718 pScreenBlockFeatureStorage->iIs16x16 = !bIsBlock8x8;
719719 pScreenBlockFeatureStorage->uiFeatureStrategyIndex = kiFeatureStrategyIndex;
720720 pScreenBlockFeatureStorage->iActualListSize = kiListSize;
721− memset (pScreenBlockFeatureStorage->uiSadCostThreshold, UINT_MAX, BLOCK_SIZE_ALL * sizeof (uint32_t));
721+ WelsSetMemMultiplebytes_c (pScreenBlockFeatureStorage->uiSadCostThreshold, UINT_MAX, BLOCK_SIZE_ALL, sizeof(uint32_t));
722722 pScreenBlockFeatureStorage->bRefBlockFeatureCalculated = false;
723723
724724 return ENC_RETURN_SUCCESS;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t