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

Function CavlcParamCal_ref

test/encoder/EncUT_Cavlc.cpp:12–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace {
11
12int32_t CavlcParamCal_ref (int16_t* pCoffLevel, uint8_t* pRun, int16_t* pLevel, int32_t* pTotalCoeff,
13 int32_t iLastIndex) {
14 int32_t iTotalZeros = 0;
15 int32_t iTotalCoeffs = 0;
16
17 while (iLastIndex >= 0 && pCoffLevel[iLastIndex] == 0) {
18 -- iLastIndex;
19 }
20
21 while (iLastIndex >= 0) {
22 int32_t iCountZero = 0;
23 pLevel[iTotalCoeffs] = pCoffLevel[iLastIndex--];
24
25 while (iLastIndex >= 0 && pCoffLevel[iLastIndex] == 0) {
26 ++ iCountZero;
27 -- iLastIndex;
28 }
29 iTotalZeros += iCountZero;
30 pRun[iTotalCoeffs++] = iCountZero;
31 }
32 *pTotalCoeff = iTotalCoeffs;
33 return iTotalZeros;
34}
35
36void TestCavlcParamCalWithEndIdx (PCavlcParamCalFunc func, int endIdx, bool allZero, bool allNonZero) {
37 ENFORCE_STACK_ALIGN_1D (int16_t, coeffLevel, 16, 16);

Callers 1

EncUT_Cavlc.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected