History

add decoder cabac support and add UT

dong zhang committed 12 years ago

Commit cf857451 parent c7b505132 files · +2615 −470Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+23−3
@@ -707,8 +707,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 706 unmodified lines
707707 }
708708
709709 if (pPps->bEntropyCodingModeFlag) {
710− WelsLog (pLogCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(): CABAC in Enhancement layer not supported.");
711− return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_CABAC_EL);
710+ if (pSliceHead->eSliceType != I_SLICE && pSliceHead->eSliceType != SI_SLICE) {
711+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode));
712+ pSliceHead->iCabacInitIdc = uiCode;
713+ } else
714+ pSliceHead->iCabacInitIdc = 0;
712715 }
713716
714717 WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //slice_qp_delta
@@ -1021,6 +1024,10 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 306 unmodified lines
10211024 "pCtx->sMb.pLumaQp[]");
10221025 pCtx->sMb.pChromaQp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
10231026 "pCtx->sMb.pChromaQp[]");
1027+ pCtx->sMb.pMvd[i][0] = (int16_t (*)[16][2])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1028+ int16_t) * MV_A * MB_BLOCK4x4_NUM, "pCtx->sMb.pMvd[][]");
1029+ pCtx->sMb.pCbfDc[i] = (uint8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (uint8_t),
1030+ "pCtx->sMb.pCbfDc[]");
10241031 pCtx->sMb.pNzc[i] = (int8_t (*)[24])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 24,
10251032 "pCtx->sMb.pNzc[]");
10261033 pCtx->sMb.pNzcRs[i] = (int8_t (*)[24])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 24,
@@ -1057,6 +1064,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 30 unmodified lines
10571064 (NULL == pCtx->sMb.pRefIndex[i][0]) ||
10581065 (NULL == pCtx->sMb.pLumaQp[i]) ||
10591066 (NULL == pCtx->sMb.pChromaQp[i]) ||
1067+ (NULL == pCtx->sMb.pMvd[i][0]) ||
1068+ (NULL == pCtx->sMb.pCbfDc[i]) ||
10601069 (NULL == pCtx->sMb.pNzc[i]) ||
10611070 (NULL == pCtx->sMb.pNzcRs[i]) ||
10621071 (NULL == pCtx->sMb.pScaledTCoeff[i]) ||
@@ -1076,7 +1085,6 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 13 unmodified lines
10761085 ++ i;
10771086 } while (i < LAYER_NUM_EXCHANGEABLE);
10781087
1079−
10801088 pCtx->bInitialDqLayersMem = true;
10811089 pCtx->iPicWidthReq = kiMaxWidth;
10821090 pCtx->iPicHeightReq = kiMaxHeight;
@@ -1124,6 +1132,16 @@ void UninitialDqLayersContext (PWelsDecoderContext pCtx) { · 41 unmodified lines
11241132 pCtx->sMb.pChromaQp[i] = NULL;
11251133 }
11261134
1135+ if (pCtx->sMb.pMvd[i][0]) {
1136+ WelsFree (pCtx->sMb.pMvd[i][0], "pCtx->sMb.pMvd[][]");
1137+ pCtx->sMb.pMvd[i][0] = NULL;
1138+ }
1139+
1140+ if (pCtx->sMb.pCbfDc[i]) {
1141+ WelsFree (pCtx->sMb.pCbfDc[i], "pCtx->sMb.pCbfDc[]");
1142+ pCtx->sMb.pCbfDc[i] = NULL;
1143+ }
1144+
11271145 if (pCtx->sMb.pNzc[i]) {
11281146 WelsFree (pCtx->sMb.pNzc[i], "pCtx->sMb.pNzc[]");
11291147
@@ -1754,6 +1772,8 @@ void InitCurDqLayerData (PWelsDecoderContext pCtx, PDqLayer pCurDq) { · 624 unmodified lines
17541772 pCurDq->pRefIndex[0] = pCtx->sMb.pRefIndex[0][0];
17551773 pCurDq->pLumaQp = pCtx->sMb.pLumaQp[0];
17561774 pCurDq->pChromaQp = pCtx->sMb.pChromaQp[0];
1775+ pCurDq->pMvd[0] = pCtx->sMb.pMvd[0][0];
1776+ pCurDq->pCbfDc = pCtx->sMb.pCbfDc[0];
17571777 pCurDq->pNzc = pCtx->sMb.pNzc[0];
17581778 pCurDq->pNzcRs = pCtx->sMb.pNzcRs[0];
17591779 pCurDq->pScaledTCoeff = pCtx->sMb.pScaledTCoeff[0];

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