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
124 uiBsZero = pSrcRbsp[iIndex];124 uiBsZero = pSrcRbsp[iIndex];
125 if (0 == uiBsZero) {125 if (0 == uiBsZero) {
126 --iNalSize;126 --iNalSize;
127 ++ (*pConsumedBytes);
127 --iIndex;128 --iIndex;
128 } else {129 } else {
129 break;130 break;
@@ -991,16 +992,10 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 861 unmodified lines
991 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag992 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag
992 pSps->bSeqScalingMatrixPresentFlag = !!uiCode;993 pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
993 994
994 if (pSps->bSeqScalingMatrixPresentFlag)// For high profile, it is not used in current application. FIXME995 if (pSps->bSeqScalingMatrixPresentFlag) {
995
996 WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4,996 WELS_READ_VERIFY (ParseScalingList (pSps, pBs, 0, pSps->bSeqScalingListPresentFlag, pSps->iScalingList4x4,
997 pSps->iScalingList8x8));997 pSps->iScalingList8x8));
998 //if exist, to parse scalinglist matrix value998 }
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);
1004 }999 }
1005 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus41000 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4
1006 WELS_CHECK_SE_UPPER_ERROR (uiCode, SPS_LOG2_MAX_FRAME_NUM_MINUS4_MAX, "log2_max_frame_num_minus4",1001 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
1379 pPps->bConstainedIntraPredFlag = !!uiCode;1374 pPps->bConstainedIntraPredFlag = !!uiCode;
1380 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag1375 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag
1381 pPps->bRedundantPicCntPresentFlag = !!uiCode;1376 pPps->bRedundantPicCntPresentFlag = !!uiCode;
1382 /*TODO: to judge whether going on to parse*/1377
1383//going on to parse high profile syntax, need fix me1378 if (CheckMoreRBSPData (pBsAux)) {
1384 if (0) {1379 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //transform_8x8_mode_flag
1385 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));1380 pPps->bTransform8x8ModeFlag = !!uiCode;
1386 pPps->bTransform_8x8_mode_flag = !!uiCode;1381 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //pic_scaling_matrix_present_flag
1387 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode));
1388 pPps->bPicScalingMatrixPresentFlag = !!uiCode;1382 pPps->bPicScalingMatrixPresentFlag = !!uiCode;
1389 if (pPps->bPicScalingMatrixPresentFlag) {1383 if (pPps->bPicScalingMatrixPresentFlag) {
1390 if (pCtx->bSpsAvailFlags[pPps->iSpsId])1384 if (pCtx->bSpsAvailFlags[pPps->iSpsId]) {
1391 WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bPicScalingListPresentFlag,1385 WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bPicScalingListPresentFlag,
1392 pPps->iScalingList4x4, pPps->iScalingList8x8));1386 pPps->iScalingList4x4, pPps->iScalingList8x8));
1393 else {1387 } else {
1394 pCtx->bSpsLatePps = true;1388 pCtx->bSpsLatePps = true;
1395 WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4,1389 WELS_READ_VERIFY (ParseScalingList (NULL, pBsAux, 1, pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4,
1396 pPps->iScalingList8x8));1390 pPps->iScalingList8x8));
1397 }1391 }
1398 }1392 }
1399 //add second chroma qp parsing process1393 WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //second_chroma_qp_index_offset
1400 WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset,cr1394 pPps->iChromaQpIndexOffset[1] = iCode;
1401 pPps->iChromaQpIndexOffset[1] = iCode;1395 WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN,
1402 WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset[1], PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX,1396 PPS_CHROMA_QP_INDEX_OFFSET_MAX, "chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS,
1403 "second_chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));1397 ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET));
1404 }1398 }
1405 1399
1406 if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {1400 if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
@@ -1481,6 +1475,7 @@ int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* b · 74 unmodified lines
1481 int iNextScale = 8;1475 int iNextScale = 8;
1482 int iDeltaScale;1476 int iDeltaScale;
1483 int32_t iCode;1477 int32_t iCode;
1478 int32_t iIdx;
1484 for (int j = 0; j < iScalingListNum; j++) {1479 for (int j = 0; j < iScalingListNum; j++) {
1485 if (iNextScale != 0) {1480 if (iNextScale != 0) {
1486 WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode));1481 WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode));
@@ -1492,8 +1487,9 @@ int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* b · 5 unmodified lines
1492 if (*bUseDefaultScalingMatrixFlag)1487 if (*bUseDefaultScalingMatrixFlag)
1493 break;1488 break;
1494 }1489 }
1495 pScalingList[g_kuiZigzagScan[j]] = (iNextScale == 0) ? iLastScale : iNextScale;1490 iIdx = iScalingListNum == 16 ? g_kuiZigzagScan[j] : g_kuiZigzagScan8x8[j];
1496 iLastScale = pScalingList[g_kuiZigzagScan[j]];1491 pScalingList[iIdx] = (iNextScale == 0) ? iLastScale : iNextScale;
1492 iLastScale = pScalingList[iIdx];
1497 }1493 }
1498 1494
1499 1495

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