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

Function PrefetchPic

codec/decoder/core/src/pic_queue.cpp:184–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 }
183}
184PPicture PrefetchPic (PPicBuff pPicBuf) {
185 int32_t iPicIdx = 0;
186 PPicture pPic = NULL;
187
188 if (pPicBuf->iCapacity == 0) {
189 return NULL;
190 }
191
192 for (iPicIdx = pPicBuf->iCurrentIdx + 1; iPicIdx < pPicBuf->iCapacity ; ++iPicIdx) {
193 if (pPicBuf->ppPic[iPicIdx] != NULL && !pPicBuf->ppPic[iPicIdx]->bUsedAsRef
194 && pPicBuf->ppPic[iPicIdx]->iRefCount <= 0) {
195 pPic = pPicBuf->ppPic[iPicIdx];
196 break;
197 }
198 }
199 if (pPic != NULL) {
200 pPicBuf->iCurrentIdx = iPicIdx;
201 pPic->iPicBuffIdx = iPicIdx;
202 return pPic;
203 }
204 for (iPicIdx = 0 ; iPicIdx <= pPicBuf->iCurrentIdx ; ++iPicIdx) {
205 if (pPicBuf->ppPic[iPicIdx] != NULL && !pPicBuf->ppPic[iPicIdx]->bUsedAsRef
206 && pPicBuf->ppPic[iPicIdx]->iRefCount <= 0) {
207 pPic = pPicBuf->ppPic[iPicIdx];
208 break;
209 }
210 }
211
212 pPicBuf->iCurrentIdx = iPicIdx;
213 if (pPic != NULL) {
214 pPic->iPicBuffIdx = iPicIdx;
215 }
216 return pPic;
217}
218
219PPicture PrefetchPicForThread (PPicBuff pPicBuf) {
220 PPicture pPic = NULL;

Callers 2

DecodeCurrentAccessUnitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected