MCPcopy Create free account
hub / github.com/cisco/openh264 / ParseSignificantCoeffCabac

Function ParseSignificantCoeffCabac

codec/decoder/core/src/parse_mb_syn_cabac.cpp:1364–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1362}
1363
1364int32_t ParseSignificantCoeffCabac (int32_t* pSignificant, int32_t iResProperty, PWelsDecoderContext pCtx) {
1365 uint32_t uiCode;
1366 PWelsCabacCtx pOneCtx = pCtx->pCabacCtx + (iResProperty == LUMA_DC_AC_8 ? NEW_CTX_OFFSET_ONE_8x8 : NEW_CTX_OFFSET_ONE) +
1367 g_kBlockCat2CtxOffsetOne[iResProperty];
1368 PWelsCabacCtx pAbsCtx = pCtx->pCabacCtx + (iResProperty == LUMA_DC_AC_8 ? NEW_CTX_OFFSET_ABS_8x8 : NEW_CTX_OFFSET_ABS) +
1369 g_kBlockCat2CtxOffsetAbs[iResProperty];
1370
1371 const int16_t iMaxType = g_kMaxC2[iResProperty];
1372 int32_t i = g_kMaxPos[iResProperty];
1373 int32_t* pCoff = pSignificant + i;
1374 int32_t c1 = 1;
1375 int32_t c2 = 0;
1376 for (; i >= 0; --i) {
1377 if (*pCoff != 0) {
1378 WELS_READ_VERIFY (DecodeBinCabac (pCtx->pCabacDecEngine, pOneCtx + c1, uiCode));
1379 *pCoff += uiCode;
1380 if (*pCoff == 2) {
1381 WELS_READ_VERIFY (DecodeUEGLevelCabac (pCtx->pCabacDecEngine, pAbsCtx + c2, uiCode));
1382 *pCoff += uiCode;
1383 ++c2;
1384 c2 = WELS_MIN (c2, iMaxType);
1385 c1 = 0;
1386 } else if (c1) {
1387 ++c1;
1388 c1 = WELS_MIN (c1, 4);
1389 }
1390 WELS_READ_VERIFY (DecodeBypassCabac (pCtx->pCabacDecEngine, uiCode));
1391 if (uiCode)
1392 *pCoff = - *pCoff;
1393 }
1394 pCoff--;
1395 }
1396 return ERR_NONE;
1397}
1398
1399int32_t ParseResidualBlockCabac8x8 (PWelsNeighAvail pNeighAvail, uint8_t* pNonZeroCountCache, SBitStringAux* pBsAux,
1400 int32_t iIndex, int32_t iMaxNumCoeff, const uint8_t* pScanTable, int32_t iResProperty,

Callers 2

ParseResidualBlockCabacFunction · 0.85

Calls 3

DecodeBinCabacFunction · 0.85
DecodeUEGLevelCabacFunction · 0.85
DecodeBypassCabacFunction · 0.85

Tested by

no test coverage detected