modify reserved nal header size and change source frame in NalSizeChecking UT
This commit is contained in:
parent
2171d84f1e
commit
b5cef5d49c
@ -71,7 +71,6 @@ namespace WelsEnc {
|
||||
#define JUMPPACKETSIZE_CONSTRAINT(max_byte) ( max_byte - AVER_MARGIN_BYTES ) //in bytes
|
||||
#define JUMPPACKETSIZE_JUDGE(len,mb_idx,max_byte) ( (len) > JUMPPACKETSIZE_CONSTRAINT(max_byte) ) //( (mb_idx+1)%40/*16slice for compare*/ == 0 ) //
|
||||
//cur_mb_idx is for early tests, can be omit in optimization
|
||||
#define RESERVED_SLICE_HEADER_SIZE (10) //in bytes
|
||||
typedef struct TagSlice SSlice;
|
||||
typedef struct TagDqLayer SDqLayer;
|
||||
typedef struct TagWelsEncCtx sWelsEncCtx;
|
||||
|
@ -132,7 +132,7 @@
|
||||
|
||||
#define INVALID_ID (-1)
|
||||
|
||||
#define NAL_HEADER_ADD_0X30BYTES 50
|
||||
#define NAL_HEADER_ADD_0X30BYTES 20
|
||||
|
||||
#define SLICE_NUM_EXPAND_COEF 2
|
||||
|
||||
|
@ -589,8 +589,8 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa
|
||||
iMbWidth = (kiPicWidth + 15) >> 4;
|
||||
iMbHeight = (kiPicHeight + 15) >> 4;
|
||||
if (pSpatialLayer->sSliceArgument.uiSliceSizeConstraint <= MAX_MACROBLOCK_SIZE_IN_BYTE) {
|
||||
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid iSliceSize (%d) settings!",
|
||||
pSpatialLayer->sSliceArgument.uiSliceSizeConstraint);
|
||||
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid iSliceSize (%d) settings!should be larger than MAX_MACROBLOCK_SIZE_IN_BYTE(%d)",
|
||||
pSpatialLayer->sSliceArgument.uiSliceSizeConstraint,MAX_MACROBLOCK_SIZE_IN_BYTE);
|
||||
return ENC_RETURN_UNSUPPORTED_PARA;
|
||||
}
|
||||
|
||||
@ -610,7 +610,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa
|
||||
pSpatialLayer->sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES;
|
||||
}
|
||||
}
|
||||
pSpatialLayer->sSliceArgument.uiSliceSizeConstraint -= RESERVED_SLICE_HEADER_SIZE;
|
||||
pSpatialLayer->sSliceArgument.uiSliceSizeConstraint -= NAL_HEADER_ADD_0X30BYTES;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
|
@ -603,8 +603,9 @@ int32_t WelsISliceMdEncDynamic (sWelsEncCtx* pEncCtx, SSlice* pSlice) { //pMd +
|
||||
if (pEncCtx->pSvcParam->iEntropyCodingModeFlag) {
|
||||
WelsInitSliceCabac (pEncCtx, pSlice);
|
||||
sDss.iStartPos = 0;
|
||||
}else
|
||||
}else {
|
||||
sDss.iStartPos = BsGetBitsPos (pBs);
|
||||
}
|
||||
for (; ;) {
|
||||
iCurMbIdx = iNextMbIdx;
|
||||
pCurMb = &pMbList[ iCurMbIdx ];
|
||||
@ -1200,9 +1201,9 @@ int32_t WelsMdInterMbLoopOverDynamicSlice (sWelsEncCtx* pEncCtx, SSlice* pSlice,
|
||||
if (pEncCtx->pSvcParam->iEntropyCodingModeFlag) {
|
||||
WelsInitSliceCabac (pEncCtx, pSlice);
|
||||
sDss.iStartPos = 0;
|
||||
}else
|
||||
}else {
|
||||
sDss.iStartPos = BsGetBitsPos (pBs);
|
||||
|
||||
}
|
||||
pSlice->iMbSkipRun = 0;
|
||||
for (;;) {
|
||||
//DYNAMIC_SLICING_ONE_THREAD - MultiD
|
||||
|
@ -127,7 +127,7 @@ static const EncodeFileParam kFileParamArray[] = {
|
||||
},
|
||||
{
|
||||
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
|
||||
"d60627dde96d2e5fb4547e937f1224a3e21698c9", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, false, false, false
|
||||
"8bc8813ee262b356e53eec6dbdc3c88d7d2b7b5c", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, false, false, false
|
||||
},
|
||||
{
|
||||
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
|
||||
@ -148,12 +148,12 @@ static const EncodeFileParam kFileParamArray[] = {
|
||||
},
|
||||
{
|
||||
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
|
||||
"e85b359a629da713e08895b1d10b016ae1a979a0", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, false, false, false
|
||||
"9e35aac6ee12b4516fbee114bc532faae23df76d", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, false, false, false
|
||||
},
|
||||
//for different strategy
|
||||
{
|
||||
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
|
||||
"0178f86f16cb8f23ef70566353dd2e935e469f71", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, true, true, false
|
||||
"1a6dc4f84cada651c4c8b24f879c858e35c2e813", SCREEN_CONTENT_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, true, true, false
|
||||
},
|
||||
{
|
||||
"res/CiscoVT2people_320x192_12fps.yuv",
|
||||
@ -161,7 +161,7 @@ static const EncodeFileParam kFileParamArray[] = {
|
||||
},
|
||||
{
|
||||
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
|
||||
"ef0387ac53e264f5f081afd5ad16baea8c11649a", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, false, false, true
|
||||
"f5a92b7a0c00691e04bf1306c8251a74f989e4e2", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_SIZELIMITED_SLICE, false, 1, false, false, true
|
||||
},
|
||||
{
|
||||
"res/Cisco_Absolute_Power_1280x720_30fps.yuv",
|
||||
|
@ -1091,18 +1091,16 @@ TEST_F (EncoderInterfaceTest, NalSizeChecking) {
|
||||
m_iWidth = pParamExt->iPicWidth;
|
||||
m_iHeight = pParamExt->iPicHeight;
|
||||
m_iPicResSize = m_iWidth * m_iHeight * 3 >> 1;
|
||||
delete []pYUV;
|
||||
if(pYUV)
|
||||
delete []pYUV;
|
||||
pYUV = new unsigned char [m_iPicResSize];
|
||||
ASSERT_TRUE (pYUV != NULL);
|
||||
FileInputStream fileStream;
|
||||
ASSERT_TRUE (fileStream.Open ("res/Cisco_Absolute_Power_1280x720_30fps.yuv"));
|
||||
PrepareOneSrcFrame();
|
||||
for (int i = 0; i < kiFrameNumber; i ++) {
|
||||
if(fileStream.read (pYUV, m_iPicResSize) != m_iPicResSize){
|
||||
int iStartX = rand() % (m_iPicResSize >> 1);
|
||||
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
||||
for (int j = iStartX; j < iEndX; j++)
|
||||
pYUV[j] = rand() % 256;
|
||||
|
||||
break;
|
||||
}
|
||||
iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
|
||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||
@ -1125,7 +1123,7 @@ TEST_F (EncoderInterfaceTest, NalSizeChecking) {
|
||||
m_iPicResSize = m_iWidth * m_iHeight * 3 >> 1;
|
||||
delete []pYUV;
|
||||
pYUV = new unsigned char [m_iPicResSize];
|
||||
|
||||
ASSERT_TRUE (pYUV != NULL);
|
||||
iResult = pPtrEnc->InitializeExt (pParamExt);
|
||||
PrepareOneSrcFrame();
|
||||
|
||||
@ -1137,11 +1135,7 @@ TEST_F (EncoderInterfaceTest, NalSizeChecking) {
|
||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||
|
||||
for (int i = 0; i < kiFrameNumber; i ++) {
|
||||
int iStartX = rand() % (m_iPicResSize >> 1);
|
||||
int iEndX = (iStartX + (rand() % MEM_VARY_SIZE)) % m_iPicResSize;
|
||||
for (int j = iStartX; j < iEndX; j++)
|
||||
pYUV[j] = rand() % 256;
|
||||
|
||||
PrepareOneSrcFrame();
|
||||
iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
|
||||
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
|
||||
pSrcPic->uiTimeStamp += 30;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user