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

Function IdctResAddPred_c

codec/decoder/core/src/decode_mb_aux.cpp:42–77  ·  view source on GitHub ↗

NOTE::: p_RS should NOT be modified and it will lead to mismatch with JSVM. so should allocate kA array to store the temporary value (idct).

Source from the content-addressed store, hash-verified

40//NOTE::: p_RS should NOT be modified and it will lead to mismatch with JSVM.
41// so should allocate kA array to store the temporary value (idct).
42void IdctResAddPred_c (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
43 int16_t iSrc[16];
44
45 uint8_t* pDst = pPred;
46 const int32_t kiStride2 = kiStride << 1;
47 const int32_t kiStride3 = kiStride + kiStride2;
48 int32_t i;
49
50 for (i = 0; i < 4; i++) {
51 const int32_t kiY = i << 2;
52 const int32_t kiT0 = pRs[kiY] + pRs[kiY + 2];
53 const int32_t kiT1 = pRs[kiY] - pRs[kiY + 2];
54 const int32_t kiT2 = (pRs[kiY + 1] >> 1) - pRs[kiY + 3];
55 const int32_t kiT3 = pRs[kiY + 1] + (pRs[kiY + 3] >> 1);
56
57 iSrc[kiY] = kiT0 + kiT3;
58 iSrc[kiY + 1] = kiT1 + kiT2;
59 iSrc[kiY + 2] = kiT1 - kiT2;
60 iSrc[kiY + 3] = kiT0 - kiT3;
61 }
62
63 for (i = 0; i < 4; i++) {
64 int32_t kT1 = iSrc[i] + iSrc[i + 8];
65 int32_t kT2 = iSrc[i + 4] + (iSrc[i + 12] >> 1);
66 int32_t kT3 = (32 + kT1 + kT2) >> 6;
67 int32_t kT4 = (32 + kT1 - kT2) >> 6;
68
69 pDst[i] = WelsClip1 (kT3 + pPred[i]);
70 pDst[i + kiStride3] = WelsClip1 (kT4 + pPred[i + kiStride3]);
71
72 kT1 = iSrc[i] - iSrc[i + 8];
73 kT2 = (iSrc[i + 4] >> 1) - iSrc[i + 12];
74 pDst[i + kiStride] = WelsClip1 (((32 + kT1 + kT2) >> 6) + pDst[i + kiStride]);
75 pDst[i + kiStride2] = WelsClip1 (((32 + kT1 - kT2) >> 6) + pDst[i + kiStride2]);
76 }
77}
78
79void IdctResAddPred8x8_c (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
80 // To make the ASM code easy to write, should using one funciton to apply hor and ver together, such as we did on HEVC

Callers

nothing calls this directly

Calls 1

WelsClip1Function · 0.85

Tested by

no test coverage detected