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

Function FillNeighborCacheIntra

codec/encoder/core/src/md.cpp:51–130  ·  view source on GitHub ↗

fill cache of neighbor MB, containing pNonZeroCount, sample_avail, pIntra4x4PredMode

Source from the content-addressed store, hash-verified

49
50//fill cache of neighbor MB, containing pNonZeroCount, sample_avail, pIntra4x4PredMode
51void FillNeighborCacheIntra (SMbCache* pMbCache, SMB* pCurMb, int32_t iMbWidth) {
52 uint32_t uiNeighborAvail = pCurMb->uiNeighborAvail;
53 uint32_t uiNeighborIntra = 0;
54
55 if (uiNeighborAvail & LEFT_MB_POS) { //LEFT MB
56 int8_t* pLeftMbNonZeroCount = pCurMb->pNonZeroCount - MB_LUMA_CHROMA_BLOCK4x4_NUM;
57 pMbCache->iNonZeroCoeffCount[8] = pLeftMbNonZeroCount[ 3];
58 pMbCache->iNonZeroCoeffCount[16] = pLeftMbNonZeroCount[ 7];
59 pMbCache->iNonZeroCoeffCount[24] = pLeftMbNonZeroCount[11];
60 pMbCache->iNonZeroCoeffCount[32] = pLeftMbNonZeroCount[15];
61
62 pMbCache->iNonZeroCoeffCount[ 13] = pLeftMbNonZeroCount[17];
63 pMbCache->iNonZeroCoeffCount[21] = pLeftMbNonZeroCount[21];
64 pMbCache->iNonZeroCoeffCount[37] = pLeftMbNonZeroCount[19];
65 pMbCache->iNonZeroCoeffCount[45] = pLeftMbNonZeroCount[23];
66
67 uiNeighborIntra |= LEFT_MB_POS;
68
69 if (IS_INTRA4x4 ((pCurMb - 1)->uiMbType)) {
70 int8_t* pLeftMbIntra4x4PredMode = pCurMb->pIntra4x4PredMode - INTRA_4x4_MODE_NUM;
71 pMbCache->iIntraPredMode[8] = pLeftMbIntra4x4PredMode[4];
72 pMbCache->iIntraPredMode[16] = pLeftMbIntra4x4PredMode[5];
73 pMbCache->iIntraPredMode[24] = pLeftMbIntra4x4PredMode[6];
74 pMbCache->iIntraPredMode[32] = pLeftMbIntra4x4PredMode[3];
75 } else { // if ( 0 == constrained_intra_pred_flag || IS_INTRA16x16((pCurMb-1)->uiMbType ))
76 pMbCache->iIntraPredMode[8] =
77 pMbCache->iIntraPredMode[16] =
78 pMbCache->iIntraPredMode[24] =
79 pMbCache->iIntraPredMode[32] = 2; //DC
80 }
81 } else {
82 pMbCache->iNonZeroCoeffCount[ 8] =
83 pMbCache->iNonZeroCoeffCount[16] =
84 pMbCache->iNonZeroCoeffCount[24] =
85 pMbCache->iNonZeroCoeffCount[32] = -1;//unavailable
86 pMbCache->iNonZeroCoeffCount[13] =
87 pMbCache->iNonZeroCoeffCount[21] =
88 pMbCache->iNonZeroCoeffCount[37] =
89 pMbCache->iNonZeroCoeffCount[45] = -1;//unavailable
90
91 pMbCache->iIntraPredMode[8] =
92 pMbCache->iIntraPredMode[16] =
93 pMbCache->iIntraPredMode[24] =
94 pMbCache->iIntraPredMode[32] = -1;//unavailable
95 }
96
97 if (uiNeighborAvail & TOP_MB_POS) { //TOP MB
98 SMB* pTopMb = pCurMb - iMbWidth;
99 ST32 (&pMbCache->iNonZeroCoeffCount[1], LD32 (&pTopMb->pNonZeroCount[12]));
100
101 ST16 (&pMbCache->iNonZeroCoeffCount[6], LD16 (&pTopMb->pNonZeroCount[20]));
102 ST16 (&pMbCache->iNonZeroCoeffCount[30], LD16 (&pTopMb->pNonZeroCount[22]));
103
104 uiNeighborIntra |= TOP_MB_POS;
105
106 if (IS_INTRA4x4 (pTopMb->uiMbType)) {
107 ST32 (pMbCache->iIntraPredMode + 1, LD32 (&pTopMb->pIntra4x4PredMode[0]));
108 } else { // if ( 0 == constrained_intra_pred_flag || IS_INTRA16x16( pTopMb->uiMbType ))

Callers 1

WelsMdIntraInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected