History

Merge branch 'master' of https://github.com/cisco/openh264 into enc_quant

ruil2 committed 12 years ago

Commit 00a2a9f2 parents e0b92bb d34365516 files · +69 −77Browse files

Unified · Split

16 files
  1. codec/api/svc/codec_app_def.h +3 −3
  2. codec/console/enc/src/welsenc.cpp +1 −1
  3. codec/decoder/core/inc/au_parser.h +2 −0
  4. codec/decoder/core/inc/wels_const.h +1 −1
  5. codec/decoder/core/src/au_parser.cpp +12 −2
  6. codec/encoder/core/inc/nal_encap.h +1 −0
  7. codec/encoder/core/inc/svc_motion_estimate.h +8 −0
  8. codec/encoder/core/src/encoder_ext.cpp +31 −37
  9. codec/encoder/core/src/slice_multi_threading.cpp +3 −3
  10. codec/encoder/core/src/svc_base_layer_md.cpp +0 −3
  11. codec/encoder/core/src/svc_mode_decision.cpp +0 −6
  12. codec/encoder/plus/src/welsEncoderExt.cpp +1 −1
  13. codec/processing/src/scrolldetection/ScrollDetection.h +0 −5
  14. test/api/decode_encode_test.cpp +1 −1
  15. test/api/encoder_test.cpp +1 −1
  16. test/encoder/EncUT_MotionEstimate.cpp +4 −13
codec/api/svc/codec_app_def.h+3−3
@@ -87,9 +87,9 @@ typedef enum { · 86 unmodified lines
87 ENCOCER_LTR_MARKING_PERIOD,87 ENCOCER_LTR_MARKING_PERIOD,
88 ENCODER_OPTION_LTR,88 ENCODER_OPTION_LTR,
89 89
90 ENCODER_OPTION_ENABLE_SSEI, //disable SSEI: true--disable ssei; false--enable ssei90 ENCODER_OPTION_ENABLE_SSEI, //enable SSEI: true--enable ssei; false--disable ssei
91 ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix91 ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix
92 ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, //disable pSps/pPps id addition: true--disable pSps/pPps id; false--enable pSps/pPps id addistion92 ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION, //enable pSps/pPps id addition: true--enable pSps/pPps id; false--disable pSps/pPps id addistion
93 93
94 ENCODER_OPTION_CURRENT_PATH,94 ENCODER_OPTION_CURRENT_PATH,
95 ENCODER_OPTION_DUMP_FILE,95 ENCODER_OPTION_DUMP_FILE,
@@ -347,7 +347,7 @@ typedef struct { · 251 unmodified lines
347 unsigned char uiLayerType;347 unsigned char uiLayerType;
348 348
349 int iNalCount; // Count number of NAL coded already349 int iNalCount; // Count number of NAL coded already
350 int iNalLengthInByte[MAX_NAL_UNITS_IN_LAYER]; // Length of NAL size in byte from 0 to iNalCount-1350 int* pNalLengthInByte; // Length of NAL size in byte from 0 to iNalCount-1
351 unsigned char* pBsBuf; // Buffer of bitstream contained351 unsigned char* pBsBuf; // Buffer of bitstream contained
352} SLayerBSInfo, *PLayerBSInfo;352} SLayerBSInfo, *PLayerBSInfo;
353 353
codec/console/enc/src/welsenc.cpp+1−1
@@ -782,7 +782,7 @@ int ProcessEncoding(ISVCEncoder* pPtrEnc, int argc, char** argv,bool bConfigFile · 781 unmodified lines
782 int iLayerSize = 0;782 int iLayerSize = 0;
783 int iNalIdx = pLayerBsInfo->iNalCount - 1;783 int iNalIdx = pLayerBsInfo->iNalCount - 1;
784 do {784 do {
785 iLayerSize += pLayerBsInfo->iNalLengthInByte[iNalIdx];785 iLayerSize += pLayerBsInfo->pNalLengthInByte[iNalIdx];
786 -- iNalIdx;786 -- iNalIdx;
787 } while (iNalIdx >= 0);787 } while (iNalIdx >= 0);
788#if defined(COMPARE_DATA)788#if defined(COMPARE_DATA)
codec/decoder/core/inc/au_parser.h+2−0
@@ -96,6 +96,8 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, · 95 unmodified lines
96 const PSps kpSps);96 const PSps kpSps);
97bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeaderExt pCurNalHeaderExt,97bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeaderExt pCurNalHeaderExt,
98 PSliceHeader pLastSliceHeader, PSliceHeader pCurSliceHeader);98 PSliceHeader pLastSliceHeader, PSliceHeader pCurSliceHeader);
99bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PSps kpSps);
100
99/*!101/*!
100 *************************************************************************************102 *************************************************************************************
101 * \brief to parse Sequence Parameter Set (SPS)103 * \brief to parse Sequence Parameter Set (SPS)
codec/decoder/core/inc/wels_const.h+1−1
@@ -93,7 +93,7 @@ · 92 unmodified lines
93 93
94#define MAX_NAL_UNIT_NUM_IN_AU 32 // predefined maximal number of NAL Units in an access unit94#define MAX_NAL_UNIT_NUM_IN_AU 32 // predefined maximal number of NAL Units in an access unit
95#define MAX_ACCESS_UNIT_CAPACITY 1048576 // Maximal AU capacity in bytes: (1<<20) = 1024 KB predefined95#define MAX_ACCESS_UNIT_CAPACITY 1048576 // Maximal AU capacity in bytes: (1<<20) = 1024 KB predefined
96#define BS_BUFFER_SIZE (MAX_ACCESS_UNIT_CAPACITY + MAX_ACCESS_UNIT_CAPACITY) //for delay case, save two AU at most96#define BS_BUFFER_SIZE (MAX_ACCESS_UNIT_CAPACITY * 3) //for delay case, keep three AU size to prevent buffer overwrite
97#define MAX_MACROBLOCK_CAPACITY 5000 //Maximal legal MB capacity, 15000 bits is enough97#define MAX_MACROBLOCK_CAPACITY 5000 //Maximal legal MB capacity, 15000 bits is enough
98 98
99#endif//WELS_CONSTANCE_H__99#endif//WELS_CONSTANCE_H__
codec/decoder/core/src/au_parser.cpp+12−2
@@ -331,7 +331,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 330 unmodified lines
331 pCurAu->pNalUnitsList[uiAvailNalNum - 1]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps)) {331 pCurAu->pNalUnitsList[uiAvailNalNum - 1]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps)) {
332 pCurAu->uiEndPos = uiAvailNalNum - 2;332 pCurAu->uiEndPos = uiAvailNalNum - 2;
333 pCtx->bAuReadyFlag = true;333 pCtx->bAuReadyFlag = true;
334 334 pCtx->bNextNewSeqBegin = CheckNextAuNewSeq (pCtx, pCurNal, pCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps);
335 335
336 }336 }
337 }337 }
@@ -411,7 +411,6 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, · 73 unmodified lines
411 const SSliceHeader* kpCurSliceHeader = &kpCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;411 const SSliceHeader* kpCurSliceHeader = &kpCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
412 if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL412 if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL
413 && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) {413 && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) {
414 pCtx->bNextNewSeqBegin = true;
415 return true; // the active sps changed, new sequence begins, so the current au is ready414 return true; // the active sps changed, new sequence begins, so the current au is ready
416 }415 }
417 416
@@ -460,6 +459,17 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, · 42 unmodified lines
460 return false;459 return false;
461}460}
462 461
462bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PSps kpSps) {
463 const PNalUnitHeaderExt kpCurNalHeaderExt = &kpCurNal->sNalHeaderExt;
464 if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL
465 && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps)
466 return true;
467 if (kpCurNalHeaderExt->bIdrFlag)
468 return true;
469
470 return false;
471}
472
463/*!473/*!
464 *************************************************************************************474 *************************************************************************************
465 * \brief to parse NON VCL NAL Units475 * \brief to parse NON VCL NAL Units
codec/encoder/core/inc/nal_encap.h+1−0
@@ -71,6 +71,7 @@ typedef struct TagWelsEncoderOutput { · 70 unmodified lines
71 71
72// SWelsNalRaw raw_nals[MAX_DEPENDENCY_LAYER*2+MAX_DEPENDENCY_LAYER*MAX_QUALITY_LEVEL]; // AVC: max up to SPS+PPS+max_slice_idc (2 + 8) for FMO;72// SWelsNalRaw raw_nals[MAX_DEPENDENCY_LAYER*2+MAX_DEPENDENCY_LAYER*MAX_QUALITY_LEVEL]; // AVC: max up to SPS+PPS+max_slice_idc (2 + 8) for FMO;
73 SWelsNalRaw* sNalList; // nal list, adaptive for AVC/SVC in case single slice, multiple slices or fmo73 SWelsNalRaw* sNalList; // nal list, adaptive for AVC/SVC in case single slice, multiple slices or fmo
74 int32_t* pNalLen;
74 int32_t iCountNals; // count number of NAL in list75 int32_t iCountNals; // count number of NAL in list
75// SVC: num_sps (MAX_D) + num_pps (MAX_D) + num_vcl (MAX_D * MAX_Q)76// SVC: num_sps (MAX_D) + num_pps (MAX_D) + num_vcl (MAX_D * MAX_Q)
76 int32_t iNalIndex; // coding NAL currently, 0 based77 int32_t iNalIndex; // coding NAL currently, 0 based
codec/encoder/core/inc/svc_motion_estimate.h+8−0
@@ -256,8 +256,16 @@ int32_t ReleaseFeatureSearchPreparation (CMemoryAlign* pMa, uint16_t*& pFeatureO · 255 unmodified lines
256#define FMESWITCH_DEFAULT_GOODFRAME_NUM (2)256#define FMESWITCH_DEFAULT_GOODFRAME_NUM (2)
257#define FME_DEFAULT_FEATURE_INDEX (0)257#define FME_DEFAULT_FEATURE_INDEX (0)
258 258
259
259void PerformFMEPreprocess (SWelsFuncPtrList* pFunc, SPicture* pRef, uint16_t* pFeatureOfBlock,260void PerformFMEPreprocess (SWelsFuncPtrList* pFunc, SPicture* pRef, uint16_t* pFeatureOfBlock,
260 SScreenBlockFeatureStorage* pScreenBlockFeatureStorage);261 SScreenBlockFeatureStorage* pScreenBlockFeatureStorage);
262bool SetFeatureSearchIn (SWelsFuncPtrList* pFunc, const SWelsME& sMe,
263 const SSlice* pSlice, SScreenBlockFeatureStorage* pRefFeatureStorage,
264 const int32_t kiEncStride, const int32_t kiRefStride,
265 SFeatureSearchIn* pFeatureSearchIn);
266void MotionEstimateFeatureFullSearch (SFeatureSearchIn& sFeatureSearchIn,
267 const uint32_t kuiMaxSearchPoint,
268 SWelsME* pMe);
261void UpdateFMESwitch (SDqLayer* pCurLayer);269void UpdateFMESwitch (SDqLayer* pCurLayer);
262void UpdateFMESwitchNull (SDqLayer* pCurLayer);270void UpdateFMESwitchNull (SDqLayer* pCurLayer);
263 271
codec/encoder/core/src/encoder_ext.cpp+31−37
@@ -80,7 +80,7 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 79 unmodified lines
80 assert (pCfg != NULL);80 assert (pCfg != NULL);
81 81
82 if ((pCfg->iUsageType != CAMERA_VIDEO_REAL_TIME) && (pCfg->iUsageType != SCREEN_CONTENT_REAL_TIME)) {82 if ((pCfg->iUsageType != CAMERA_VIDEO_REAL_TIME) && (pCfg->iUsageType != SCREEN_CONTENT_REAL_TIME)) {
83 WelsLog (NULL, WELS_LOG_ERROR, "ParamValidation(),Invalid usage type = %d", pCfg->iUsageType);83 WelsLog (NULL, WELS_LOG_ERROR, "ParamValidation(),Invalid usage type = %d\n", pCfg->iUsageType);
84 return ENC_RETURN_UNSUPPORTED_PARA;84 return ENC_RETURN_UNSUPPORTED_PARA;
85 }85 }
86 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {86 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
@@ -113,15 +113,16 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { · 26 unmodified lines
113 }113 }
114 114
115 //bitrate setting validation115 //bitrate setting validation
116 if (pCfg->iRCMode != RC_OFF_MODE){116 if (pCfg->iRCMode != RC_OFF_MODE) {
117 int32_t iTotalBitrate = 0;117 int32_t iTotalBitrate = 0;
118 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {118 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
119 SDLayerParam* fDlp = &pCfg->sDependencyLayers[i];119 SDLayerParam* fDlp = &pCfg->sDependencyLayers[i];
120 iTotalBitrate += fDlp->iSpatialBitrate;120 iTotalBitrate += fDlp->iSpatialBitrate;
121 }121 }
122 if(iTotalBitrate > pCfg->iTargetBitrate){122 if (iTotalBitrate > pCfg->iTargetBitrate) {
123 WelsLog(NULL, WELS_LOG_ERROR,"Invalid setttings in bitrate. the sum of each layer bitrate(%d) is larger than total bitrate setting(%d)\n",123 WelsLog (NULL, WELS_LOG_ERROR,
124 iTotalBitrate,pCfg->iTargetBitrate);124 "Invalid setttings in bitrate. the sum of each layer bitrate(%d) is larger than total bitrate setting(%d)\n",
125 iTotalBitrate, pCfg->iTargetBitrate);
125 }126 }
126 }127 }
127 128
@@ -1303,6 +1304,8 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 1175 unmodified lines
1303 (*ppCtx)->pOut->uiSize = iCountBsLen;1304 (*ppCtx)->pOut->uiSize = iCountBsLen;
1304 (*ppCtx)->pOut->sNalList = (SWelsNalRaw*)pMa->WelsMalloc (iCountNals * sizeof (SWelsNalRaw), "pOut->sNalList");1305 (*ppCtx)->pOut->sNalList = (SWelsNalRaw*)pMa->WelsMalloc (iCountNals * sizeof (SWelsNalRaw), "pOut->sNalList");
1305 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut->sNalList), FreeMemorySvc (ppCtx))1306 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut->sNalList), FreeMemorySvc (ppCtx))
1307 (*ppCtx)->pOut->pNalLen = (int32_t*)pMa->WelsMallocz(iCountNals * sizeof (int32_t), "pOut->pNalLen");
1308 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut->pNalLen), FreeMemorySvc(ppCtx))
1306 (*ppCtx)->pOut->iCountNals = iCountNals;1309 (*ppCtx)->pOut->iCountNals = iCountNals;
1307 (*ppCtx)->pOut->iNalIndex = 0;1310 (*ppCtx)->pOut->iNalIndex = 0;
1308 1311
@@ -1497,6 +1500,11 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 188 unmodified lines
1497 pMa->WelsFree (pCtx->pOut->sNalList, "pOut->sNalList");1500 pMa->WelsFree (pCtx->pOut->sNalList, "pOut->sNalList");
1498 pCtx->pOut->sNalList = NULL;1501 pCtx->pOut->sNalList = NULL;
1499 }1502 }
1503 // NALs len
1504 if (NULL != pCtx->pOut->pNalLen) {
1505 pMa->WelsFree (pCtx->pOut->pNalLen, "pOut->pNalLen");
1506 pCtx->pOut->pNalLen = NULL;
1507 }
1500 pMa->WelsFree (pCtx->pOut, "SWelsEncoderOutput");1508 pMa->WelsFree (pCtx->pOut, "SWelsEncoderOutput");
1501 pCtx->pOut = NULL;1509 pCtx->pOut = NULL;
1502 }1510 }
@@ -2443,14 +2451,8 @@ bool SetMeMethod (const uint8_t uiMethod, PSearchMethodFunc& pSearchMethodFunc) · 940 unmodified lines
2443 pSearchMethodFunc = WelsDiamondCrossFeatureSearch;2451 pSearchMethodFunc = WelsDiamondCrossFeatureSearch;
2444 break;2452 break;
2445 case ME_FULL:2453 case ME_FULL:
2446#ifdef HAVE_MMX
2447 // make sure your cpu can support x86 sse4.1 instruction set if try it
2448 //pSearchMethodFunc = WelsFullSearch;
2449#else
2450 pSearchMethodFunc = WelsDiamondSearch;2454 pSearchMethodFunc = WelsDiamondSearch;
2451 return false;2455 return false;
2452#endif//HAVE_MMX
2453 break;
2454 default:2456 default:
2455 pSearchMethodFunc = WelsDiamondSearch;2457 pSearchMethodFunc = WelsDiamondSearch;
2456 return false;2458 return false;
@@ -2772,7 +2774,6 @@ static inline int32_t AddPrefixNal (sWelsEncCtx* pCtx, · 315 unmodified lines
2772 iPayloadSize = pNalLen[*pNalIdxInLayer];2774 iPayloadSize = pNalLen[*pNalIdxInLayer];
2773 2775
2774 pCtx->iPosBsBuffer += iPayloadSize;2776 pCtx->iPosBsBuffer += iPayloadSize;
2775 pLayerBsInfo->iNalLengthInByte[*pNalIdxInLayer] = iPayloadSize;
2776 2777
2777 (*pNalIdxInLayer) ++;2778 (*pNalIdxInLayer) ++;
2778 } else { // No Prefix NAL Unit RBSP syntax here, but need add NAL Unit Header extension2779 } else { // No Prefix NAL Unit RBSP syntax here, but need add NAL Unit Header extension
@@ -2789,7 +2790,6 @@ static inline int32_t AddPrefixNal (sWelsEncCtx* pCtx, · 10 unmodified lines
2789 iPayloadSize = pNalLen[*pNalIdxInLayer];2790 iPayloadSize = pNalLen[*pNalIdxInLayer];
2790 2791
2791 pCtx->iPosBsBuffer += iPayloadSize;2792 pCtx->iPosBsBuffer += iPayloadSize;
2792 pLayerBsInfo->iNalLengthInByte[*pNalIdxInLayer] = iPayloadSize;
2793 2793
2794 (*pNalIdxInLayer) ++;2794 (*pNalIdxInLayer) ++;
2795 }2795 }
@@ -2855,13 +2855,13 @@ int32_t ForceCodingIDR (sWelsEncCtx* pCtx) { · 59 unmodified lines
2855int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) {2855int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) {
2856 SFrameBSInfo* pFbi = (SFrameBSInfo*)pDst;2856 SFrameBSInfo* pFbi = (SFrameBSInfo*)pDst;
2857 SLayerBSInfo* pLayerBsInfo = &pFbi->sLayerInfo[0];2857 SLayerBSInfo* pLayerBsInfo = &pFbi->sLayerInfo[0];
2858 int32_t iNalLen[128] = {0};
2859 int32_t iCountNal = 0;2858 int32_t iCountNal = 0;
2860 2859
2861 pLayerBsInfo->pBsBuf = pCtx->pFrameBs;2860 pLayerBsInfo->pBsBuf = pCtx->pFrameBs;
2861 pLayerBsInfo->pNalLengthInByte = pCtx->pOut->pNalLen;
2862 InitBits (&pCtx->pOut->sBsWrite, pCtx->pOut->pBsBuffer, pCtx->pOut->uiSize);2862 InitBits (&pCtx->pOut->sBsWrite, pCtx->pOut->pBsBuffer, pCtx->pOut->uiSize);
2863 2863
2864 int32_t iReturn = WelsWriteParameterSets (pCtx, &iNalLen[0], &iCountNal);2864 int32_t iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal);
2865 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)2865 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
2866 2866
2867 pLayerBsInfo->uiPriorityId = 0;2867 pLayerBsInfo->uiPriorityId = 0;
@@ -2870,9 +2870,6 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { · 2 unmodified lines
2870 pLayerBsInfo->uiQualityId = 0;2870 pLayerBsInfo->uiQualityId = 0;
2871 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;2871 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
2872 pLayerBsInfo->iNalCount = iCountNal;2872 pLayerBsInfo->iNalCount = iCountNal;
2873 for (int32_t iNalIndex = 0; iNalIndex < iCountNal; ++ iNalIndex) {
2874 pLayerBsInfo->iNalLengthInByte[iNalIndex] = iNalLen[iNalIndex];
2875 }
2876 2873
2877 pCtx->eLastNalPriority = NRI_PRI_HIGHEST;2874 pCtx->eLastNalPriority = NRI_PRI_HIGHEST;
2878 pFbi->iLayerNum = 1;2875 pFbi->iLayerNum = 1;
@@ -2904,7 +2901,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 25 unmodified lines
2904 int32_t iSpatialNum = 0; // available count number of spatial layers due to frame size changed in this given frame2901 int32_t iSpatialNum = 0; // available count number of spatial layers due to frame size changed in this given frame
2905 int32_t iSpatialIdx = 0; // iIndex of spatial layers due to frame size changed in this given frame2902 int32_t iSpatialIdx = 0; // iIndex of spatial layers due to frame size changed in this given frame
2906 int32_t iFrameSize = 0;2903 int32_t iFrameSize = 0;
2907 int32_t iNalLen[128] = {0};
2908 int32_t iNalIdxInLayer = 0;2904 int32_t iNalIdxInLayer = 0;
2909 int32_t iCountNal = 0;2905 int32_t iCountNal = 0;
2910 EVideoFrameType eFrameType = videoFrameTypeInvalid;2906 EVideoFrameType eFrameType = videoFrameTypeInvalid;
@@ -2948,13 +2944,14 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 37 unmodified lines
2948 pCtx->uiTemporalId = iCurTid;2944 pCtx->uiTemporalId = iCurTid;
2949 2945
2950 pLayerBsInfo->pBsBuf = pCtx->pFrameBs ;2946 pLayerBsInfo->pBsBuf = pCtx->pFrameBs ;
2947 pLayerBsInfo->pNalLengthInByte = pCtx->pOut->pNalLen;
2951 2948
2952 if (eFrameType == videoFrameTypeIDR) {2949 if (eFrameType == videoFrameTypeIDR) {
2953 ++ pCtx->sPSOVector.uiIdrPicId;2950 ++ pCtx->sPSOVector.uiIdrPicId;
2954 //if ( pSvcParam->bEnableSSEI )2951 //if ( pSvcParam->bEnableSSEI )
2955 2952
2956 // write parameter sets bitstream here2953 // write parameter sets bitstream here
2957 pCtx->iEncoderError = WelsWriteParameterSets (pCtx, &iNalLen[0], &iCountNal);2954 pCtx->iEncoderError = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal);
2958 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)2955 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
2959 2956
2960 pLayerBsInfo->uiPriorityId = 0;2957 pLayerBsInfo->uiPriorityId = 0;
@@ -2963,12 +2960,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 2 unmodified lines
2963 pLayerBsInfo->uiQualityId = 0;2960 pLayerBsInfo->uiQualityId = 0;
2964 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;2961 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
2965 pLayerBsInfo->iNalCount = iCountNal;2962 pLayerBsInfo->iNalCount = iCountNal;
2966 for (int32_t iNalIndex = 0; iNalIndex < iCountNal; ++ iNalIndex) {
2967 pLayerBsInfo->iNalLengthInByte[iNalIndex] = iNalLen[iNalIndex];
2968 }
2969 2963
2970 ++ pLayerBsInfo;2964 ++ pLayerBsInfo;
2971 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;2965 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
2966 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
2972 ++ iLayerNum;2967 ++ iLayerNum;
2973 }2968 }
2974 2969
@@ -3089,7 +3084,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 114 unmodified lines
3089 int32_t iPayloadSize = 0;3084 int32_t iPayloadSize = 0;
3090 3085
3091 if (pCtx->bNeedPrefixNalFlag) {3086 if (pCtx->bNeedPrefixNalFlag) {
3092 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &iNalLen[0], &iNalIdxInLayer, eNalType, eNalRefIdc,3087 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType, eNalRefIdc,
3093 iPayloadSize);3088 iPayloadSize);
3094 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)3089 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
3095 iLayerSize += iPayloadSize;3090 iLayerSize += iPayloadSize;
@@ -3106,9 +3101,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 10 unmodified lines
3106 &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt,3101 &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt,
3107 pCtx->iFrameBsSize - pCtx->iPosBsBuffer,3102 pCtx->iFrameBsSize - pCtx->iPosBsBuffer,
3108 pCtx->pFrameBs + pCtx->iPosBsBuffer,3103 pCtx->pFrameBs + pCtx->iPosBsBuffer,
3109 &iNalLen[iNalIdxInLayer]);3104 &pLayerBsInfo->pNalLengthInByte[iNalIdxInLayer]);
3110 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)3105 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
3111 iSliceSize = iNalLen[iNalIdxInLayer];3106 iSliceSize = pLayerBsInfo->pNalLengthInByte[iNalIdxInLayer];
3112 3107
3113 iLayerSize += iSliceSize;3108 iLayerSize += iSliceSize;
3114 pCtx->iPosBsBuffer += iSliceSize;3109 pCtx->iPosBsBuffer += iSliceSize;
@@ -3117,7 +3112,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 2 unmodified lines
3117 pLayerBsInfo->uiTemporalId = iCurTid;3112 pLayerBsInfo->uiTemporalId = iCurTid;
3118 pLayerBsInfo->uiQualityId = 0;3113 pLayerBsInfo->uiQualityId = 0;
3119 pLayerBsInfo->uiPriorityId = 0;3114 pLayerBsInfo->uiPriorityId = 0;
3120 pLayerBsInfo->iNalLengthInByte[iNalIdxInLayer] = iSliceSize;
3121 pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;3115 pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
3122 }3116 }
3123 // for dynamic slicing single threading..3117 // for dynamic slicing single threading..
@@ -3260,7 +3254,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 136 unmodified lines
3260 int32_t iSliceSize = 0;3254 int32_t iSliceSize = 0;
3261 int32_t iPayloadSize = 0;3255 int32_t iPayloadSize = 0;
3262 if (bNeedPrefix) {3256 if (bNeedPrefix) {
3263 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &iNalLen[0], &iNalIdxInLayer, eNalType, eNalRefIdc,3257 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType, eNalRefIdc,
3264 iPayloadSize);3258 iPayloadSize);
3265 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)3259 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
3266 iLayerSize += iPayloadSize;3260 iLayerSize += iPayloadSize;
@@ -3275,13 +3269,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 8 unmodified lines
3275 pCtx->iEncoderError = WelsEncodeNal (&pCtx->pOut->sNalList[pCtx->pOut->iNalIndex - 1],3269 pCtx->iEncoderError = WelsEncodeNal (&pCtx->pOut->sNalList[pCtx->pOut->iNalIndex - 1],
3276 &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt,3270 &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt,
3277 pCtx->iFrameBsSize - pCtx->iPosBsBuffer,3271 pCtx->iFrameBsSize - pCtx->iPosBsBuffer,
3278 pCtx->pFrameBs + pCtx->iPosBsBuffer, &iNalLen[iNalIdxInLayer]);3272 pCtx->pFrameBs + pCtx->iPosBsBuffer, &pLayerBsInfo->pNalLengthInByte[iNalIdxInLayer]);
3279 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)3273 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
3280 iSliceSize = iNalLen[iNalIdxInLayer];3274 iSliceSize = pLayerBsInfo->pNalLengthInByte[iNalIdxInLayer];
3281 3275
3282 pCtx->iPosBsBuffer += iSliceSize;3276 pCtx->iPosBsBuffer += iSliceSize;
3283 iLayerSize += iSliceSize;3277 iLayerSize += iSliceSize;
3284 pLayerBsInfo->iNalLengthInByte[iNalIdxInLayer] = iSliceSize;
3285 3278
3286#if defined(SLICE_INFO_OUTPUT)3279#if defined(SLICE_INFO_OUTPUT)
3287 fprintf (stderr,3280 fprintf (stderr,
@@ -3413,10 +3406,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 125 unmodified lines
3413 }3406 }
3414#endif//STAT_OUTPUT3407#endif//STAT_OUTPUT
3415 3408
3409 iCountNal = pLayerBsInfo->iNalCount;
3416 ++ iLayerNum;3410 ++ iLayerNum;
3417 ++ pLayerBsInfo;3411 ++ pLayerBsInfo;
3418 3412
3419 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;3413 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
3414 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
3420 3415
3421 if (pSvcParam->iPaddingFlag && pCtx->pWelsSvcRc[pCtx->uiDependencyId].iPaddingSize > 0) {3416 if (pSvcParam->iPaddingFlag && pCtx->pWelsSvcRc[pCtx->uiDependencyId].iPaddingSize > 0) {
3422 int32_t iPaddingNalSize = 0;3417 int32_t iPaddingNalSize = 0;
@@ -3440,9 +3435,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 17 unmodified lines
3440 pLayerBsInfo->uiQualityId = 0;3435 pLayerBsInfo->uiQualityId = 0;
3441 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;3436 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
3442 pLayerBsInfo->iNalCount = 1;3437 pLayerBsInfo->iNalCount = 1;
3443 pLayerBsInfo->iNalLengthInByte[0] = iPaddingNalSize;3438 pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize;
3444 ++ pLayerBsInfo;3439 ++ pLayerBsInfo;
3445 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;3440 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
3441 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + 1;
3446 ++ iLayerNum;3442 ++ iLayerNum;
3447 }3443 }
3448 3444
@@ -3696,7 +3692,6 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 247 unmodified lines
3696 3692
3697 SDqLayer* pCurLayer = pCtx->pCurDqLayer;3693 SDqLayer* pCurLayer = pCtx->pCurDqLayer;
3698 SSliceCtx* pSliceCtx = pCurLayer->pSliceEncCtx;3694 SSliceCtx* pSliceCtx = pCurLayer->pSliceEncCtx;
3699 int32_t iNalLen[MAX_NAL_UNITS_IN_LAYER] = {0};
3700 int32_t iNalIdxInLayer = *pNalIdxInLayer;3695 int32_t iNalIdxInLayer = *pNalIdxInLayer;
3701 int32_t iSliceIdx = iStartSliceIdx;3696 int32_t iSliceIdx = iStartSliceIdx;
3702 const int32_t kiSliceStep = pCtx->iActiveThreadsNum;3697 const int32_t kiSliceStep = pCtx->iActiveThreadsNum;
@@ -3727,7 +3722,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 24 unmodified lines
3727 }3722 }
3728 3723
3729 if (kbNeedPrefix) {3724 if (kbNeedPrefix) {
3730 iReturn = AddPrefixNal (pCtx, pLayerBsInfo, &iNalLen[0], &iNalIdxInLayer, keNalType, keNalRefIdc, iPayloadSize);3725 iReturn = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, keNalType, keNalRefIdc, iPayloadSize);
3731 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)3726 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
3732 iPartitionBsSize += iPayloadSize;3727 iPartitionBsSize += iPayloadSize;
3733 }3728 }
@@ -3741,13 +3736,12 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 7 unmodified lines
3741 &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt,3736 &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt,
3742 pCtx->iFrameBsSize - pCtx->iPosBsBuffer,3737 pCtx->iFrameBsSize - pCtx->iPosBsBuffer,
3743 pCtx->pFrameBs + pCtx->iPosBsBuffer,3738 pCtx->pFrameBs + pCtx->iPosBsBuffer,
3744 &iNalLen[iNalIdxInLayer]);3739 &pLayerBsInfo->pNalLengthInByte[iNalIdxInLayer]);
3745 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)3740 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
3746 iSliceSize = iNalLen[iNalIdxInLayer];3741 iSliceSize = pLayerBsInfo->pNalLengthInByte[iNalIdxInLayer];
3747 3742
3748 pCtx->iPosBsBuffer += iSliceSize;3743 pCtx->iPosBsBuffer += iSliceSize;
3749 iPartitionBsSize += iSliceSize;3744 iPartitionBsSize += iSliceSize;
3750 pLayerBsInfo->iNalLengthInByte[iNalIdxInLayer] = iSliceSize;
3751 3745
3752#if defined(SLICE_INFO_OUTPUT)3746#if defined(SLICE_INFO_OUTPUT)
3753 fprintf (stderr,3747 fprintf (stderr,
codec/encoder/core/src/slice_multi_threading.cpp+3−3
@@ -548,7 +548,7 @@ int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32 · 547 unmodified lines
548 iLayerSize += pSliceBs->uiBsPos;548 iLayerSize += pSliceBs->uiBsPos;
549 549
550 while (iNalIdx < iCountNal) {550 while (iNalIdx < iCountNal) {
551 pLbi->iNalLengthInByte[iNalIdxBase + iNalIdx] = pSliceBs->iNalLen[iNalIdx];551 pLbi->pNalLengthInByte[iNalIdxBase + iNalIdx] = pSliceBs->iNalLen[iNalIdx];
552 ++ iNalIdx;552 ++ iNalIdx;
553 }553 }
554 pLbi->iNalCount += iCountNal;554 pLbi->iNalCount += iCountNal;
@@ -580,7 +580,7 @@ int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32 · 25 unmodified lines
580 iLayerSize += pSliceBs->uiBsPos;580 iLayerSize += pSliceBs->uiBsPos;
581 581
582 while (iNalIdx < iCountNal) {582 while (iNalIdx < iCountNal) {
583 pLbi->iNalLengthInByte[iNalIdxBase + iNalIdx] = pSliceBs->iNalLen[iNalIdx];583 pLbi->pNalLengthInByte[iNalIdxBase + iNalIdx] = pSliceBs->iNalLen[iNalIdx];
584 ++ iNalIdx;584 ++ iNalIdx;
585 }585 }
586 pLbi->iNalCount += iCountNal;586 pLbi->iNalCount += iCountNal;
@@ -621,7 +621,7 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr · 34 unmodified lines
621 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)621 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
622 iSliceSize += iNalSize;622 iSliceSize += iNalSize;
623 pDst += iNalSize;623 pDst += iNalSize;
624 pLbi->iNalLengthInByte[iNalBase + iNalIdx] = iNalSize;624 pLbi->pNalLengthInByte[iNalBase + iNalIdx] = iNalSize;
625 625
626 ++ iNalIdx;626 ++ iNalIdx;
627 }627 }
codec/encoder/core/src/svc_base_layer_md.cpp+0−3
@@ -1887,9 +1887,6 @@ static inline void MergeSub16Me (const SWelsME& sSrcMe0, const SWelsME& sSrcMe1, · 1886 unmodified lines
1887static inline bool IsSameMv (const SMVUnitXY& sMv0, const SMVUnitXY& sMv1) {1887static inline bool IsSameMv (const SMVUnitXY& sMv0, const SMVUnitXY& sMv1) {
1888 return ((sMv0.iMvX == sMv1.iMvX) && (sMv0.iMvY == sMv1.iMvY));1888 return ((sMv0.iMvX == sMv1.iMvX) && (sMv0.iMvY == sMv1.iMvY));
1889}1889}
1890static inline int32_t Mvd (const SMVUnitXY& sMv, const SMVUnitXY& sMvp) {
1891 return (WELS_ABS (sMv.iMvX - sMvp.iMvX) + WELS_ABS (sMv.iMvY - sMvp.iMvY));
1892}
1893bool TryModeMerge (SMbCache* pMbCache, SWelsMD* pWelsMd, SMB* pCurMb) {1890bool TryModeMerge (SMbCache* pMbCache, SWelsMD* pWelsMd, SMB* pCurMb) {
1894 SWelsME* pMe8x8 = & (pWelsMd->sMe.sMe8x8[0]);1891 SWelsME* pMe8x8 = & (pWelsMd->sMe.sMe8x8[0]);
1895 const bool bSameMv16x8_0 = IsSameMv (pMe8x8[0].sMv, pMe8x8[1].sMv);1892 const bool bSameMv16x8_0 = IsSameMv (pMe8x8[0].sMv, pMe8x8[1].sMv);
codec/encoder/core/src/svc_mode_decision.cpp+0−6
@@ -118,12 +118,6 @@ void WelsMdInterMbEnhancelayer (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCur · 117 unmodified lines
118 WelsMdSpatialelInterMbIlfmdNoilp (pEncCtx, pWelsMd, pSlice, pCurMb, kuiInterLayerRefMbType); //MD process118 WelsMdSpatialelInterMbIlfmdNoilp (pEncCtx, pWelsMd, pSlice, pCurMb, kuiInterLayerRefMbType); //MD process
119}119}
120 120
121//////////////////////////
122//
123//SUPPORTING FUNCS
124//
125//////////////////////////
126
127///////////////////////121///////////////////////
128// do initiation for noILP (needed by ILFMD)122// do initiation for noILP (needed by ILFMD)
129////////////////////////123////////////////////////
codec/encoder/plus/src/welsEncoderExt.cpp+1−1
@@ -483,7 +483,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal (const SSourcePicture* pSrcPic, SF · 482 unmodified lines
483 483
484 iCurLayerBits = 0;484 iCurLayerBits = 0;
485 for (j = 0; j < pLayer->iNalCount; j++) {485 for (j = 0; j < pLayer->iNalCount; j++) {
486 iCurLayerBits += pLayer->iNalLengthInByte[j];486 iCurLayerBits += pLayer->pNalLengthInByte[j];
487 }487 }
488 total_bits += iCurLayerBits;488 total_bits += iCurLayerBits;
489 if (m_pFileBs != NULL)489 if (m_pFileBs != NULL)
codec/processing/src/scrolldetection/ScrollDetection.h+0−5
@@ -46,11 +46,6 @@ · 45 unmodified lines
46 46
47WELSVP_NAMESPACE_BEGIN47WELSVP_NAMESPACE_BEGIN
48 48
49#ifdef HAVE_MMX
50WELSVP_EXTERN_C_BEGIN
51WELSVP_EXTERN_C_END
52#endif
53
54class CScrollDetection : public IStrategy {49class CScrollDetection : public IStrategy {
55 public:50 public:
56 CScrollDetection (int32_t iCpuFlag) {51 CScrollDetection (int32_t iCpuFlag) {
test/api/decode_encode_test.cpp+1−1
@@ -11,7 +11,7 @@ static void UpdateHashFromFrame(const SFrameBSInfo& info, SHA1Context* ctx) { · 10 unmodified lines
11 const SLayerBSInfo& layerInfo = info.sLayerInfo[i];11 const SLayerBSInfo& layerInfo = info.sLayerInfo[i];
12 int layerSize = 0;12 int layerSize = 0;
13 for (int j = 0; j < layerInfo.iNalCount; ++j) {13 for (int j = 0; j < layerInfo.iNalCount; ++j) {
14 layerSize += layerInfo.iNalLengthInByte[j];14 layerSize += layerInfo.pNalLengthInByte[j];
15 }15 }
16 SHA1Input(ctx, layerInfo.pBsBuf, layerSize);16 SHA1Input(ctx, layerInfo.pBsBuf, layerSize);
17 }17 }
test/api/encoder_test.cpp+1−1
@@ -7,7 +7,7 @@ static void UpdateHashFromFrame(const SFrameBSInfo& info, SHA1Context* ctx) { · 6 unmodified lines
7 const SLayerBSInfo& layerInfo = info.sLayerInfo[i];7 const SLayerBSInfo& layerInfo = info.sLayerInfo[i];
8 int layerSize = 0;8 int layerSize = 0;
9 for (int j = 0; j < layerInfo.iNalCount; ++j) {9 for (int j = 0; j < layerInfo.iNalCount; ++j) {
10 layerSize += layerInfo.iNalLengthInByte[j];10 layerSize += layerInfo.pNalLengthInByte[j];
11 }11 }
12 SHA1Input(ctx, layerInfo.pBsBuf, layerSize);12 SHA1Input(ctx, layerInfo.pBsBuf, layerSize);
13 }13 }
test/encoder/EncUT_MotionEstimate.cpp+4−13
@@ -7,16 +7,6 @@ · 6 unmodified lines
7#include "wels_func_ptr_def.h"7#include "wels_func_ptr_def.h"
8#include "cpu.h"8#include "cpu.h"
9 9
10namespace WelsSVCEnc {
11 extern void SetFeatureSearchIn( SWelsFuncPtrList *pFunc, const SWelsME& sMe,
12 const SSlice *pSlice, SScreenBlockFeatureStorage* pRefFeatureStorage,
13 const int32_t kiEncStride, const int32_t kiRefStride,
14 SFeatureSearchIn* pFeatureSearchIn );
15 extern void MotionEstimateFeatureFullSearch( SFeatureSearchIn &sFeatureSearchIn,
16 const uint32_t kuiMaxSearchPoint,
17 SWelsME* pMe);
18}
19
20using namespace WelsSVCEnc;10using namespace WelsSVCEnc;
21 11
22void CopyTargetBlock( uint8_t* pSrcBlock, const int32_t kiBlockSize, SMVUnitXY sTargetMv, const int32_t kiRefPicStride,12void CopyTargetBlock( uint8_t* pSrcBlock, const int32_t kiBlockSize, SMVUnitXY sTargetMv, const int32_t kiRefPicStride,
@@ -377,10 +367,11 @@ TEST_F(FeatureMotionEstimateTest, TestFeatureSearch) { · 354 unmodified lines
377 m_pScreenBlockFeatureStorage->uiSadCostThreshold[BLOCK_8x8] = UINT_MAX;//to avoid early skip367 m_pScreenBlockFeatureStorage->uiSadCostThreshold[BLOCK_8x8] = UINT_MAX;//to avoid early skip
378 uint32_t uiMaxSearchPoint = INT_MAX;368 uint32_t uiMaxSearchPoint = INT_MAX;
379 SFeatureSearchIn sFeatureSearchIn = {0};369 SFeatureSearchIn sFeatureSearchIn = {0};
380 SetFeatureSearchIn(&sFuncList, sMe, &sSlice, m_pScreenBlockFeatureStorage,370 if (SetFeatureSearchIn(&sFuncList, sMe, &sSlice, m_pScreenBlockFeatureStorage,
381 m_iMaxSearchBlock, m_iWidth,371 m_iMaxSearchBlock, m_iWidth,
382 &sFeatureSearchIn);372 &sFeatureSearchIn)) {
383 MotionEstimateFeatureFullSearch( sFeatureSearchIn, uiMaxSearchPoint, &sMe);373 MotionEstimateFeatureFullSearch( sFeatureSearchIn, uiMaxSearchPoint, &sMe);
374 }
384 375
385 bool bMvMatch = sMe.sMv.iMvX==sTargetMv.iMvX && sMe.sMv.iMvY==sTargetMv.iMvY;376 bool bMvMatch = sMe.sMv.iMvX==sTargetMv.iMvX && sMe.sMv.iMvY==sTargetMv.iMvY;
386 bool bFeatureMatch =377 bool bFeatureMatch =

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