History

Add Transform 8x8 support Add Intra 8x8 support Add no_deblocking support inside T8x8 Add CABAC parse support Add static data sheet for dequant Fix bugs and clean/astyle the code Remove build warnings Modify the UT cases Fix the ParseNalHeader bug

Haibo committed 11 years ago

Commit e9916c71 parent 473f2e325 files · +1808 −270Browse files

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

Unified · Split

codec/decoder/core/src/au_parser.cpp+19−23
@@ -124,6 +124,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 123 unmodified lines
124124 uiBsZero = pSrcRbsp[iIndex];
125125 if (0 == uiBsZero) {
126126 --iNalSize;
127+ ++ (*pConsumedBytes);
127128 --iIndex;
128129 } else {
129130 break;
@@ -991,16 +992,10 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 861 unmodified lines
991992 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag
992993 pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
993994
994− if (pSps->bSeqScalingMatrixPresentFlag)// For high profile, it is not used in current application. FIXME
995−
995+ if (pSps->bSeqScalingMatrixPresentFlag) {
996996 WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4,
997997 pSps->iScalingList8x8));
998− //if exist, to parse scalinglist matrix value
999−
1000− // WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
1001− // "ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.",
1002− // pSps->bSeqScalingMatrixPresentFlag);
1003− //return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
998+ }
1004999 }
10051000 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4
10061001 WELS_CHECK_SE_UPPER_ERROR (uiCode, SPS_LOG2_MAX_FRAME_NUM_MINUS4_MAX, "log2_max_frame_num_minus4",
@@ -1379,28 +1374,27 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 372 unmodified lines
13791374 pPps->bConstainedIntraPredFlag = !!uiCode;
13801375 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag
13811376 pPps->bRedundantPicCntPresentFlag = !!uiCode;
1382− /*TODO: to judge whether going on to parse*/
1383−//going on to parse high profile syntax, need fix me
1384− if (0) {
1385− WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
1386− pPps->bTransform_8x8_mode_flag = !!uiCode;
1387− WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
1377+
1378+ if (CheckMoreRBSPData (pBsAux)) {
1379+ WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //transform_8x8_mode_flag
1380+ pPps->bTransform8x8ModeFlag = !!uiCode;
1381+ WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //pic_scaling_matrix_present_flag
13881382 pPps->bPicScalingMatrixPresentFlag = !!uiCode;
13891383 if (pPps->bPicScalingMatrixPresentFlag) {
1390− if (pCtx->bSpsAvailFlags[pPps->iSpsId])
1384+ if (pCtx->bSpsAvailFlags[pPps->iSpsId]) {
13911385 WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bPicScalingListPresentFlag,
13921386 pPps->iScalingList4x4, pPps->iScalingList8x8));
1393− else {
1387+ } else {
13941388 pCtx->bSpsLatePps = true;
13951389 WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4,
13961390 pPps->iScalingList8x8));
13971391 }
13981392 }
1399− //add second chroma qp parsing process
1400− WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset,cr
1401− pPps->iChromaQpIndexOffset[1] = iCode;
1402− WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,
1403− "second_chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
1393+ WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //second_chroma_qp_index_offset
1394+ pPps->iChromaQpIndexOffset[1] = iCode;
1395+ WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN,
1396+ PPS_CHROMA_QP_INDEX_OFFSET_MAX, "chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS,
1397+ ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
14041398 }
14051399
14061400 if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
@@ -1481,6 +1475,7 @@ int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* b · 74 unmodified lines
14811475 int iNextScale = 8;
14821476 int iDeltaScale;
14831477 int32_t iCode;
1478+ int32_t iIdx;
14841479 for (int j = 0; j < iScalingListNum; j++) {
14851480 if (iNextScale != 0) {
14861481 WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode));
@@ -1492,8 +1487,9 @@ int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* b · 5 unmodified lines
14921487 if (*bUseDefaultScalingMatrixFlag)
14931488 break;
14941489 }
1495− pScalingList[g_kuiZigzagScan[j]] = (iNextScale == 0) ? iLastScale : iNextScale;
1496− iLastScale = pScalingList[g_kuiZigzagScan[j]];
1490+ iIdx = iScalingListNum == 16 ? g_kuiZigzagScan[j] : g_kuiZigzagScan8x8[j];
1491+ pScalingList[iIdx] = (iNextScale == 0) ? iLastScale : iNextScale;
1492+ iLastScale = pScalingList[iIdx];
14971493 }
14981494
14991495

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