History

remove bParseonly in ctx using that in param, and slightly modify the initialize process of decoder

huili2 committed 11 years ago

Commit 777dbc01 parent b700b6711 files · +133 −86Browse files

Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 11 files). Show all

Unified · Split

codec/decoder/core/src/au_parser.cpp+4−4
@@ -317,7 +317,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 316 unmodified lines
317 iNalSize -= NAL_UNIT_HEADER_EXT_SIZE;317 iNalSize -= NAL_UNIT_HEADER_EXT_SIZE;
318 *pConsumedBytes += NAL_UNIT_HEADER_EXT_SIZE;318 *pConsumedBytes += NAL_UNIT_HEADER_EXT_SIZE;
319 319
320 if (pCtx->bParseOnly) {320 if (pCtx->pParam->bParseOnly) {
321 pCurNal->sNalData.sVclNal.pNalPos = pSavedData->pCurPos;321 pCurNal->sNalData.sVclNal.pNalPos = pSavedData->pCurPos;
322 int32_t iTrailingZeroByte = 0;322 int32_t iTrailingZeroByte = 0;
323 while (pSrcNal[iSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes323 while (pSrcNal[iSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes
@@ -346,7 +346,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 22 unmodified lines
346 pSavedData->pCurPos += iActualLen - iOffset;346 pSavedData->pCurPos += iActualLen - iOffset;
347 }347 }
348 } else {348 } else {
349 if (pCtx->bParseOnly) {349 if (pCtx->pParam->bParseOnly) {
350 pCurNal->sNalData.sVclNal.pNalPos = pSavedData->pCurPos;350 pCurNal->sNalData.sVclNal.pNalPos = pSavedData->pCurPos;
351 int32_t iTrailingZeroByte = 0;351 int32_t iTrailingZeroByte = 0;
352 while (pSrcNal[iSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes352 while (pSrcNal[iSrcNalLen - iTrailingZeroByte - 1] == 0x0) //remove final trailing 0 bytes
@@ -1113,7 +1113,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 760 unmodified lines
1113 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //vui_parameters_present_flag1113 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //vui_parameters_present_flag
1114 pSps->bVuiParamPresentFlag = !!uiCode;1114 pSps->bVuiParamPresentFlag = !!uiCode;
1115 1115
1116 if (pCtx->bParseOnly) {1116 if (pCtx->pParam->bParseOnly) {
1117 if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //sps bs exceeds!1117 if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //sps bs exceeds!
1118 pCtx->iErrorCode |= dsOutOfMemory;1118 pCtx->iErrorCode |= dsOutOfMemory;
1119 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY);1119 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY);
@@ -1416,7 +1416,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 296 unmodified lines
1416 memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps));1416 memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps));
1417 pCtx->bPpsAvailFlags[uiPpsId] = true;1417 pCtx->bPpsAvailFlags[uiPpsId] = true;
1418 }1418 }
1419 if (pCtx->bParseOnly) {1419 if (pCtx->pParam->bParseOnly) {
1420 if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds1420 if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds
1421 pCtx->iErrorCode |= dsOutOfMemory;1421 pCtx->iErrorCode |= dsOutOfMemory;
1422 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY);1422 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY);

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