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

Function WelsCabacGlobalInit

codec/decoder/core/src/cabac_decoder.cpp:37–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35static const int16_t g_kMvdBinPos2Ctx [8] = {0, 1, 2, 3, 3, 3, 3, 3};
36
37void WelsCabacGlobalInit (PWelsDecoderContext pCtx) {
38 for (int32_t iModel = 0; iModel < 4; iModel++) {
39 for (int32_t iQp = 0; iQp <= WELS_QP_MAX; iQp++)
40 for (int32_t iIdx = 0; iIdx < WELS_CONTEXT_COUNT; iIdx++) {
41 int32_t m = g_kiCabacGlobalContextIdx[iIdx][iModel][0];
42 int32_t n = g_kiCabacGlobalContextIdx[iIdx][iModel][1];
43 int32_t iPreCtxState = WELS_CLIP3 ((((m * iQp) >> 4) + n), 1, 126);
44 uint8_t uiValMps = 0;
45 uint8_t uiStateIdx = 0;
46 if (iPreCtxState <= 63) {
47 uiStateIdx = 63 - iPreCtxState;
48 uiValMps = 0;
49 } else {
50 uiStateIdx = iPreCtxState - 64;
51 uiValMps = 1;
52 }
53 pCtx->sWelsCabacContexts[iModel][iQp][iIdx].uiState = uiStateIdx;
54 pCtx->sWelsCabacContexts[iModel][iQp][iIdx].uiMPS = uiValMps;
55 }
56 }
57 pCtx->bCabacInited = true;
58}
59
60// ------------------- 1. context initialization
61void WelsCabacContextInit (PWelsDecoderContext pCtx, uint8_t eSliceType, int32_t iCabacInitIdc, int32_t iQp) {

Callers 1

WelsCabacContextInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected